You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2006/12/19 22:50:33 UTC

svn commit: r488820 - /xerces/java/trunk/src/org/apache/xerces/impl/dtd/DTDGrammar.java

Author: mrglavas
Date: Tue Dec 19 13:50:33 2006
New Revision: 488820

URL: http://svn.apache.org/viewvc?view=rev&rev=488820
Log:
Fixing JIRA Issue #1220:
http://issues.apache.org/jira/browse/XERCESJ-1220

The "Standalone Document Declaration" [1] validity constraint applies to markup declarations which 
occur in the external subset and/or a parameter entity (also known as external markup declarations [2]). 
Xerces was only considering declarations in the external subset.

[1] http://www.w3.org/TR/2006/REC-xml-20060816/#vc-check-rmd 
[2] http://www.w3.org/TR/2006/REC-xml-20060816/#dt-extmkpdecl

Modified:
    xerces/java/trunk/src/org/apache/xerces/impl/dtd/DTDGrammar.java

Modified: xerces/java/trunk/src/org/apache/xerces/impl/dtd/DTDGrammar.java
URL: http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/impl/dtd/DTDGrammar.java?view=diff&rev=488820&r1=488819&r2=488820
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/impl/dtd/DTDGrammar.java (original)
+++ xerces/java/trunk/src/org/apache/xerces/impl/dtd/DTDGrammar.java Tue Dec 19 13:50:33 2006
@@ -528,7 +528,7 @@
         int chunk = fCurrentElementIndex >> CHUNK_SHIFT;
         int index = fCurrentElementIndex & CHUNK_MASK;
         ensureElementDeclCapacity(chunk);
-        fElementDeclIsExternal[chunk][index] = fReadingExternalDTD? 1 : 0;
+        fElementDeclIsExternal[chunk][index] = (fReadingExternalDTD || fPEDepth > 0) ? 1 : 0;
 
     } // elementDecl(String,String)
 
@@ -658,7 +658,7 @@
         int chunk = fCurrentAttributeIndex >> CHUNK_SHIFT;
         int index = fCurrentAttributeIndex & CHUNK_MASK;
         ensureAttributeDeclCapacity(chunk);
-        fAttributeDeclIsExternal[chunk][index] = fReadingExternalDTD ?  1 : 0;
+        fAttributeDeclIsExternal[chunk][index] = (fReadingExternalDTD || fPEDepth > 0) ?  1 : 0;
 
     } // attributeDecl(String,String,String,String[],String,XMLString,XMLString, Augmentations)
 
@@ -685,7 +685,7 @@
         if( entityIndex == -1){
             entityIndex = createEntityDecl();
             boolean isPE = name.startsWith("%");
-            boolean inExternal = fReadingExternalDTD;
+            boolean inExternal = (fReadingExternalDTD || fPEDepth > 0);
             XMLEntityDecl  entityDecl = new XMLEntityDecl();
             entityDecl.setValues(name,null,null, null, null,
                                  text.toString(), isPE, inExternal);
@@ -715,7 +715,7 @@
         if( entityIndex == -1){
             entityIndex = createEntityDecl();
             boolean isPE = name.startsWith("%");
-            boolean inExternal = fReadingExternalDTD;
+            boolean inExternal = (fReadingExternalDTD || fPEDepth > 0);
 
             XMLEntityDecl  entityDecl = new XMLEntityDecl();
             entityDecl.setValues(name, identifier.getPublicId(), identifier.getLiteralSystemId(),
@@ -743,7 +743,7 @@
 
         XMLEntityDecl  entityDecl = new XMLEntityDecl();
         boolean isPE = name.startsWith("%");
-        boolean inExternal = fReadingExternalDTD;
+        boolean inExternal = (fReadingExternalDTD || fPEDepth > 0);
 
         entityDecl.setValues(name,identifier.getPublicId(),identifier.getLiteralSystemId(),
                             identifier.getBaseSystemId(), notation,



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org