xerces-j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mukul Gandhi (JIRA)" <xerces-j-...@xml.apache.org>
Subject [jira] [Commented] (XERCESJ-1507) Identity constraint does not work if field refers to attribute defined as simple type of list
Date Fri, 06 May 2011 15:16:03 GMT

    [ https://issues.apache.org/jira/browse/XERCESJ-1507?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13029979#comment-13029979
] 

Mukul Gandhi commented on XERCESJ-1507:
---------------------------------------

I think that "keyref" and "keydata" attributes in your example should have compatible data
types for the purpose of equality test (if you need these for xs:keyref component). In your
case, one is xs:string while the other is list of strings (i.e xs:string+), which to my opinion
are incomparable for the purpose of xs:keyref component.

I seem to observe that, identity constraints involving simpleType->list work correctly
with Xerces-J, provided the schema types I mentioned as above are comparable. If you make
"keydata" attribute in your example as a list type (for e.g "keyreftypes" from your example),
I seem to find that your example works fine with Xerces-J.

Therefore it seems to me, that this may not be a valid bug report.

> Identity constraint does not work if field refers to attribute defined as simple type
of list
> ---------------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1507
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1507
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: SAX
>    Affects Versions: 2.11.0
>         Environment: Windows, Java 1.6
>            Reporter: Damir Sulomar
>
> When a keyref field element refers to attribute defined as simple type of list the identity
constraint does not work.  Schema and data below.
> <?xml version="1.0" encoding="utf-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"  >
> 	<xs:element name="Data">
> 		<xs:complexType>
> 			<xs:all>
> 				<xs:element name="Data1">
> 					<xs:complexType>
> 						<xs:attribute name="keydata" type="xs:string" use="required"/>
> 					</xs:complexType>
> 				</xs:element>
> 				<xs:element name="Data2">
> 					<xs:complexType>
> 						<xs:attribute name="keyref" type="keyreftypes" use="required"/>
> 					</xs:complexType>
> 				</xs:element>
> 			</xs:all>
> 		</xs:complexType>
> 		<xs:key name="Keys">
> 			<xs:selector xpath=".//Data1"/>
> 			<xs:field xpath="@keydata"/>
> 		</xs:key>
> 		<xs:keyref name="KeyRefs" refer="Keys">
> 			<xs:selector xpath=".//Data2"/>
> 			<xs:field xpath="@keyref"/>
> 		</xs:keyref>
> 	</xs:element>
> 	<xs:simpleType name="keyreftypes">
> 		<xs:list itemType="xs:string"/>
> 	</xs:simpleType>
> </xs:schema>
> <?xml version="1.0" encoding="utf-8" ?> 
> <Data>
> 	<Data1 keydata="1"/>
> 	<Data2 keyref="1"/>
> </Data>

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

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


Mime
View raw message