xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amass...@apache.org
Subject svn commit: r802812 - in /xerces/c/trunk: src/xercesc/internal/ tests/src/XSTSHarness/ tests/src/XSTSHarness/regression/ tests/src/XSTSHarness/regression/XERCESC-1831/
Date Mon, 10 Aug 2009 14:42:04 GMT
Author: amassari
Date: Mon Aug 10 14:42:03 2009
New Revision: 802812

URL: http://svn.apache.org/viewvc?rev=802812&view=rev
Log:
Before processing a schema location, remove the 0xFFFF characters present in the non-normalized
attribute value (XERCESC-1831)

Added:
    xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1831/
    xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1831/ack.xml
    xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1831/ack.xsd
Modified:
    xerces/c/trunk/src/xercesc/internal/IGXMLScanner2.cpp
    xerces/c/trunk/src/xercesc/internal/SGXMLScanner.cpp
    xerces/c/trunk/tests/src/XSTSHarness/   (props changed)
    xerces/c/trunk/tests/src/XSTSHarness/regression/Xerces.testSet

Modified: xerces/c/trunk/src/xercesc/internal/IGXMLScanner2.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/internal/IGXMLScanner2.cpp?rev=802812&r1=802811&r2=802812&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/internal/IGXMLScanner2.cpp (original)
+++ xerces/c/trunk/src/xercesc/internal/IGXMLScanner2.cpp Mon Aug 10 14:42:03 2009
@@ -224,7 +224,7 @@
 
                         ValueValidate = true;
                     }
-                    else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_SCHEMALOCACTION))
+                    else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_SCHEMALOCATION))
                     {
                         // use anyURI as the validator
                         // tokenize the data and use the anyURI data for each piece
@@ -239,7 +239,7 @@
                         ValueValidate = false;
                         tokenizeBuffer = true;
                     }
-                    else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCACTION))
+                    else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCATION))
                     {
                         attrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_ANYURI);
                         //We should validate this value however
@@ -1711,9 +1711,9 @@
                 const XMLCh* valuePtr = curPair->getValue();
                 const XMLCh* suffPtr = &rawPtr[colonInd + 1];
 
-                if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_SCHEMALOCACTION))
+                if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_SCHEMALOCATION))
                     parseSchemaLocation(valuePtr);
-                else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCACTION))
+                else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCATION))
                     resolveSchemaGrammar(valuePtr, XMLUni::fgZeroLenString);
 
                 if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_TYPE)) {
@@ -1753,8 +1753,11 @@
     if (size % 2 != 0 ) {
         emitError(XMLErrs::BadSchemaLocation);
     } else {
+        // We need a buffer to normalize the attribute value into
+        XMLBuffer normalBuf(1023, fMemoryManager);
         for(XMLSize_t i=0; i<size; i=i+2) {
-            resolveSchemaGrammar(fLocationPairs->elementAt(i+1), fLocationPairs->elementAt(i));
+            normalizeAttRawValue(SchemaSymbols::fgXSI_SCHEMALOCATION, fLocationPairs->elementAt(i),
normalBuf);
+            resolveSchemaGrammar(fLocationPairs->elementAt(i+1), normalBuf.getRawBuffer());
         }
     }
 }

Modified: xerces/c/trunk/src/xercesc/internal/SGXMLScanner.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/internal/SGXMLScanner.cpp?rev=802812&r1=802811&r2=802812&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/internal/SGXMLScanner.cpp (original)
+++ xerces/c/trunk/src/xercesc/internal/SGXMLScanner.cpp Mon Aug 10 14:42:03 2009
@@ -2258,7 +2258,7 @@
 
                         ValueValidate = true;
                     }
-                    else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_SCHEMALOCACTION))
+                    else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_SCHEMALOCATION))
                     {
                         // use anyURI as the validator
                         // tokenize the data and use the anyURI data for each piece
@@ -2273,7 +2273,7 @@
                         ValueValidate = false;
                         tokenizeBuffer = true;
                     }
-                    else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCACTION))
+                    else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCATION))
                     {
                         attrValidator = DatatypeValidatorFactory::getBuiltInRegistry()->get(SchemaSymbols::fgDT_ANYURI);
                         //We should validate this value however
@@ -3594,9 +3594,9 @@
                 const XMLCh* valuePtr = curPair->getValue();
                 const XMLCh*  suffPtr = &rawPtr[colonInd + 1];
 
-                if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_SCHEMALOCACTION))
+                if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_SCHEMALOCATION))
                     parseSchemaLocation(valuePtr);
