You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@apache.org on 2001/07/09 08:52:13 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/xni XMLDTDContentModelHandler.java
andyc 01/07/08 23:52:12
Modified: java/design Tag: xerces_j_2 design.html
java/design/xml Tag: xerces_j_2 design-xni.ent
java/src/org/apache/xerces/impl Tag: xerces_j_2
XMLDTDScanner.java XMLValidator.java
java/src/org/apache/xerces/impl/validation/grammars Tag:
xerces_j_2 DTDGrammar.java
java/src/org/apache/xerces/parsers Tag: xerces_j_2
AbstractXMLDocumentParser.java
java/src/org/apache/xerces/util Tag: xerces_j_2
XMLAttributesImpl.java
java/src/org/apache/xerces/xni Tag: xerces_j_2
XMLDTDContentModelHandler.java
Log:
Implemented changes to XMLDTDContentModelHandler interface.
Revision Changes Path
No revision
No revision
1.1.2.15 +55 -17 xml-xerces/java/design/Attic/design.html
Index: design.html
===================================================================
RCS file: /home/cvs/xml-xerces/java/design/Attic/design.html,v
retrieving revision 1.1.2.14
retrieving revision 1.1.2.15
diff -u -r1.1.2.14 -r1.1.2.15
--- design.html 2001/04/06 10:11:40 1.1.2.14
+++ design.html 2001/07/09 06:51:59 1.1.2.15
@@ -79,6 +79,12 @@
class="interface-title">XMLAttributes</SPAN> <SPAN
class="param-title">attributes</SPAN> )
<LI>
+ <SPAN class="method-title">emptyElement</SPAN> ( <SPAN
+ class="class-title">QName</SPAN> <SPAN
+ class="param-title">element</SPAN>, <SPAN
+ class="interface-title">XMLAttributes</SPAN> <SPAN
+ class="param-title">attributes</SPAN> )
+ <LI>
<SPAN class="method-title">characters</SPAN> ( <SPAN
class="class-title">XMLString</SPAN> <SPAN
class="param-title">text</SPAN> )
@@ -150,6 +156,12 @@
class="interface-title">XMLAttributes</SPAN> <SPAN
class="param-title">attributes</SPAN> )
<LI>
+ <SPAN class="method-title">emptyElement</SPAN> ( <SPAN
+ class="class-title">QName</SPAN> <SPAN
+ class="param-title">element</SPAN>, <SPAN
+ class="interface-title">XMLAttributes</SPAN> <SPAN
+ class="param-title">attributes</SPAN> )
+ <LI>
<SPAN class="method-title">characters</SPAN> ( <SPAN
class="class-title">XMLString</SPAN> <SPAN
class="param-title">text</SPAN> )
@@ -321,10 +333,6 @@
<A name="XMLDTDContentModelHandler"><DL class="interface">
<DT>interface <SPAN class="interface-title">XMLDTDContentModelHandler</SPAN>
<DD class="constants"> constants: <UL>
- <LI>short <SPAN class="constant-title">TYPE_EMPTY</SPAN>
- <LI>short <SPAN class="constant-title">TYPE_ANY</SPAN>
- <LI>short <SPAN class="constant-title">TYPE_MIXED</SPAN>
- <LI>short <SPAN class="constant-title">TYPE_CHILDREN</SPAN>
<LI>short <SPAN class="constant-title">SEPARATOR_CHOICE</SPAN>
<LI>short <SPAN class="constant-title">SEPARATOR_SEQUENCE</SPAN>
<LI>short <SPAN class="constant-title">OCCURS_ZERO_OR_ONE</SPAN>
@@ -335,28 +343,28 @@
<LI>
<SPAN class="method-title">startContentModel</SPAN> (
<SPAN class="class-title">String</SPAN> <SPAN
- class="param-title">elementName</SPAN>, short <SPAN
- class="param-title">type</SPAN> )
- <LI>
- <SPAN class="method-title">mixedElement</SPAN> ( <SPAN
- class="class-title">String</SPAN> <SPAN
class="param-title">elementName</SPAN> )
+ <LI>
+ <SPAN class="method-title">any</SPAN> ( )
+ <LI>
+ <SPAN class="method-title">empty</SPAN> ( )
<LI>
- <SPAN class="method-title">childrenStartGroup</SPAN> (
+ <SPAN class="method-title">startGroup</SPAN> (
)
<LI>
- <SPAN class="method-title">childrenElement</SPAN> ( <SPAN
+ <SPAN class="method-title">pcdata</SPAN> ( )
+ <LI>
+ <SPAN class="method-title">element</SPAN> ( <SPAN
class="class-title">String</SPAN> <SPAN
class="param-title">elementName</SPAN> )
<LI>
- <SPAN class="method-title">childrenSeparator</SPAN> (
- short <SPAN class="param-title">separator</SPAN> )
+ <SPAN class="method-title">separator</SPAN> ( short <SPAN
+ class="param-title">separator</SPAN> )
<LI>
- <SPAN class="method-title">childrenOccurrence</SPAN> (
- short <SPAN class="param-title">occurrence</SPAN> )
+ <SPAN class="method-title">occurrence</SPAN> ( short
+ <SPAN class="param-title">occurrence</SPAN> )
<LI>
- <SPAN class="method-title">childrenEndGroup</SPAN> (
- )
+ <SPAN class="method-title">endGroup</SPAN> ( )
<LI>
<SPAN class="method-title">endContentModel</SPAN> (
)
@@ -525,6 +533,36 @@
</UL>
</DL>
</A></BLOCKQUOTE>
+ <BLOCKQUOTE>
+ <A name="XNIException"><DL class="class">
+ <DT>class <SPAN class="class-title">XNIException</SPAN>
+ <DD class="fields"> fields: <UL>
+ <LI>
+ <SPAN class="class-title">String</SPAN> <SPAN class="field-title">fException</SPAN>
+ </UL>
+ <DD class="constructors"> constructors: <UL>
+ <LI>
+ <SPAN class="constructor-title">XNIException</SPAN> (
+ <SPAN class="class-title">String</SPAN> <SPAN
+ class="param-title">message</SPAN> )
+ <LI>
+ <SPAN class="constructor-title">XNIException</SPAN> (
+ <SPAN class="class-title">Exception</SPAN> <SPAN
+ class="param-title">exception</SPAN> )
+ <LI>
+ <SPAN class="constructor-title">XNIException</SPAN> (
+ <SPAN class="class-title">Exception</SPAN> <SPAN
+ class="param-title">exception</SPAN>, <SPAN
+ class="class-title">String</SPAN> <SPAN
+ class="param-title">message</SPAN> )
+ </UL>
+ <DD class="methods"> methods: <UL>
+ <LI>
+ <SPAN class="method-title">getException</SPAN> (
+ ) : <SPAN class="class-title">String</SPAN>
+ </UL>
+ </DL>
+ </A></BLOCKQUOTE>
<H3>XNI: Parser Pipeline</H3>
<BLOCKQUOTE>
<A name="XMLComponent"><DL class="interface">
@@ -2311,5 +2349,5 @@
( )
</UL>
</DL>
- </A></BLOCKQUOTE> Last modified: $Date: 2001/04/06 10:11:40 $</BODY>
+ </A></BLOCKQUOTE> Last modified: $Date: 2001/07/09 06:51:59 $</BODY>
</HTML>
No revision
No revision
1.1.2.5 +131 -88 xml-xerces/java/design/xml/Attic/design-xni.ent
Index: design-xni.ent
===================================================================
RCS file: /home/cvs/xml-xerces/java/design/xml/Attic/design-xni.ent,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- design-xni.ent 2001/04/06 10:11:43 1.1.2.4
+++ design-xni.ent 2001/07/09 06:52:02 1.1.2.5
@@ -1,5 +1,5 @@
<?xml encoding='US-ASCII'?>
-<!-- $Id: design-xni.ent,v 1.1.2.4 2001/04/06 10:11:43 andyc Exp $ -->
+<!-- $Id: design-xni.ent,v 1.1.2.5 2001/07/09 06:52:02 andyc Exp $ -->
<category name='Xerces Native Interface (XNI)' package='&package;.xni'>
<interface id='document-handler' name='XMLDocumentHandler'>
@@ -12,7 +12,7 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -27,7 +27,7 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -42,7 +42,7 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -51,7 +51,7 @@
<reference idref='string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -63,7 +63,7 @@
<reference idref='string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -75,7 +75,7 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -102,7 +102,7 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -114,7 +114,7 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -123,7 +123,7 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -135,16 +135,28 @@
<reference idref='attributes'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
+ <method name='emptyElement'>
+ <param name='element'>
+ <reference idref='qname'/>
+ </param>
+ <param name='attributes'>
+ <reference idref='attributes'/>
+ </param>
+ <throws>
+ <reference idref='xni-exception'/>
+ </throws>
+ </method>
+
<method name='characters'>
<param name='text'>
<reference idref='string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -153,7 +165,7 @@
<reference idref='string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -162,7 +174,7 @@
<reference idref='qname'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -171,24 +183,24 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
<method name='startCDATA'>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
<method name='endCDATA'>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
<method name='endDocument'>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -201,7 +213,7 @@
<reference idref='namespace-context'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -210,7 +222,7 @@
<reference idref='string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -222,7 +234,7 @@
<reference idref='string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -234,7 +246,7 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -261,7 +273,7 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -270,7 +282,7 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -282,16 +294,28 @@
<reference idref='attributes'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
+ <method name='emptyElement'>
+ <param name='element'>
+ <reference idref='qname'/>
+ </param>
+ <param name='attributes'>
+ <reference idref='attributes'/>
+ </param>
+ <throws>
+ <reference idref='xni-exception'/>
+ </throws>
+ </method>
+
<method name='characters'>
<param name='text'>
<reference idref='string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -300,7 +324,7 @@
<reference idref='string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -309,7 +333,7 @@
<reference idref='qname'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -318,19 +342,19 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
<method name='startCDATA'>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
<method name='endCDATA'>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -342,13 +366,13 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
<method name='endDocumentFragment'>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -404,7 +428,7 @@
<method name='startDTD'>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -413,7 +437,7 @@
<reference idref='string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -425,7 +449,7 @@
<reference idref='string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -452,7 +476,7 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -464,7 +488,7 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -473,7 +497,7 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -485,7 +509,7 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -494,7 +518,7 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -520,13 +544,13 @@
<reference idref='string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
<method name='endAttlist'>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -538,7 +562,7 @@
<reference idref='string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -553,7 +577,7 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -571,7 +595,7 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -586,7 +610,7 @@
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -595,18 +619,18 @@
<primitive type='short'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
<method name='endConditional'>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
<method name='endDTD'>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -614,22 +638,6 @@
<interface id='dtd-content-model-handler' name='XMLDTDContentModelHandler'>
- <constant name='TYPE_EMPTY'>
- <primitive type='short'/>
- </constant>
-
- <constant name='TYPE_ANY'>
- <primitive type='short'/>
- </constant>
-
- <constant name='TYPE_MIXED'>
- <primitive type='short'/>
- </constant>
-
- <constant name='TYPE_CHILDREN'>
- <primitive type='short'/>
- </constant>
-
<constant name='SEPARATOR_CHOICE'>
<primitive type='short'/>
</constant>
@@ -654,65 +662,71 @@
<param name='elementName'>
<reference idref='java-string'/>
</param>
- <param name='type'>
- <primitive type='short'/>
- </param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
- <method name='mixedElement'>
- <param name='elementName'>
- <reference idref='java-string'/>
- </param>
+ <method name='any'>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
- <method name='childrenStartGroup'>
+ <method name='empty'>
+ <throws>
+ <reference idref='xni-exception'/>
+ </throws>
+ </method>
+
+ <method name='startGroup'>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
- <method name='childrenElement'>
+ <method name='pcdata'>
+ <throws>
+ <reference idref='xni-exception'/>
+ </throws>
+ </method>
+
+ <method name='element'>
<param name='elementName'>
<reference idref='java-string'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
- <method name='childrenSeparator'>
+ <method name='separator'>
<param name='separator'>
<primitive type='short'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
- <method name='childrenOccurrence'>
+ <method name='occurrence'>
<param name='occurrence'>
<primitive type='short'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
- <method name='childrenEndGroup'>
+ <method name='endGroup'>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
<method name='endContentModel'>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -1028,6 +1042,35 @@
</interface>
+ <class id='xni-exception' name='XNIException'>
+ <field name='fException'>
+ <reference idref='java-string'/>
+ </field>
+ <constructor>
+ <param name='message'>
+ <reference idref='java-string'/>
+ </param>
+ </constructor>
+ <constructor>
+ <param name='exception'>
+ <reference idref='java-exception'/>
+ </param>
+ </constructor>
+ <constructor>
+ <param name='exception'>
+ <reference idref='java-exception'/>
+ </param>
+ <param name='message'>
+ <reference idref='java-string'/>
+ </param>
+ </constructor>
+ <method name='getException'>
+ <returns>
+ <reference idref='java-string'/>
+ </returns>
+ </method>
+ </class>
+
</category>
<category name='XNI: Parser Pipeline' package='&package;.xni.pipeline'>
@@ -1038,7 +1081,7 @@
<reference idref='configuration-manager'/>
</param>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
@@ -1235,7 +1278,7 @@
<reference idref='java-io-exception'/>
</throws>
<throws>
- <reference idref='sax-exception'/>
+ <reference idref='xni-exception'/>
</throws>
</method>
No revision
No revision
1.1.2.88 +47 -35 xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLDTDScanner.java
Index: XMLDTDScanner.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLDTDScanner.java,v
retrieving revision 1.1.2.87
retrieving revision 1.1.2.88
diff -u -r1.1.2.87 -r1.1.2.88
--- XMLDTDScanner.java 2001/05/22 05:00:47 1.1.2.87
+++ XMLDTDScanner.java 2001/07/09 06:52:03 1.1.2.88
@@ -88,7 +88,7 @@
* @author Glenn Marcy, IBM
* @author Eric Ye, IBM
*
- * @version $Id: XMLDTDScanner.java,v 1.1.2.87 2001/05/22 05:00:47 andyc Exp $
+ * @version $Id: XMLDTDScanner.java,v 1.1.2.88 2001/07/09 06:52:03 andyc Exp $
*/
public class XMLDTDScanner
extends XMLScanner
@@ -685,21 +685,22 @@
}
// content model
+ if (fDTDContentModelHandler != null) {
+ fDTDContentModelHandler.startContentModel(name);
+ }
String contentModel = null;
if (fEntityScanner.skipString("EMPTY")) {
contentModel = "EMPTY";
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.startContentModel(name,
- XMLDTDContentModelHandler.TYPE_EMPTY);
+ fDTDContentModelHandler.empty();
}
}
else if (fEntityScanner.skipString("ANY")) {
contentModel = "ANY";
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.startContentModel(name,
- XMLDTDContentModelHandler.TYPE_ANY);
+ fDTDContentModelHandler.any();
}
}
else {
@@ -707,6 +708,9 @@
reportFatalError("MSG_OPEN_PAREN_OR_ELEMENT_TYPE_REQUIRED_IN_CHILDREN",
new Object[]{name});
}
+ if (fDTDContentModelHandler != null) {
+ fDTDContentModelHandler.startGroup();
+ }
fStringBuffer.clear();
fStringBuffer.append('(');
fMarkUpDepth++;
@@ -714,22 +718,19 @@
// Mixed content model
if (fEntityScanner.skipString("#PCDATA")) {
- // call handler
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.startContentModel(name,
- XMLDTDContentModelHandler.TYPE_MIXED);
- }
scanMixed(name);
}
else { // children content
- // call handler
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.startContentModel(name,
- XMLDTDContentModelHandler.TYPE_CHILDREN);
- }
scanChildren(name);
}
contentModel = fStringBuffer.toString();
+ /***
+ // NOTE: The endGroup call is done in scanMixed and
+ // scanChildren, respectively.
+ if (fDTDContentModelHandler != null) {
+ fDTDContentModelHandler.endGroup();
+ }
+ /***/
}
// call handler
@@ -770,9 +771,17 @@
String childName = null;
fStringBuffer.append("#PCDATA");
+ // call handler
+ if (fDTDContentModelHandler != null) {
+ fDTDContentModelHandler.pcdata();
+ }
skipSeparator(false, !scanningInternalSubset());
while (fEntityScanner.skipChar('|')) {
fStringBuffer.append('|');
+ // call handler
+ if (fDTDContentModelHandler != null) {
+ fDTDContentModelHandler.separator(XMLDTDContentModelHandler.SEPARATOR_CHOICE);
+ }
skipSeparator(false, !scanningInternalSubset());
childName = fEntityScanner.scanName();
@@ -783,7 +792,7 @@
fStringBuffer.append(childName);
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.mixedElement(childName);
+ fDTDContentModelHandler.element(childName);
}
skipSeparator(false, !scanningInternalSubset());
}
@@ -793,6 +802,11 @@
// case we cross the boundary of an entity between the two characters.
if (fEntityScanner.skipString(")*")) {
fStringBuffer.append(")*");
+ // call handler
+ if (fDTDContentModelHandler != null) {
+ fDTDContentModelHandler.endGroup();
+ fDTDContentModelHandler.occurrence(XMLDTDContentModelHandler.OCCURS_ZERO_OR_MORE);
+ }
}
else if (childName != null) {
reportFatalError("MixedContentUnterminated",
@@ -800,6 +814,10 @@
}
else if (fEntityScanner.skipChar(')')){
fStringBuffer.append(')');
+ // call handler
+ if (fDTDContentModelHandler != null) {
+ fDTDContentModelHandler.endGroup();
+ }
}
else {
reportFatalError("MSG_CLOSE_PAREN_REQUIRED_IN_CHILDREN",
@@ -827,10 +845,6 @@
private final void scanChildren(String elName)
throws IOException, XNIException {
- // call handler
- if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.childrenStartGroup();
- }
fContentDepth = 0;
pushContentStack(0);
int currentOp = 0;
@@ -838,11 +852,11 @@
while (true) {
if (fEntityScanner.skipChar('(')) {
fMarkUpDepth++;
+ fStringBuffer.append('(');
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.childrenStartGroup();
+ fDTDContentModelHandler.startGroup();
}
- fStringBuffer.append('(');
// push current op on stack and reset it
pushContentStack(currentOp);
currentOp = 0;
@@ -858,7 +872,7 @@
}
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.childrenElement(childName);
+ fDTDContentModelHandler.element(childName);
}
fStringBuffer.append(childName);
c = fEntityScanner.peekChar();
@@ -875,7 +889,7 @@
else {
oc = XMLDTDContentModelHandler.OCCURS_ONE_OR_MORE;
}
- fDTDContentModelHandler.childrenOccurrence(oc);
+ fDTDContentModelHandler.occurrence(oc);
}
fEntityScanner.scanChar();
fStringBuffer.append((char)c);
@@ -887,8 +901,7 @@
currentOp = c;
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.childrenSeparator(
- XMLDTDContentModelHandler.SEPARATOR_SEQUENCE);
+ fDTDContentModelHandler.separator(XMLDTDContentModelHandler.SEPARATOR_SEQUENCE);
}
fEntityScanner.scanChar();
fStringBuffer.append(',');
@@ -898,8 +911,7 @@
currentOp = c;
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.childrenSeparator(
- XMLDTDContentModelHandler.SEPARATOR_CHOICE);
+ fDTDContentModelHandler.separator(XMLDTDContentModelHandler.SEPARATOR_CHOICE);
}
fEntityScanner.scanChar();
fStringBuffer.append('|');
@@ -911,7 +923,7 @@
}
// call handler
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.childrenEndGroup();
+ fDTDContentModelHandler.endGroup();
}
// restore previous op
currentOp = popContentStack();
@@ -922,28 +934,28 @@
// want to trigger endEntity too early in case we cross the
// boundary of an entity between the two characters.
if (fEntityScanner.skipString(")?")) {
+ fStringBuffer.append(")?");
// call handler
if (fDTDContentModelHandler != null) {
oc = XMLDTDContentModelHandler.OCCURS_ZERO_OR_ONE;
- fDTDContentModelHandler.childrenOccurrence(oc);
+ fDTDContentModelHandler.occurrence(oc);
}
- fStringBuffer.append(")?");
}
else if (fEntityScanner.skipString(")+")) {
+ fStringBuffer.append(")+");
// call handler
if (fDTDContentModelHandler != null) {
oc = XMLDTDContentModelHandler.OCCURS_ONE_OR_MORE;
- fDTDContentModelHandler.childrenOccurrence(oc);
+ fDTDContentModelHandler.occurrence(oc);
}
- fStringBuffer.append(")+");
}
else if (fEntityScanner.skipString(")*")) {
+ fStringBuffer.append(")*");
// call handler
if (fDTDContentModelHandler != null) {
oc = XMLDTDContentModelHandler.OCCURS_ZERO_OR_MORE;
- fDTDContentModelHandler.childrenOccurrence(oc);
+ fDTDContentModelHandler.occurrence(oc);
}
- fStringBuffer.append(")*");
}
else {
// no occurrence specified
1.1.2.71 +58 -139 xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLValidator.java
Index: XMLValidator.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/Attic/XMLValidator.java,v
retrieving revision 1.1.2.70
retrieving revision 1.1.2.71
diff -u -r1.1.2.70 -r1.1.2.71
--- XMLValidator.java 2001/05/09 07:20:30 1.1.2.70
+++ XMLValidator.java 2001/07/09 06:52:04 1.1.2.71
@@ -124,7 +124,7 @@
* @author Andy Clark, IBM
* @author Jeffrey Rodriguez IBM
*
- * @version $Id: XMLValidator.java,v 1.1.2.70 2001/05/09 07:20:30 andyc Exp $
+ * @version $Id: XMLValidator.java,v 1.1.2.71 2001/07/09 06:52:04 andyc Exp $
*/
public class XMLValidator
implements XMLComponent,
@@ -340,6 +340,9 @@
/** True if inside of element content. */
private boolean fInElementContent = false;
+ /** Mixed. */
+ private boolean fMixed;
+
// temporary variables
/** Temporary element declaration. */
@@ -1597,23 +1600,8 @@
// XMLDTDContentModelHandler methods
//
- /**
- * The start of a content model. Depending on the type of the content
- * model, specific methods may be called between the call to the
- * startContentModel method and the call to the endContentModel method.
- *
- * @param elementName The name of the element.
- * @param type The content model type.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see TYPE_EMPTY
- * @see TYPE_ANY
- * @see TYPE_MIXED
- * @see TYPE_CHILDREN
- */
- public void startContentModel(String elementName, short type)
- throws XNIException {
+ /** Start content model. */
+ public void startContentModel(String elementName) throws XNIException {
if (fValidation) {
fDTDElementDeclName = elementName;
@@ -1621,166 +1609,97 @@
}
// call handlers
- fDTDGrammar.startContentModel(elementName, type);
+ fDTDGrammar.startContentModel(elementName);
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.startContentModel(elementName, type);
+ fDTDContentModelHandler.startContentModel(elementName);
}
- } // startContentModel(String,short)
+ } // startContentModel(String)
- /**
- * A referenced element in a mixed content model. If the mixed content
- * model only allows text content, then this method will not be called
- * for that model. However, if this method is called for a mixed
- * content model, then the zero or more occurrence count is implied.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_MIXED.
- *
- * @param elementName The name of the referenced element.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see TYPE_MIXED
- */
- public void mixedElement(String elementName) throws XNIException {
+ /** ANY. */
+ public void any() throws XNIException {}
- // check VC: No duplicate Types, in a single mixed-content declaration
- if (fValidation) {
- if (fMixedElementTypes.contains(elementName)) {
- fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
- "DuplicateTypeInMixedContent",
- new Object[]{fDTDElementDeclName, elementName},
- XMLErrorReporter.SEVERITY_ERROR);
- } else {
- fMixedElementTypes.addElement(elementName);
- }
- }
+ /** EMPTY. */
+ public void empty() throws XNIException {}
+
+ /** Start group. */
+ public void startGroup() throws XNIException {
+ fMixed = false;
// call handlers
- fDTDGrammar.mixedElement(elementName);
+ fDTDGrammar.startGroup();
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.mixedElement(elementName);
+ fDTDContentModelHandler.startGroup();
}
- } // mixedElement(elementName)
+ } // startGroup()
- /**
- * The start of a children group.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
- * <p>
- * <strong>Note:</strong> Children groups can be nested and have
- * associated occurrence counts.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see TYPE_CHILDREN
- */
- public void childrenStartGroup() throws XNIException {
-
- // call handlers
- fDTDGrammar.childrenStartGroup();
+ /** #PCDATA. */
+ public void pcdata() {
+ fMixed = true;
+ fDTDGrammar.pcdata();
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.childrenStartGroup();
+ fDTDContentModelHandler.pcdata();
}
+ } // pcdata()
- } // childrenStartGroup()
-
- /**
- * A referenced element in a children content model.
- *
- * @param elementName The name of the referenced element.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see TYPE_CHILDREN
- */
- public void childrenElement(String elementName) throws XNIException {
+ /** Element. */
+ public void element(String elementName) throws XNIException {
+ // check VC: No duplicate Types, in a single mixed-content declaration
+ if (fMixed && fValidation) {
+ if (fMixedElementTypes.contains(elementName)) {
+ fErrorReporter.reportError(XMLMessageFormatter.XML_DOMAIN,
+ "DuplicateTypeInMixedContent",
+ new Object[]{fDTDElementDeclName, elementName},
+ XMLErrorReporter.SEVERITY_ERROR);
+ } else {
+ fMixedElementTypes.addElement(elementName);
+ }
+ }
+
// call handlers
- fDTDGrammar.childrenElement(elementName);
+ fDTDGrammar.element(elementName);
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.childrenElement(elementName);
+ fDTDContentModelHandler.element(elementName);
}
} // childrenElement(String)
- /**
- * The separator between choices or sequences of a children content
- * model.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
- *
- * @param separator The type of children separator.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see SEPARATOR_CHOICE
- * @see SEPARATOR_SEQUENCE
- * @see TYPE_CHILDREN
- */
- public void childrenSeparator(short separator) throws XNIException {
+ /** Separator. */
+ public void separator(short separator) throws XNIException {
// call handlers
- fDTDGrammar.childrenSeparator(separator);
+ fDTDGrammar.separator(separator);
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.childrenSeparator(separator);
+ fDTDContentModelHandler.separator(separator);
}
- } // childrenSeparator(short)
+ } // separator(short)
- /**
- * The occurrence count for a child in a children content model.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
- *
- * @param occurrence The occurrence count for the last children element
- * or children group.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see OCCURS_ZERO_OR_ONE
- * @see OCCURS_ZERO_OR_MORE
- * @see OCCURS_ONE_OR_MORE
- * @see TYPE_CHILDREN
- */
- public void childrenOccurrence(short occurrence) throws XNIException {
+ /** Occurrence. */
+ public void occurrence(short occurrence) throws XNIException {
// call handlers
- fDTDGrammar.childrenOccurrence(occurrence);
+ fDTDGrammar.occurrence(occurrence);
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.childrenOccurrence(occurrence);
+ fDTDContentModelHandler.occurrence(occurrence);
}
- } // childrenOccurrence(short)
+ } // occurrence(short)
- /**
- * The end of a children group.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
- *
- * @see TYPE_CHILDREN
- */
- public void childrenEndGroup() throws XNIException {
+ /** End group. */
+ public void endGroup() throws XNIException {
// call handlers
- fDTDGrammar.childrenEndGroup();
+ fDTDGrammar.endGroup();
if (fDTDContentModelHandler != null) {
- fDTDContentModelHandler.childrenEndGroup();
+ fDTDContentModelHandler.endGroup();
}
- } // childrenEndGroup()
+ } // endGroup()
- /**
- * The end of a content model.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
+ /** End content model. */
public void endContentModel() throws XNIException {
// call handlers
No revision
No revision
1.1.2.41 +73 -142 xml-xerces/java/src/org/apache/xerces/impl/validation/grammars/Attic/DTDGrammar.java
Index: DTDGrammar.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/validation/grammars/Attic/DTDGrammar.java,v
retrieving revision 1.1.2.40
retrieving revision 1.1.2.41
diff -u -r1.1.2.40 -r1.1.2.41
--- DTDGrammar.java 2001/05/09 07:20:41 1.1.2.40
+++ DTDGrammar.java 2001/07/09 06:52:06 1.1.2.41
@@ -93,7 +93,7 @@
* @author Jeffrey Rodriguez, IBM
* @author Andy Clark, IBM
*
- * @version $Id: DTDGrammar.java,v 1.1.2.40 2001/05/09 07:20:41 andyc Exp $
+ * @version $Id: DTDGrammar.java,v 1.1.2.41 2001/07/09 06:52:06 andyc Exp $
*/
public class DTDGrammar
extends Grammar
@@ -138,6 +138,9 @@
// temp variables
+ /** Mixed. */
+ private boolean fMixed;
+
/** Element declaration. */
private XMLElementDecl fElementDecl = new XMLElementDecl();
@@ -766,22 +769,8 @@
// XMLDTDContentModelHandler methods
//
- /**
- * The start of a content model. Depending on the type of the content
- * model, specific methods may be called between the call to the
- * startContentModel method and the call to the endContentModel method.
- *
- * @param elementName The name of the element.
- * @param type The content model type.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see TYPE_EMPTY
- * @see TYPE_ANY
- * @see TYPE_MIXED
- * @see TYPE_CHILDREN
- */
- public void startContentModel(String elementName, short type)
+ /** Start content model. */
+ public void startContentModel(String elementName)
throws XNIException {
XMLElementDecl elementDecl = (XMLElementDecl) this.fElementDeclTab.get( elementName);
@@ -791,151 +780,93 @@
fDepth = 0;
initializeContentModelStack();
- } // startContentModel(String,short)
-
- /**
- * A referenced element in a mixed content model. If the mixed content
- * model only allows text content, then this method will not be called
- * for that model. However, if this method is called for a mixed
- * content model, then the zero or more occurrence count is implied.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_MIXED.
- *
- * @param elementName The name of the referenced element.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see TYPE_MIXED
- */
- public void mixedElement(String elementName) throws XNIException {
+ } // startContentModel(String)
- if (fNodeIndexStack[fDepth] == -1 ) {
- fNodeIndexStack[fDepth] = addUniqueLeafNode(elementName);
- }
- else {
- fNodeIndexStack[fDepth] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_CHOICE,
- fNodeIndexStack[fDepth],
- addUniqueLeafNode(elementName));
- }
+ /** ANY. */
+ public void any() throws XNIException {}
- } // mixedElement(String)
+ /** EMPTY. */
+ public void empty() throws XNIException {}
- /**
- * The start of a children group.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
- * <p>
- * <strong>Note:</strong> Children groups can be nested and have
- * associated occurrence counts.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see TYPE_CHILDREN
- */
- public void childrenStartGroup() throws XNIException {
+ /** Start group. */
+ public void startGroup() throws XNIException {
fDepth++;
initializeContentModelStack();
- } // childrenStartGroup()
+ fMixed = false;
+ } // startGroup()
- /**
- * A referenced element in a children content model.
- *
- * @param elementName The name of the referenced element.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see TYPE_CHILDREN
- */
- public void childrenElement(String elementName) throws XNIException {
- fNodeIndexStack[fDepth] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_LEAF, elementName);
- } // childrenElement(String)
+ /** #PCDATA. */
+ public void pcdata() throws XNIException {
+ fMixed = true;
+ } // pcdata()
+
+ /** Element. */
+ public void element(String elementName) throws XNIException {
+ if (fMixed) {
+ if (fNodeIndexStack[fDepth] == -1 ) {
+ fNodeIndexStack[fDepth] = addUniqueLeafNode(elementName);
+ }
+ else {
+ fNodeIndexStack[fDepth] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_CHOICE,
+ fNodeIndexStack[fDepth],
+ addUniqueLeafNode(elementName));
+ }
+ }
+ else {
+ fNodeIndexStack[fDepth] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_LEAF, elementName);
+ }
+ } // element(String)
- /**
- * The separator between choices or sequences of a children content
- * model.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
- *
- * @param separator The type of children separator.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see SEPARATOR_CHOICE
- * @see SEPARATOR_SEQUENCE
- * @see TYPE_CHILDREN
- */
- public void childrenSeparator(short separator) throws XNIException {
+ /** Separator. */
+ public void separator(short separator) throws XNIException {
- if (fOpStack[fDepth] != XMLContentSpec.CONTENTSPECNODE_SEQ && separator == XMLDTDContentModelHandler.SEPARATOR_CHOICE ) {
- if (fPrevNodeIndexStack[fDepth] != -1) {
- fNodeIndexStack[fDepth] = addContentSpecNode(fOpStack[fDepth], fPrevNodeIndexStack[fDepth], fNodeIndexStack[fDepth]);
- }
- fPrevNodeIndexStack[fDepth] = fNodeIndexStack[fDepth];
- fOpStack[fDepth] = XMLContentSpec.CONTENTSPECNODE_CHOICE;
- } else if (fOpStack[fDepth] != XMLContentSpec.CONTENTSPECNODE_CHOICE && separator == XMLDTDContentModelHandler.SEPARATOR_SEQUENCE) {
- if (fPrevNodeIndexStack[fDepth] != -1) {
- fNodeIndexStack[fDepth] = addContentSpecNode(fOpStack[fDepth], fPrevNodeIndexStack[fDepth], fNodeIndexStack[fDepth]);
+ if (!fMixed) {
+ if (fOpStack[fDepth] != XMLContentSpec.CONTENTSPECNODE_SEQ && separator == XMLDTDContentModelHandler.SEPARATOR_CHOICE ) {
+ if (fPrevNodeIndexStack[fDepth] != -1) {
+ fNodeIndexStack[fDepth] = addContentSpecNode(fOpStack[fDepth], fPrevNodeIndexStack[fDepth], fNodeIndexStack[fDepth]);
+ }
+ fPrevNodeIndexStack[fDepth] = fNodeIndexStack[fDepth];
+ fOpStack[fDepth] = XMLContentSpec.CONTENTSPECNODE_CHOICE;
+ } else if (fOpStack[fDepth] != XMLContentSpec.CONTENTSPECNODE_CHOICE && separator == XMLDTDContentModelHandler.SEPARATOR_SEQUENCE) {
+ if (fPrevNodeIndexStack[fDepth] != -1) {
+ fNodeIndexStack[fDepth] = addContentSpecNode(fOpStack[fDepth], fPrevNodeIndexStack[fDepth], fNodeIndexStack[fDepth]);
+ }
+ fPrevNodeIndexStack[fDepth] = fNodeIndexStack[fDepth];
+ fOpStack[fDepth] = XMLContentSpec.CONTENTSPECNODE_SEQ;
}
- fPrevNodeIndexStack[fDepth] = fNodeIndexStack[fDepth];
- fOpStack[fDepth] = XMLContentSpec.CONTENTSPECNODE_SEQ;
}
- } // childrenSeparator(short)
+ } // separator(short)
- /**
- * The occurrence count for a child in a children content model.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
- *
- * @param occurrence The occurrence count for the last children element
- * or children group.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see OCCURS_ZERO_OR_ONE
- * @see OCCURS_ZERO_OR_MORE
- * @see OCCURS_ONE_OR_MORE
- * @see TYPE_CHILDREN
- */
- public void childrenOccurrence(short occurrence) throws XNIException {
+ /** Occurrence. */
+ public void occurrence(short occurrence) throws XNIException {
- if ( occurrence == XMLDTDContentModelHandler.OCCURS_ZERO_OR_ONE ) {
- fNodeIndexStack[fDepth] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE, fNodeIndexStack[fDepth], -1);
- } else if ( occurrence == XMLDTDContentModelHandler.OCCURS_ZERO_OR_MORE ) {
- fNodeIndexStack[fDepth] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE, fNodeIndexStack[fDepth], -1 );
- } else if ( occurrence == XMLDTDContentModelHandler.OCCURS_ONE_OR_MORE) {
- fNodeIndexStack[fDepth] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE, fNodeIndexStack[fDepth], -1 );
+ if (!fMixed) {
+ if (occurrence == XMLDTDContentModelHandler.OCCURS_ZERO_OR_ONE ) {
+ fNodeIndexStack[fDepth] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_ZERO_OR_ONE, fNodeIndexStack[fDepth], -1);
+ } else if ( occurrence == XMLDTDContentModelHandler.OCCURS_ZERO_OR_MORE ) {
+ fNodeIndexStack[fDepth] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_ZERO_OR_MORE, fNodeIndexStack[fDepth], -1 );
+ } else if ( occurrence == XMLDTDContentModelHandler.OCCURS_ONE_OR_MORE) {
+ fNodeIndexStack[fDepth] = addContentSpecNode(XMLContentSpec.CONTENTSPECNODE_ONE_OR_MORE, fNodeIndexStack[fDepth], -1 );
+ }
}
- } // childrenOccurrence(short)
+ } // occurrence(short)
- /**
- * The end of a children group.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
- *
- * @see TYPE_CHILDREN
- */
- public void childrenEndGroup() throws XNIException {
+ /** End group. */
+ public void endGroup() throws XNIException {
- if (fPrevNodeIndexStack[fDepth] != -1) {
- fNodeIndexStack[fDepth] = addContentSpecNode(fOpStack[fDepth], fPrevNodeIndexStack[fDepth], fNodeIndexStack[fDepth]);
+ if (!fMixed) {
+ if (fPrevNodeIndexStack[fDepth] != -1) {
+ fNodeIndexStack[fDepth] = addContentSpecNode(fOpStack[fDepth], fPrevNodeIndexStack[fDepth], fNodeIndexStack[fDepth]);
+ }
+ int nodeIndex = fNodeIndexStack[fDepth--];
+ fNodeIndexStack[fDepth] = nodeIndex;
}
- int nodeIndex = fNodeIndexStack[fDepth--];
- fNodeIndexStack[fDepth] = nodeIndex;
- } // childrenEndGroup()
+ } // endGroup()
- /**
- * The end of a content model.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
+ /** End content model. */
public void endContentModel() throws XNIException {
// no-op
} // endContentModel()
No revision
No revision
1.1.2.9 +23 -114 xml-xerces/java/src/org/apache/xerces/parsers/Attic/AbstractXMLDocumentParser.java
Index: AbstractXMLDocumentParser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/Attic/AbstractXMLDocumentParser.java,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -r1.1.2.8 -r1.1.2.9
--- AbstractXMLDocumentParser.java 2001/06/15 04:08:32 1.1.2.8
+++ AbstractXMLDocumentParser.java 2001/07/09 06:52:08 1.1.2.9
@@ -82,7 +82,7 @@
* @author Arnaud Le Hors, IBM
* @author Andy Clark, IBM
*
- * @version $Id: AbstractXMLDocumentParser.java,v 1.1.2.8 2001/06/15 04:08:32 andyc Exp $
+ * @version $Id: AbstractXMLDocumentParser.java,v 1.1.2.9 2001/07/09 06:52:08 andyc Exp $
*/
public abstract class AbstractXMLDocumentParser
extends XMLParser
@@ -562,126 +562,35 @@
// XMLDTDContentModelHandler methods
//
- /**
- * The start of a content model. Depending on the type of the content
- * model, specific methods may be called between the call to the
- * startContentModel method and the call to the endContentModel method.
- *
- * @param elementName The name of the element.
- * @param type The content model type.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see TYPE_EMPTY
- * @see TYPE_ANY
- * @see TYPE_MIXED
- * @see TYPE_CHILDREN
- */
- public void startContentModel(String elementName, short type)
- throws XNIException {
- } // startContentModel(String,short)
+ /** Start content model. */
+ public void startContentModel(String elementName) throws XNIException {}
- /**
- * A referenced element in a mixed content model. If the mixed content
- * model only allows text content, then this method will not be called
- * for that model. However, if this method is called for a mixed
- * content model, then the zero or more occurrence count is implied.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_MIXED.
- *
- * @param elementName The name of the referenced element.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see TYPE_MIXED
- */
- public void mixedElement(String elementName) throws XNIException {
- } // mixedElement(elementName)
+ /** ANY. */
+ public void any() throws XNIException {}
- /**
- * The start of a children group.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
- * <p>
- * <strong>Note:</strong> Children groups can be nested and have
- * associated occurrence counts.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see TYPE_CHILDREN
- */
- public void childrenStartGroup() throws XNIException {
- } // childrenStartGroup()
+ /** EMPTY. */
+ public void empty() throws XNIException {}
- /**
- * A referenced element in a children content model.
- *
- * @param elementName The name of the referenced element.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see TYPE_CHILDREN
- */
- public void childrenElement(String elementName) throws XNIException {
- } // childrenElement(String)
+ /** Start group. */
+ public void startGroup() throws XNIException {}
- /**
- * The separator between choices or sequences of a children content
- * model.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
- *
- * @param separator The type of children separator.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see SEPARATOR_CHOICE
- * @see SEPARATOR_SEQUENCE
- * @see TYPE_CHILDREN
- */
- public void childrenSeparator(short separator) throws XNIException {
- } // childrenSeparator(short)
+ /** #PCDATA. */
+ public void pcdata() throws XNIException {}
- /**
- * The occurrence count for a child in a children content model.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
- *
- * @param occurrence The occurrence count for the last children element
- * or children group.
- *
- * @throws XNIException Thrown by handler to signal an error.
- *
- * @see OCCURS_ZERO_OR_ONE
- * @see OCCURS_ZERO_OR_MORE
- * @see OCCURS_ONE_OR_MORE
- * @see TYPE_CHILDREN
- */
- public void childrenOccurrence(short occurrence) throws XNIException {
- } // childrenOccurrence(short)
+ /** Element. */
+ public void element(String elementName) throws XNIException {}
- /**
- * The end of a children group.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
- *
- * @see TYPE_CHILDREN
- */
- public void childrenEndGroup() throws XNIException {
- } // childrenEndGroup()
+ /** Separator. */
+ public void separator(short separator) throws XNIException {}
- /**
- * The end of a content model.
- *
- * @throws XNIException Thrown by handler to signal an error.
- */
- public void endContentModel() throws XNIException {
- } // endContentModel()
+ /** Occurrence. */
+ public void occurrence(short occurrence) throws XNIException {}
+
+ /** End group. */
+ public void endGroup() throws XNIException {}
+
+ /** End content model. */
+ public void endContentModel() throws XNIException {}
//
// Protected methods
No revision
No revision
1.1.2.5 +2 -2 xml-xerces/java/src/org/apache/xerces/util/Attic/XMLAttributesImpl.java
Index: XMLAttributesImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/util/Attic/XMLAttributesImpl.java,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- XMLAttributesImpl.java 2001/04/07 02:41:57 1.1.2.4
+++ XMLAttributesImpl.java 2001/07/09 06:52:09 1.1.2.5
@@ -76,7 +76,7 @@
*
* @author Andy Clark, IBM
*
- * @version $Id: XMLAttributesImpl.java,v 1.1.2.4 2001/04/07 02:41:57 lehors Exp $
+ * @version $Id: XMLAttributesImpl.java,v 1.1.2.5 2001/07/09 06:52:09 andyc Exp $
*/
public class XMLAttributesImpl
implements XMLAttributes {
@@ -152,7 +152,7 @@
public int addAttribute(QName name, String type, String value) {
// find attribute; create, if necessary
- int index = name.uri != null
+ int index = name.uri != null && !name.uri.equals("")
? getIndex(name.uri, name.localpart)
: getIndex(name.rawname);
if (index == -1) {
No revision
No revision
1.1.2.6 +47 -127 xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDTDContentModelHandler.java
Index: XMLDTDContentModelHandler.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDTDContentModelHandler.java,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -r1.1.2.5 -r1.1.2.6
--- XMLDTDContentModelHandler.java 2001/05/09 07:20:55 1.1.2.5
+++ XMLDTDContentModelHandler.java 2001/07/09 06:52:11 1.1.2.6
@@ -69,7 +69,7 @@
* @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
* @author Andy Clark, IBM
*
- * @version $Id: XMLDTDContentModelHandler.java,v 1.1.2.5 2001/05/09 07:20:55 andyc Exp $
+ * @version $Id: XMLDTDContentModelHandler.java,v 1.1.2.6 2001/07/09 06:52:11 andyc Exp $
*/
public interface XMLDTDContentModelHandler {
@@ -77,80 +77,6 @@
// Constants
//
- // content model types
-
- /**
- * Empty content model type. The element is not allowed to contain
- * any content except for ignorable whitespace.
- * <p>
- * For example:
- * <pre>
- * <!ELEMENT elem EMPTY>
- * </pre>
- *
- * @see TYPE_ANY
- * @see TYPE_MIXED
- * @see TYPE_CHILDREN
- */
- public static final short TYPE_EMPTY = 0;
-
- /**
- * Any content model type. The element may contain any declared elements
- * or text content.
- * <p>
- * For example:
- * <pre>
- * <!ELEMENT elem ANY>
- * </pre>
- *
- * @see TYPE_EMPTY
- * @see TYPE_MIXED
- * @see TYPE_CHILDREN
- */
- public static final short TYPE_ANY = 1;
-
- /**
- * A mixed content model. The element can contain specified elements or
- * text content.
- * <p>
- * For example:
- * <pre>
- * <!ELEMENT elem1 (#PCDATA)>
- * <!ELEMENT elem2 (#PCDATA|foo|bar)*>
- * </pre>
- *
- * @see TYPE_EMPTY
- * @see TYPE_ANY
- * @see TYPE_CHILDREN
- */
- public static final short TYPE_MIXED = 2;
-
- /**
- * A children content model. The element can contain specified elements
- * as sequences or choices and with specified occurrence counts.
- * <p>
- * For example:
- * <pre>
- * <!ELEMENT elem1 (foo)>
- * <!ELEMENT elem2 (foo?)>
- * <!ELEMENT elem3 (foo*)>
- * <!ELEMENT elem4 (foo+)>
- * <!ELEMENT elem5 (foo,bar)>
- * <!ELEMENT elem6 (foo|bar)>
- * <!ELEMENT elem7 (foo|(bar,baz)+)>
- * </pre>
- *
- * @see TYPE_EMPTY
- * @see TYPE_ANY
- * @see TYPE_MIXED
- * @see SEPARATOR_CHOICE
- * @see SEPARATOR_SEQUENCE
- * @see OCCURS_ZERO_OR_ONE
- * @see OCCURS_ZERO_OR_MORE
- * @see OCCURS_ONE_OR_MORE
- */
- public static final short TYPE_CHILDREN = 3;
-
// children model separators
/**
@@ -246,67 +172,68 @@
* startContentModel method and the call to the endContentModel method.
*
* @param elementName The name of the element.
- * @param type The content model type.
*
* @throws XNIException Thrown by handler to signal an error.
- *
- * @see TYPE_EMPTY
- * @see TYPE_ANY
- * @see TYPE_MIXED
- * @see TYPE_CHILDREN
*/
- public void startContentModel(String elementName, short type)
+ public void startContentModel(String elementName)
throws XNIException;
+ /**
+ * A content model of ANY.
+ *
+ * @throws XNIException Thrown by handler to signal an error.
+ *
+ * @see #empty
+ * @see #startGroup
+ */
+ public void any() throws XNIException;
+
/**
- * A referenced element in a mixed content model. If the mixed content
- * model only allows text content, then this method will not be called
- * for that model. However, if this method is called for a mixed
- * content model, then the zero or more occurrence count is implied.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_MIXED.
- *
- * @param elementName The name of the referenced element.
+ * A content model of EMPTY.
*
* @throws XNIException Thrown by handler to signal an error.
*
- * @see TYPE_MIXED
+ * @see #any
+ * @see #startGroup
*/
- public void mixedElement(String elementName) throws XNIException;
+ public void empty() throws XNIException;
/**
- * The start of a children group.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
- * <p>
- * <strong>Note:</strong> Children groups can be nested and have
- * associated occurrence counts.
+ * A start of either a mixed or children content model. A mixed
+ * content model will immediately be followed by a call to the
+ * <code>pcdata()</code> method. A children content model will
+ * contain additional groups and/or elements.
*
* @throws XNIException Thrown by handler to signal an error.
*
- * @see TYPE_CHILDREN
+ * @see #any
+ * @see #empty
*/
- public void childrenStartGroup() throws XNIException;
+ public void startGroup() throws XNIException;
/**
- * A referenced element in a children content model.
+ * The appearance of "#PCDATA" within a group signifying a
+ * mixed content model. This method will be the first called
+ * following the content model's <code>startGroup()</code>.
+ *
+ * @throws XNIException Thrown by handler to signal an error.
+ *
+ * @see #startGroup
+ */
+ public void pcdata() throws XNIException;
+
+ /**
+ * A referenced element in a mixed or children content model.
*
* @param elementName The name of the referenced element.
*
* @throws XNIException Thrown by handler to signal an error.
- *
- * @see TYPE_CHILDREN
*/
- public void childrenElement(String elementName) throws XNIException;
+ public void element(String elementName) throws XNIException;
/**
- * The separator between choices or sequences of a children content
- * model.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
+ * The separator between choices or sequences of a mixed or children
+ * content model.
*
* @param separator The type of children separator.
*
@@ -314,37 +241,30 @@
*
* @see SEPARATOR_CHOICE
* @see SEPARATOR_SEQUENCE
- * @see TYPE_CHILDREN
*/
- public void childrenSeparator(short separator) throws XNIException;
+ public void separator(short separator) throws XNIException;
/**
- * The occurrence count for a child in a children content model.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
+ * The occurrence count for a child in a children content model or
+ * for the mixed content model group.
*
- * @param occurrence The occurrence count for the last children element
- * or children group.
+ * @param occurrence The occurrence count for the last element
+ * or group.
*
* @throws XNIException Thrown by handler to signal an error.
*
* @see OCCURS_ZERO_OR_ONE
* @see OCCURS_ZERO_OR_MORE
* @see OCCURS_ONE_OR_MORE
- * @see TYPE_CHILDREN
*/
- public void childrenOccurrence(short occurrence) throws XNIException;
+ public void occurrence(short occurrence) throws XNIException;
/**
- * The end of a children group.
- * <p>
- * <strong>Note:</strong> This method is only called after a call to
- * the startContentModel method where the type is TYPE_CHILDREN.
+ * The end of a group for mixed or children content models.
*
- * @see TYPE_CHILDREN
+ * @throws XNIException Thrown by handler to signal an error.
*/
- public void childrenEndGroup() throws XNIException;
+ public void endGroup() throws XNIException;
/**
* The end of a content model.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org