Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 849 → Rev 850

/sun/xmleditor/trunk/whoTuTwas
1,6 → 1,6
Wer macht was
 
Sascha M.: -validieren, Codedoku
Sascha M.: -Bugfixes, Codedoku
 
Matthias: -Texteditor, restl. Manual
 
59,7 → 59,6
- NullPointerException bei nicht ausgewaehltem default plugin (evtl bei Dokumentwechsel)
- Transformation ignoriert namespace-Informationen, diese gehen verloren, dito comments (PI?)
- TextEditor: "undo" nach oeffnen einer node direkt moeglich (nicht beim ersten Mal)
- Geisterbaum nach schliessen aller Dokumente
 
=============================================================================
 
/sun/xmleditor/trunk/src/document/OurDocument.java
4,10 → 4,10
* Coded by: Group 5, software practice summer 2003
* University of Bielefeld, Germany
*
* @version $Revision: 1.68 $
* @version $Revision: 1.69 $
*
* Last modification: $Date: 2003/07/26 13:05:50 $
* $Id: OurDocument.java,v 1.68 2003/07/26 13:05:50 smcsporr Exp $
* Last modification: $Date: 2003/07/26 13:23:58 $
* $Id: OurDocument.java,v 1.69 2003/07/26 13:23:58 smcsporr Exp $
*/
package src.document;
44,7 → 44,7
*
* @author S. McSporran
*
* @version $Revision: 1.68 $ Last modification: $Date: 2003/07/26 13:05:50 $
* @version $Revision: 1.69 $ Last modification: $Date: 2003/07/26 13:23:58 $
*/
public class OurDocument {
248,7 → 248,7
*
* It parses the XML schema file and retrieves it's 'targetNamespace' attribute
* first to get the schema locations namespace. If no target namespace is
* specified, the default namespace declared in the XML document will be used.
* specified, a default namespace will be used.
*
* @param changeDoc The document who's associated schema should be changed.
* @param dtdFile The new schema's path and filename as <code>File</code>-object.
261,6 → 261,8
*/
public void changeSchemaGrammar(DocumentImpl changeDoc, File schemaFile) {
 
final String defaultNS = "http://www.w3.org/2001/XMLSchema-instance";
 
/* Create an empty DOM document used as data container. */
DocumentImpl tempDocument = new DocumentImpl();
270,7 → 272,7
Element rootElement = changeDoc.getDocumentElement();
rootElement.removeAttribute("xsi:schemaLocation");
myDocument = changeDoc;
log(LogInterface.TYPE_INFO, "Schema removed");
log(LogInterface.TYPE_INFO, "Schema entry removed");
} else {
282,7 → 284,7
tempDocument = aParser.getDocument();
Element schemaRootElement = tempDocument.getDocumentElement();
/* Try to get the 'targetNamespace' attribute. */
/* Try to get the 'targetNamespace' attribute from the schema file. */
String targetNamespaceAttribute = schemaRootElement.getAttribute("targetNamespace");
if (! targetNamespaceAttribute.equals("")) {
291,6 → 293,10
XMLRootElement.setAttribute("xsi:schemaLocation", targetNamespaceAttribute + " " +
schemaFile.getPath());
} else {
/* Set a default schemaLocation attribute when no targetNamespace was available. */
XMLRootElement.setAttribute("xsi:schemaLocation", defaultNS + " " +
schemaFile.getPath());
}
}
410,6 → 416,10
if (((saveDoc.getDoctype()) != null) && (saveDoc.getDoctype().getInternalSubset() == null)) {
String docTypeFile = (new File(saveDoc.getDoctype().getSystemId())).getName();
docTransformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, docTypeFile);
docTransformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
docTransformer.setOutputProperty(OutputKeys.METHOD, "xml");
docTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
docTransformer.setOutputProperty(OutputKeys.VERSION, "1.0");
}
try {
/* Create an OutputStream from saveDoc with ftsi as output target. */
444,6 → 454,10
== null)) {
String docTypeFile = (new File(saveDoc.getDoctype().getSystemId())).getName();
docTransformer.setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, docTypeFile);
docTransformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
docTransformer.setOutputProperty(OutputKeys.METHOD, "xml");
docTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "no");
docTransformer.setOutputProperty(OutputKeys.VERSION, "1.0");
}
try {
/* Create an OutputStream from saveDoc with ftsi as output target. */
/sun/xmleditor/trunk/src/control/DocumentManager.java
4,10 → 4,10
* Coded by: Group 5, software practice summer 2003
* University of Bielefeld, Germany
*
* @version $Revision: 1.129 $
* @version $Revision: 1.130 $
*
* Last modification: $Date: 2003/07/26 11:58:33 $
* $Id: DocumentManager.java,v 1.129 2003/07/26 11:58:33 smcsporr Exp $
* Last modification: $Date: 2003/07/26 13:05:45 $
* $Id: DocumentManager.java,v 1.130 2003/07/26 13:05:45 smcsporr Exp $
*/
 
package src.control;
50,7 → 50,7
*
* @author Group 5
*
* @version $Revision: 1.129 $ Last modification: $Date: 2003/07/26 11:58:33 $
* @version $Revision: 1.130 $ Last modification: $Date: 2003/07/26 13:05:45 $
*/
public class DocumentManager implements ActionListener,DocumentManagerInterface,ChangeListener {
 
779,7 → 779,7
// Show nothing if the openDocumentList is empty.
if (openDocumentList.isEmpty()) {
} else {
 
/* Check if the current index is > -1 for a valide selection */
if (z > -1) {
changeToDocument(pluginTabbedPane.getTitleAt(pluginTabbedPane.getSelectedIndex()));
804,7 → 804,6
*/
public boolean loadDocument() {
/* Give a reference to the log panel to the parser. */
parser.setLogInterface(logInterfaceReference);
834,7 → 833,7
/* Set the properties of the new opened document. */
OurDocument x = new OurDocument(logInterfaceReference);
actualDocument = x;
actualDocument.setFileName(fileChooser.getSelectedFile());
actualDocument.setFileName(fileChooser.getSelectedFile().getAbsoluteFile());
actualDocument.setTitle(actualDocument.getFileName().getName());
 
parser.parse(fileChooser.getSelectedFile());
845,6 → 844,7
pluginTabbedPane.addTab(actualDocument.getTitle(),panel);
openDocumentList.add(actualDocument);
updateView.update();
 
if(validator.validateDocument(actualDocument.getDomDoc(), actualDocument.getFileName())== false)
logInterfaceReference.log(LogInterface.TYPE_ERROR, "The document " + actualDocument.getTitle()+" does not fit to the specified grammar");
actualDocument.setSaved();