-                else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCACTION))
+                else if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_NONAMESPACESCHEMALOCATION))
                     resolveSchemaGrammar(valuePtr, XMLUni::fgZeroLenString);
 
                 if (XMLString::equals(suffPtr, SchemaSymbols::fgXSI_TYPE)) {
@@ -3634,8 +3634,11 @@
     if (size % 2 != 0 ) {
         emitError(XMLErrs::BadSchemaLocation);
     } else {
+        // We need a buffer to normalize the attribute value into
+        XMLBuffer normalBuf(1023, fMemoryManager);
         for(XMLSize_t i=0; i<size; i=i+2) {
-            resolveSchemaGrammar(schemaLocation->elementAt(i+1), schemaLocation->elementAt(i));
+            normalizeAttRawValue(SchemaSymbols::fgXSI_SCHEMALOCATION, schemaLocation->elementAt(i),
normalBuf);
+            resolveSchemaGrammar(schemaLocation->elementAt(i+1), normalBuf.getRawBuffer());
         }
     }
 }

Propchange: xerces/c/trunk/tests/src/XSTSHarness/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Aug 10 14:42:03 2009
@@ -0,0 +1 @@
+.deps

Added: xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1831/ack.xml
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1831/ack.xml?rev=802812&view=auto
==============================================================================
--- xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1831/ack.xml (added)
+++ xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1831/ack.xml Mon Aug 10 14:42:03
2009
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ack xmlns="http://www.theriak.is/namespace/\:*?&quot;&lt;&gt;|"
+     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.theriak.is/namespace/\:*?&quot;&lt;&gt;| ack.xsd"
message_id="test_msg_id"/>
+    
\ No newline at end of file

Added: xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1831/ack.xsd
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1831/ack.xsd?rev=802812&view=auto
==============================================================================
--- xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1831/ack.xsd (added)
+++ xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1831/ack.xsd Mon Aug 10 14:42:03
2009
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema targetNamespace="http://www.theriak.is/namespace/\:*?&quot;&lt;&gt;|"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.theriak.is/namespace/\:*?&quot;&lt;&gt;|"
elementFormDefault="qualified" attributeFormDefault="unqualified">
+	<xs:element name="ack">
+		<xs:complexType>
+			<xs:attribute name="message_id" type="xs:string" use="required"/>
+		</xs:complexType>
+	</xs:element>
+</xs:schema>

Modified: xerces/c/trunk/tests/src/XSTSHarness/regression/Xerces.testSet
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tests/src/XSTSHarness/regression/Xerces.testSet?rev=802812&r1=802811&r2=802812&view=diff
==============================================================================
--- xerces/c/trunk/tests/src/XSTSHarness/regression/Xerces.testSet (original)
+++ xerces/c/trunk/tests/src/XSTSHarness/regression/Xerces.testSet Mon Aug 10 14:42:03 2009
@@ -611,6 +611,22 @@
       <current status="accepted" date="2008-12-29"/>
     </schemaTest>
   </testGroup>
+  <testGroup name="XERCESC-1831">
+    <annotation>
+      <documentation>Xerces-c can not parse instance with special chars (", &lt;
and &gt;) in target namespace</documentation>
+    </annotation>
+    <documentationReference xlink:href="https://issues.apache.org/jira/browse/XERCESC-1831"/>
+    <schemaTest name="XERCESC-1831">
+      <schemaDocument xlink:href="./XERCESC-1831/ack.xsd"/>
+      <expected validity="valid"/>
+      <current status="accepted" date="2009-08-10"/>
+    </schemaTest>
+    <instanceTest name="XERCESC-1831-1">
+      <instanceDocument xlink:href="./XERCESC-1831/ack.xml"/>
+      <expected validity="valid"/>
+      <current status="accepted" date="2009-08-10"/>
+    </instanceTest>
+  </testGroup>
   <testGroup name="XERCESC-1832">
     <annotation>
       <documentation>Namespace definitions attached to xs:extension/xs:restriction
are not processed</documentation>



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


Mime
View raw message