You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by am...@apache.org on 2008/03/14 12:08:39 UTC
svn commit: r637054 - in /xerces/c/trunk: src/xercesc/validators/datatype/
tests/src/XSTSHarness/regression/
tests/src/XSTSHarness/regression/XERCESC-1393/
Author: amassari
Date: Fri Mar 14 04:08:37 2008
New Revision: 637054
URL: http://svn.apache.org/viewvc?rev=637054&view=rev
Log:
Identity constraints on xs:anySimpleType instances are enforced by comparing their lexical values (XERCESC-1393)
Added:
xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1393/
xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1393/invalid.xml
xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1393/schema.xsd
xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1393/valid.xml
Modified:
xerces/c/trunk/src/xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.cpp
xerces/c/trunk/src/xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.hpp
xerces/c/trunk/tests/src/XSTSHarness/regression/Xerces.testSet
Modified: xerces/c/trunk/src/xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.cpp?rev=637054&r1=637053&r2=637054&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.cpp (original)
+++ xerces/c/trunk/src/xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.cpp Fri Mar 14 04:08:37 2008
@@ -44,6 +44,16 @@
}
// ---------------------------------------------------------------------------
+// DatatypeValidators: Compare methods
+// ---------------------------------------------------------------------------
+int AnySimpleTypeDatatypeValidator::compare( const XMLCh* const lValue
+ , const XMLCh* const rValue
+ , MemoryManager* const)
+{
+ return XMLString::compareString(lValue, rValue);
+}
+
+// ---------------------------------------------------------------------------
// AnySimpleTypeDatatypeValidator: Instance methods
// ---------------------------------------------------------------------------
DatatypeValidator* AnySimpleTypeDatatypeValidator::newInstance
Modified: xerces/c/trunk/src/xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.hpp?rev=637054&r1=637053&r2=637054&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.hpp (original)
+++ xerces/c/trunk/src/xercesc/validators/datatype/AnySimpleTypeDatatypeValidator.hpp Fri Mar 14 04:08:37 2008
@@ -95,7 +95,7 @@
*
*/
- bool isSubstitutableBy(const DatatypeValidator* const toCheck);
+ virtual bool isSubstitutableBy(const DatatypeValidator* const toCheck);
//@}
@@ -113,7 +113,7 @@
* @param value2 string to compare
*
*/
- int compare(const XMLCh* const value1, const XMLCh* const value2
+ virtual int compare(const XMLCh* const value1, const XMLCh* const value2
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
@@ -151,17 +151,6 @@
inline bool AnySimpleTypeDatatypeValidator::isAtomic() const {
return false;
-}
-
-
-// ---------------------------------------------------------------------------
-// DatatypeValidators: Compare methods
-// ---------------------------------------------------------------------------
-inline int AnySimpleTypeDatatypeValidator::compare(const XMLCh* const,
- const XMLCh* const
- , MemoryManager* const)
-{
- return -1;
}
// ---------------------------------------------------------------------------
Added: xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1393/invalid.xml
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1393/invalid.xml?rev=637054&view=auto
==============================================================================
--- xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1393/invalid.xml (added)
+++ xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1393/invalid.xml Fri Mar 14 04:08:37 2008
@@ -0,0 +1,4 @@
+<Songs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schema.xsd">
+<Song title="Hotel California"/>
+<Song title="Hotel California"/>
+</Songs>
\ No newline at end of file
Added: xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1393/schema.xsd
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1393/schema.xsd?rev=637054&view=auto
==============================================================================
--- xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1393/schema.xsd (added)
+++ xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1393/schema.xsd Fri Mar 14 04:08:37 2008
@@ -0,0 +1,20 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+<xs:element name="Songs">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="Song" maxOccurs="unbounded">
+ <xs:complexType>
+ <xs:attribute name="title" use="required"/>
+ </xs:complexType>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:unique name="Song">
+ <xs:selector xpath="Song"/>
+ <xs:field xpath="@title"/>
+ </xs:unique>
+</xs:element>
+
+</xs:schema>
\ No newline at end of file
Added: xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1393/valid.xml
URL: http://svn.apache.org/viewvc/xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1393/valid.xml?rev=637054&view=auto
==============================================================================
--- xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1393/valid.xml (added)
+++ xerces/c/trunk/tests/src/XSTSHarness/regression/XERCESC-1393/valid.xml Fri Mar 14 04:08:37 2008
@@ -0,0 +1,4 @@
+<Songs xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schema.xsd">
+<Song title="Hotel California"/>
+<Song title="Desperado"/>
+</Songs>
\ No newline at end of file
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=637054&r1=637053&r2=637054&view=diff
==============================================================================
--- xerces/c/trunk/tests/src/XSTSHarness/regression/Xerces.testSet (original)
+++ xerces/c/trunk/tests/src/XSTSHarness/regression/Xerces.testSet Fri Mar 14 04:08:37 2008
@@ -252,6 +252,27 @@
<current status="accepted" date="2008-02-13"/>
</instanceTest>
</testGroup>
+ <testGroup name="XERCESC-1393">
+ <annotation>
+ <documentation>Identity constraint is not enforced on xs:anySimpleType</documentation>
+ </annotation>
+ <documentationReference xlink:href="https://issues.apache.org/jira/browse/XERCESC-1393"/>
+ <schemaTest name="XERCESC-1393-1">
+ <schemaDocument xlink:href="./XERCESC-1393/schema.xsd"/>
+ <expected validity="valid"/>
+ <current status="accepted" date="2008-03-14"/>
+ </schemaTest>
+ <instanceTest name="XERCESC-1393-2">
+ <instanceDocument xlink:href="./XERCESC-1393/invalid.xml"/>
+ <expected validity="invalid"/>
+ <current status="accepted" date="2008-03-14"/>
+ </instanceTest>
+ <instanceTest name="XERCESC-1393-3">
+ <instanceDocument xlink:href="./XERCESC-1393/valid.xml"/>
+ <expected validity="valid"/>
+ <current status="accepted" date="2008-03-14"/>
+ </instanceTest>
+ </testGroup>
<testGroup name="XERCESC-1419">
<annotation>
<documentation>Regular expressions in schema should allow unescaped '-'</documentation>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org