[ https://issues.apache.org/jira/browse/XERCESC-809?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alberto Massari resolved XERCESC-809. ------------------------------------- Resolution: Fixed Fix Version/s: 3.1.0 Assignee: Alberto Massari (was: Khaled Noaman) A fix is in SVN > Does implement co-occurence constraints > --------------------------------------- > > Key: XERCESC-809 > URL: https://issues.apache.org/jira/browse/XERCESC-809 > Project: Xerces-C++ > Issue Type: Bug > Components: Validating Parser (XML Schema) > Affects Versions: 2.2.0 > Environment: Operating System: Solaris > Platform: Sun > Reporter: simon.parmenter > Assignee: Alberto Massari > Fix For: 3.1.0 > > > Sun Workshop 6 Update 2 C++ 5.3 > The Xerces libray does not perform co-occurence checks. > test.xml > <?xml version="1.0" encoding="UTF-8" ?> > <sm:root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="SP test.xsd" > xmlns:sm="SP"> > <sm:a aID="1" x="1" y="1"/> > </sm:root> > test.xsd > <?xml version="1.0" encoding="UTF-8"?> > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > targetNamespace="SP" > xmlns:sm="SP" > attributeFormDefault="unqualified" elementFormDefault="qualified"> > > <xsd:complexType name="CTa"> > <xsd:attribute name="aID" type="xsd:integer" use="required" /> > <xsd:attribute name="x" type="xsd:integer" use="optional" /> > <xsd:attribute name="y" type="xsd:integer" use="optional" /> > <xsd:attribute name="z" type="xsd:integer" use="optional" /> > </xsd:complexType> > <!-- DEFINITION OF THE ONLY ALLOWED ROOT ELEMENT --> > <xsd:element name="root"> > <xsd:complexType> > <xsd:sequence> > <xsd:element name="a" type="sm:CTa" maxOccurs="unbounded"> > <xsd:key name="xORzKEY"> > <xsd:selector xpath="."/> > <xsd:field xpath="@x|@y"/> > <!--<xsd:field xpath="@x|@z"/>--> > </xsd:key> > </xsd:element> > </xsd:sequence> > </xsd:complexType> > </xsd:element> > </xsd:schema> > The Xerces library should report an error to the effect that "the field XPath > expression '@x|@y' evaluated to more than one node for identity-constraint > '{SP} > xORzKEY'. Line:6 col: 30. <sm:a aID="1" x="1" y="1"/> > MSXML4 complies. vb script > Option Explicit > dim x > set x = CreateObject("MSXML2.DOMDocument.4.0") > x.async = false > x.validateOnParse = true > x.load("test.xml") > if x.parseError.errorCode <> 0 then > WScript.Echo("errorReason=" + x.parseError.reason & "Line:" & > x.parseError.line & ", pos " & x.parseError.linepos & vbcrlf & > x.parseError.srcText) > else > WScript.Echo("===NO PARSE ERROR===") > end if -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org