xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amass...@apache.org
Subject svn commit: r658750 - in /xerces/c/branches/xerces-2/src/xercesc: framework/XMLEntityDecl.cpp framework/XMLEntityDecl.hpp util/XercesVersion.hpp validators/DTD/DTDScanner.cpp
Date Wed, 21 May 2008 16:42:54 GMT
Author: amassari
Date: Wed May 21 09:42:53 2008
New Revision: 658750

URL: http://svn.apache.org/viewvc?rev=658750&view=rev
Log:
Avoid that an external entity having an empty SYSTEM id is treated as internal (XERCESC-1763)

Modified:
    xerces/c/branches/xerces-2/src/xercesc/framework/XMLEntityDecl.cpp
    xerces/c/branches/xerces-2/src/xercesc/framework/XMLEntityDecl.hpp
    xerces/c/branches/xerces-2/src/xercesc/util/XercesVersion.hpp
    xerces/c/branches/xerces-2/src/xercesc/validators/DTD/DTDScanner.cpp

Modified: xerces/c/branches/xerces-2/src/xercesc/framework/XMLEntityDecl.cpp
URL: http://svn.apache.org/viewvc/xerces/c/branches/xerces-2/src/xercesc/framework/XMLEntityDecl.cpp?rev=658750&r1=658749&r2=658750&view=diff
==============================================================================
--- xerces/c/branches/xerces-2/src/xercesc/framework/XMLEntityDecl.cpp (original)
+++ xerces/c/branches/xerces-2/src/xercesc/framework/XMLEntityDecl.cpp Wed May 21 09:42:53
2008
@@ -42,6 +42,7 @@
     , fPublicId(0)
     , fSystemId(0)
     , fBaseURI(0)
+    , fIsExternal(false)
     , fMemoryManager(manager)
 {
 }
@@ -57,6 +58,7 @@
     , fPublicId(0)
     , fSystemId(0)
     , fBaseURI(0)
+    , fIsExternal(false)
     , fMemoryManager(manager)
 {
     fName = XMLString::replicate(entName, fMemoryManager);
@@ -75,6 +77,7 @@
     , fPublicId(0)
     , fSystemId(0)
     , fBaseURI(0)
+    , fIsExternal(false)
     , fMemoryManager(manager)
 {
     CleanupType cleanup(this, &XMLEntityDecl::cleanUp);
@@ -105,6 +108,7 @@
     , fPublicId(0)
     , fSystemId(0)
     , fBaseURI(0)
+    , fIsExternal(false)
     , fMemoryManager(manager)
 {
     CleanupType cleanup(this, &XMLEntityDecl::cleanUp);
@@ -177,6 +181,7 @@
         serEng.writeString(fPublicId);
         serEng.writeString(fSystemId);
         serEng.writeString(fBaseURI);
+        serEng<<fIsExternal;
     }
     else
     {
@@ -188,6 +193,9 @@
         serEng.readString(fPublicId);
         serEng.readString(fSystemId);
         serEng.readString(fBaseURI);
+        // when fIsExternal has been added, XERCES_GRAMMAR_SERIALIZATION_LEVEL has been bumped
to 6
+        if(serEng.getStorerLevel()>=6)
+            serEng>>fIsExternal;
     }
 }
 

Modified: xerces/c/branches/xerces-2/src/xercesc/framework/XMLEntityDecl.hpp
URL: http://svn.apache.org/viewvc/xerces/c/branches/xerces-2/src/xercesc/framework/XMLEntityDecl.hpp?rev=658750&r1=658749&r2=658750&view=diff
==============================================================================
--- xerces/c/branches/xerces-2/src/xercesc/framework/XMLEntityDecl.hpp (original)
+++ xerces/c/branches/xerces-2/src/xercesc/framework/XMLEntityDecl.hpp Wed May 21 09:42:53
2008
@@ -252,6 +252,13 @@
     );
 
     /**
+     *  This method will mark whether the entity is external.
+     *
+     *  @param  newName   The new value for the 'is external' flag.
+     */
+    void setIsExternal(bool value);
+
+    /**
      *  This method will set the notation name for this entity. By setting
      *  this, you are indicating that this is an unparsed external entity.
      *
@@ -373,6 +380,7 @@
     XMLCh*          fPublicId;
     XMLCh*          fSystemId;
     XMLCh*          fBaseURI;
+    bool            fIsExternal;
     MemoryManager*  fMemoryManager;
 };
 
@@ -422,8 +430,7 @@
 
 inline bool XMLEntityDecl::isExternal() const
 {
-    // If it has a system or public id, its external
-    return ((fPublicId != 0) || (fSystemId != 0));
+    return fIsExternal;
 }
 
 inline bool XMLEntityDecl::isUnparsed() const
@@ -445,6 +452,11 @@
     fId = newId;
 }
 
+inline void XMLEntityDecl::setIsExternal(bool value)
+{
+    fIsExternal = value;
+}
+
 inline void XMLEntityDecl::setNotationName(const XMLCh* const newName)
 {
     if (fNotationName)

Modified: xerces/c/branches/xerces-2/src/xercesc/util/XercesVersion.hpp
URL: http://svn.apache.org/viewvc/xerces/c/branches/xerces-2/src/xercesc/util/XercesVersion.hpp?rev=658750&r1=658749&r2=658750&view=diff
==============================================================================
--- xerces/c/branches/xerces-2/src/xercesc/util/XercesVersion.hpp (original)
+++ xerces/c/branches/xerces-2/src/xercesc/util/XercesVersion.hpp Wed May 21 09:42:53 2008
@@ -127,9 +127,13 @@
 #define XERCES_VERSION_REVISION 0
 
 /***
- * data member added to XSAnnotation
+ *
+ * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 4   SchemaAttDef, SchemaElementDecl serialize fPSVIScope
+ * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 5   XercesStep serializes the axis as an int
+ * XERCES_GRAMMAR_SERIALIZATION_LEVEL = 6   added fIsExternal to XMLEntityDecl
+ *
  ***/
-#define XERCES_GRAMMAR_SERIALIZATION_LEVEL 5
+#define XERCES_GRAMMAR_SERIALIZATION_LEVEL 6
 
 /** DO NOT MODIFY BELOW THIS LINE */
 

Modified: xerces/c/branches/xerces-2/src/xercesc/validators/DTD/DTDScanner.cpp
URL: http://svn.apache.org/viewvc/xerces/c/branches/xerces-2/src/xercesc/validators/DTD/DTDScanner.cpp?rev=658750&r1=658749&r2=658750&view=diff
==============================================================================
--- xerces/c/branches/xerces-2/src/xercesc/validators/DTD/DTDScanner.cpp (original)
+++ xerces/c/branches/xerces-2/src/xercesc/validators/DTD/DTDScanner.cpp Wed May 21 09:42:53
2008
@@ -2282,6 +2282,7 @@
     if (!scanId(bbPubId.getBuffer(), bbSysId.getBuffer(), IDType_External))
         return false;
 
+    decl.setIsExternal(true);
     ReaderMgr::LastExtEntityInfo lastInfo;
     fReaderMgr->getLastExtEntityInfo(lastInfo);
 



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


Mime
View raw message