Index: manifest.mf
===================================================================
RCS file: /cvs/xml/tax/manifest.mf,v
retrieving revision 1.17.8.1
diff -u -b -r1.17.8.1 manifest.mf
--- manifest.mf 18 Jun 2003 11:58:10 -0000 1.17.8.1
+++ manifest.mf 24 Jul 2003 09:38:03 -0000
@@ -6,7 +6,7 @@
OpenIDE-Module-Implementation-Version: @XML_BUILD_NUMBER_SUBST@
OpenIDE-Module-Layer: org/netbeans/modules/xml/tax/resources/mf-layer.xml
OpenIDE-Module-IDE-Dependencies: IDE/1 > 3.21
-OpenIDE-Module-Module-Dependencies: org.netbeans.api.xml/1 > @API_SPEC_VERS_SUBST@, org.netbeans.modules.xml.core/2 = @XML_BUILD_NUMBER_SUBST@
+OpenIDE-Module-Module-Dependencies: org.netbeans.api.xml/1 > @API_SPEC_VERS_SUBST@, org.netbeans.modules.xml.core/2 = @XML_BUILD_NUMBER_SUBST@, org.netbeans.libs.xerces/1 = 2.4.0
Class-Path: ext/tax.jar
OpenIDE-Module-Requires: org.openide.modules.InstalledFileLocator
OpenIDE-Module-Public-Packages: -
Index: lib/build.xml
===================================================================
RCS file: /cvs/xml/tax/lib/build.xml,v
retrieving revision 1.20
diff -u -b -r1.20 build.xml
--- lib/build.xml 5 Feb 2003 22:21:59 -0000 1.20
+++ lib/build.xml 24 Jul 2003 09:38:03 -0000
@@ -20,7 +20,9 @@
-
+
+
+
@@ -43,10 +45,10 @@
-
+
-
+
@@ -118,7 +120,7 @@
-
+
2.0.0b4
public void textDecl (String version, String encoding, Augmentations a) {
trace ("textDecl()"); // NOI18N
@@ -368,7 +393,7 @@
}
}
- //??? DTDHAndler
+ // XMLDTDHAndler 2.0.0b4
public void textDecl (String version, String encoding) {
textDecl(version, encoding, null);
}
@@ -696,7 +721,12 @@
} // characters(XMLString)
- //??? DTDHandler
+ // XMLDTDHandler 2.4.0
+ public void ignoredCharacters (XMLString text, Augmentations a) {
+ characters( text, null);
+ }
+
+ // XMLDTDHandler 2.0.0b4
public void characters (XMLString text) {
characters( text, null);
}
@@ -729,7 +759,6 @@
}
} // endElement(QName)
-
/**
* The start of a CDATA section. Buffer its content.
*/
@@ -782,13 +811,31 @@
// not interested
}
+ // XMLDTDHandler 2.4.0
+ public void startExternalSubset(XMLResourceIdentifier entity, Augmentations a) {
+ startEntity(
+ "[dtd]", entity.getPublicId(), entity.getLiteralSystemId(),
+ entity.getBaseSystemId(), null, a
+ );
+ }
+
+ public void startGeneralEntity(String name, XMLResourceIdentifier entity, String encoding, Augmentations a) {
+ startEntity(
+ name, entity.getPublicId(), entity.getLiteralSystemId(),
+ entity.getBaseSystemId(), encoding, a
+ );
+ }
+
/**
* This method notifies of the start of an entity. The document entity
* has the pseudo-name of "[xml]"; The DTD has the pseudo-name of "[dtd];
* parameter entity names start with '%'; and general entity names are
* just the entity name.
+ *
+ * @param encoding special value of "IGNORE" markg parameter
+ * entities in DTD markup (these are ignored)
*/
- public void startEntity (String name, String publicId, String systemId,
+ private void startEntity (String name, String publicId, String systemId,
String baseSystemId, String encoding, Augmentations a) {
trace ("startEntity(" + name + ")"); // NOI18N
@@ -868,15 +915,28 @@
} // startEntity(String,String,String,String)
- //??? DTDHandler
+ // XMLDTDHandler 2.0.0b4
public void startEntity (String name, String publicId, String systemId,
String baseSystemId, String encoding) {
startEntity(name, publicId, systemId, baseSystemId, encoding, null);
}
+ // XMLDTDHanlder 2.4.0
+ public void startParameterEntity(String name, XMLResourceIdentifier entity, String encoding, Augmentations a) {
+ String pname = name;
+ if (false == name.startsWith("%")) {
+ pname = "%" + name;
+ }
+ startEntity(
+ pname, entity.getPublicId(), entity.getLiteralSystemId(),
+ entity.getBaseSystemId(), encoding, a
+ );
+ }
+
/**
* A comment.
*/
+ // XMLDTDHandler 2.4.0 and XMLDocumentHandler
public void comment (XMLString text, Augmentations a) {
trace ("comment()"); // NOI18N
@@ -890,7 +950,7 @@
}
} // comment(XMLString)
- //??? DTDHandler
+ // XMLDTDHandler 2.0.0b4
public void comment (XMLString text) {
comment(text, null);
}
@@ -900,6 +960,7 @@
* target name and, optionally, text data. The data is only meaningful
* to the application.
*/
+ // XMLDTDHandler 2.4.0 and XMLDocumentHandler > 2.0.0b4
public void processingInstruction (String target, XMLString data, Augmentations a) {
trace ("processingInstruction(" + target + ")"); // NOI18N
@@ -913,18 +974,36 @@
}
} // processingInstruction(String,XMLString)
- //??? DTDHandler
+ // XMLDTDHandler 2.0.0b4
public void processingInstruction (String target, XMLString data) {
processingInstruction( target, data, null);
}
+ // XMLDTDHandler 2.4.0
+ public void endExternalSubset(Augmentations a) {
+ endEntity("[dtd]", a);
+ }
+
+ // XMLDTDHandler 2.4.0
+ public void endParameterEntity(String name, Augmentations a) {
+ String pname = name;
+ if (false == name.startsWith("%")) {
+ pname = "%" + name;
+ }
+ endEntity(pname, a);
+ }
+
+ public void endGeneralEntity(String name, Augmentations a) {
+ endEntity(name, a);
+ }
+
/**
* This method notifies the end of an entity. The document entity has
* the pseudo-name of "[xml]"; the DTD has the pseudo-name of "[dtd];
* parameter entity names start with '%'; and general entity names are
* just the entity name.
*/
- public void endEntity (String name, Augmentations a) {
+ private void endEntity (String name, Augmentations a) {
trace ("endEntity(" + name + ")"); // NOI18N
// skip for root entities of XML documents and
@@ -954,11 +1033,27 @@
endEntity(name, null);
}
- // ~~~~~~~~~~~~~ XMLDTDHandler methods ~~~~~~~~~~~~~~~~~~~~~~~~~
+ // XMLDTDHandler methods ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ // XMLDTDHandler 2.4.0
+ public XMLDTDSource getDTDSource() {
+ return xmldtdSource;
+ }
+
+ // XMLDTDHandler 2.4.0
+ public void setDTDSource( XMLDTDSource src) {
+ xmldtdSource = src;
+ }
+
+ // XMLDTDHandler 2.0.0b4
+ public void startDTD ( XMLLocator locator, Augmentations a) {
+ startDTD(locator);
+ }
/**
* The start of the DTD (external part of it is reported by startEntity).
*/
+ // XMLDTDHandler 2.0.0b4
public void startDTD ( XMLLocator locator) {
trace ("startDTD()"); // NOI18N
@@ -980,9 +1075,15 @@
}
} // startDTD()
+ // XMLDTDHandler 2.4.0
+ public void elementDecl (String name, String contentModel, Augmentations a) {
+ elementDecl(name, contentModel);
+ }
+
/**
* An element declaration.
*/
+ // XMLDTDHandler 2.0.0b4
public void elementDecl (String name, String cM) {
trace ("elementDecl(" + name + ")"); // NOI18N
if (ASSERT)
@@ -997,9 +1098,15 @@
} // elementDecl(String,String)
+ // XMLDTDHandler 2.4.0
+ public void startAttlist (String elementName, Augmentations a) {
+ startAttlist(elementName);
+ }
+
/**
* The start of an attribute list.
*/
+ // XMLDTDHandler 2.0.0b4
public void startAttlist (String elementName) {
trace ("startAttlist(" + elementName + ")"); // NOI18N
@@ -1013,9 +1120,21 @@
}
} // startAttlist(String)
+ // XMLDTDHandler 2.4.0
+ public void attributeDecl(String elementName, String attributeName,
+ String type, String[] enumeration,
+ String defaultType, XMLString defaultValue,
+ XMLString nonNormalizedDefaultValue, Augmentations a) {
+ attributeDecl(
+ elementName, attributeName, type,
+ enumeration, defaultType, defaultValue
+ );
+ }
+
/**
* An attribute declaration.
*/
+ // XMLDTDHandler 2.0.0b4
public void attributeDecl (String elementName, String attributeName,
String type, String[] enumeration,
String defaultType, XMLString defaultValue) {
@@ -1051,9 +1170,15 @@
}
} // attributeDecl(String,String,String,String[],String,XMLString)
+ // XMLDTDHandler 2.4.0
+ public void endAttlist (Augmentations a) {
+ endAttlist();
+ }
+
/**
* The end of an attribute list.
*/
+ // XMLDTDHandler 2.0.0b4
public void endAttlist () {
trace ("endAttlist()"); // NOI18N
@@ -1061,6 +1186,11 @@
attlistDecl = null;
} // endAttlist()
+ // XMLDTDHandler 2.4.0
+ public void internalEntityDecl (String name, XMLString text, XMLString nonNormalizedText, Augmentations a) {
+ internalEntityDecl(name, text, nonNormalizedText);
+ }
+
/**
* An internal entity declaration.
*
@@ -1068,6 +1198,7 @@
* '%', whereas the name of a general entity is just the
* entity name.
*/
+ // XMLDTDHandler 2.0.0b4
public void internalEntityDecl (String name, XMLString text, XMLString nonNormalizedText) {
trace ("internalEntityDecl(" + name + ")"); // NOI18N
@@ -1083,6 +1214,12 @@
}
} // internalEntityDecl(String,XMLString)
+ // XMLDTDHandler 2.4.0
+ public void externalEntityDecl (String name, String publicId,
+ String systemId, String baseSystemId, Augmentations a) {
+ externalEntityDecl( name, publicId, systemId, baseSystemId);
+ }
+
/**
* An external entity declaration.
*
@@ -1090,6 +1227,7 @@
* with '%', whereas the name of a general entity is just
* the entity name.
*/
+ // XMLDTDHandler 2.0.0b4
public void externalEntityDecl (String name, String publicId,
String systemId, String baseSystemId) {
@@ -1107,9 +1245,17 @@
}
} // externalEntityDecl(String,String,String)
+ // XMLDTDHAnlder 2.4.0
+ public void unparsedEntityDecl (String name,
+ String publicId, String systemId,
+ String notation, Augmentations a) {
+ unparsedEntityDecl(name, publicId, systemId, notation);
+ }
+
/**
* An unparsed entity declaration.
*/
+ // XMLDTDHAnlder 2.0.0b4
public void unparsedEntityDecl (String name,
String publicId, String systemId,
String notation) {
@@ -1123,9 +1269,15 @@
}
} // unparsedEntityDecl(String,String,String,String)
+ // XMLDTDHandler 2.4.0
+ public void notationDecl (String name, String publicId, String systemId, Augmentations a) {
+ notationDecl(name, publicId, systemId);
+ }
+
/**
* A notation declaration
*/
+ // XMLDTDHandler 2.0.0b4
public void notationDecl (String name, String publicId, String systemId) {
trace ("notationDecl(" + name + ")"); // NOI18N
@@ -1137,12 +1289,18 @@
}
} // notationDecl(String,String,String)
+ // XMLDTDHandler 2.4.0
+ public void startConditional (short type, Augmentations a) {
+ startConditional(type);
+ }
+
/**
* The start of a conditional section.
*
* @param type The type of the conditional section. This value will
* either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
*/
+ // XMLDTDHandler 2.0.0b4
public void startConditional (short type) {
trace ("startConditional(" + type + ")"); // NOI18N
if (ASSERT)
@@ -1160,20 +1318,32 @@
} // startConditional(short)
+ // XMLDTDHandler 2.4.0
+ public void endConditional (Augmentations a) {
+ endConditional();
+ }
+
/**
* The end of a conditional section.
*/
+ // XMLDTDHandler 2.0.0b4
public void endConditional () {
trace ("endConditional()"); // NOI18N
popParentNode ();
} // endConditional()
+ // XMLDTDHandler 2.4.0
+ public void endDTD (Augmentations a) {
+ endDTD();
+ }
+
/**
* The end of the DTD.
*
* @throws SAXException Thrown by handler to signal an error.
*/
+ // XMLDTDHandler 2.0.0b4
public void endDTD () {
trace ("endDTD()"); // NOI18N
@@ -1197,14 +1367,21 @@
} // endDTD()
- // ~~~~~~~~~~~~~~~~~ Content Model parser ~~~~~~~~~~~~~~~~~~~
-
+ // Content Model parser ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
private TreeElementDecl.ContentType lastType; // occurence operators are applied on this
private TreeElementDecl.ContentType contentModel; // OUTPUT result field
private Stack contentModelMembersStack; // stack of parent group members
- public void startContentModel (String elementName) {
+ public XMLDTDContentModelSource getDTDContentModelSource() {
+ return xmldtdContentModelSource;
+ }
+
+ public void setDTDContentModelSource(XMLDTDContentModelSource src) {
+ xmldtdContentModelSource = src;
+ }
+
+ public void startContentModel (String elementName, Augmentations a) {
if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("startContentModel(" + elementName + ")"); // NOI18N
@@ -1213,27 +1390,27 @@
}
- public void any () {
+ public void any (Augmentations a) {
contentModel = new ANYType ();
}
- public void empty () {
+ public void empty (Augmentations a) {
contentModel = new EMPTYType ();
}
- public void pcdata () {
+ public void pcdata (Augmentations a) {
setMembersType (new MixedType ());
}
// it is not called for mixed type
- public void startGroup () {
+ public void startGroup (Augmentations a) {
if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("startGroup()"); // NOI18N
startMembers ();
}
- public void element (String elementName) {
+ public void element (String elementName, Augmentations a) {
if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("element(" + elementName + ")"); // NOI18N
@@ -1242,7 +1419,7 @@
}
// determine type of content model group
- public void separator (short separator) {
+ public void separator (short separator, Augmentations a) {
if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("childrenSeparator()"); // NOI18N
switch (separator) {
@@ -1260,7 +1437,7 @@
//
// INPUT lastType field
//
- public void occurrence (short occurrence) {
+ public void occurrence (short occurrence, Augmentations a) {
if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("childrenOccurrence()"); // NOI18N
switch (occurrence) {
@@ -1279,7 +1456,7 @@
}
- public void endGroup () {
+ public void endGroup (Augmentations a) {
if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("childrenEndGroup()"); // NOI18N
ChildrenType group = getMembersType ();
@@ -1288,7 +1465,7 @@
addMember (lastType);
}
- public void endContentModel () {
+ public void endContentModel (Augmentations a) {
if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug ("endContentModel()"); // NOI18N
if (contentModel == null && lastType == null) { // #PCDATA
@@ -1510,7 +1687,7 @@
if ( Util.THIS.isLoggable() ) {
String location = "";
if (locator != null) {
- String entity = locator.getSystemId ();
+ String entity = locator.getExpandedSystemId ();
int index = entity.lastIndexOf ('/');
entity = entity.substring (index > 0 ? index : 0);
location = entity + "/" + locator.getLineNumber () + ":" + locator.getColumnNumber () ;
Index: lib/test/qa-functional/src/org/netbeans/tax/io/TreeBuilderTest.java
===================================================================
RCS file: /cvs/xml/tax/lib/test/qa-functional/src/org/netbeans/tax/io/TreeBuilderTest.java,v
retrieving revision 1.3
diff -u -b -r1.3 TreeBuilderTest.java
--- lib/test/qa-functional/src/org/netbeans/tax/io/TreeBuilderTest.java 27 Feb 2003 23:45:58 -0000 1.3
+++ lib/test/qa-functional/src/org/netbeans/tax/io/TreeBuilderTest.java 24 Jul 2003 09:38:04 -0000
@@ -83,7 +83,8 @@
final PrintStream errStream = new PrintStream(errOut);
try {
- ClassLoader myl = ParserLoader.getInstance();
+ // ClassLoader myl = ParserLoader.getInstance();
+ ClassLoader myl = getClass().getClassLoader();
InputSource in = new InputSource(new InputStreamReader(this.getClass().getResourceAsStream(name)));
in.setSystemId(getClass().getResource(name).toExternalForm());
Index: src/org/netbeans/modules/xml/tax/parser/TreeStreamSource.java
===================================================================
RCS file: /cvs/xml/tax/src/org/netbeans/modules/xml/tax/parser/TreeStreamSource.java,v
retrieving revision 1.3
diff -u -b -r1.3 TreeStreamSource.java
--- src/org/netbeans/modules/xml/tax/parser/TreeStreamSource.java 27 Feb 2003 23:46:02 -0000 1.3
+++ src/org/netbeans/modules/xml/tax/parser/TreeStreamSource.java 24 Jul 2003 09:38:04 -0000
@@ -113,12 +113,18 @@
*/
private TreeBuilder getImplementation () {
- ParserLoader loader = ParserLoader.getInstance();
+ ClassLoader loader;
+
+ if (Boolean.getBoolean("netbeans.tax.use_private_xni_impl")) { // NOI18N
+ loader = ParserLoader.getInstance();
if (loader == null) {
if ( Util.THIS.isLoggable() ) /* then */ Util.THIS.debug("Can not get loader."); // NOI18N
return null;
}
+ } else {
+ loader = TreeBuilder.class.getClassLoader(); // we need TAX module classloader which sees Xerces 2.4.0 library
+ }
Class impl_c = null;
try {