The following comment has been added to this issue:
Author: Khaled Noaman
Created: Tue, 28 Sep 2004 4:37 PM
Body:
Would you please try the latest code? The following schema and sample worked fine.
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="rootType">
<xs:sequence>
<xs:element name="child" maxOccurs="5">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="attr" type="xs:int"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="root" type="rootType">
<xs:unique name="uniqueKey">
<xs:selector xpath=".//child"/>
<xs:field xpath="@attr"/>
</xs:unique>
</xs:element>
</xs:schema>
<?xml version="1.0"?>
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="unique.xsd">
<child attr="1">1</child>
<child attr="2">2</child>
<child>4</child>
</root>
---------------------------------------------------------------------
View this comment:
http://issues.apache.org/jira/browse/XERCESC-1237?page=comments#action_53475
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/XERCESC-1237
Here is an overview of the issue:
---------------------------------------------------------------------
Key: XERCESC-1237
Summary: xs:unique is used like xs:key
Type: Bug
Status: Unassigned
Priority: Blocker
Project: Xerces-C++
Components:
Validating Parser (Schema) (Xerces 1.5 or up only)
Versions:
2.5.0
Assignee:
Reporter: G�nter Hochhold
Created: Thu, 1 Jul 2004 4:50 AM
Updated: Tue, 28 Sep 2004 4:37 PM
Environment: Win XP
PC
Description:
<xs:unique name="uniqueLNodeType">
<xs:selector xpath="scl:LNodeType"/>
<xs:field xpath="@id"/>
<xs:field xpath="@iedType"/>
</xs:unique>
This xs:unique seems to be validated like xs:key.
In my xml-file there is a <LNodeType id="IED_0001/PROT/LPHD1" lnClass="LPHD">
Xerces tells me, there are not enough values specified for <unique>
If I add an iedType like here: <LNodeType id="IED_0001/PROT/LLN0" lnClass="LLN0"
iedType="frranz">
Xerces seems to be satisfied.
But this is not correct: the fields of an unique needn't to be required. They may be
optional and so they may be missing.
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]