XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Kurt MartinSubject: xs:key and xs:keyref question
Author: Kurt Martin
Date: 25 Sep 2006 02:36 PM
Originally Posted: 25 Sep 2006 02:04 PM
I have the following snippet of XML code:

<proc id="x1036">
<admon class="image-type" type="caution" id="x1037">
<para id="x1038">This is the first paragraph of this caution.</para>
<para id="x1039">This is a second paragraph of this caution.</para>
</admon>
<step1 admonref="x1037" id="x1040">Step referencing admon with id value of 'x1037'.</step1>
</proc>

Here is the related snippet in my schema:

<xs:element name="step1">
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="admon"/>
<xs:element ref="em"/>
<xs:element ref="figure"/>
<xs:element ref="sup"/>
<xs:element ref="step2"/>
<xs:element ref="sub"/>
<xs:element ref="xref"/>
</xs:choice>
<xs:attribute name="admonref" type="xs:IDREF"/>
<xs:attribute name="figref" type="xs:IDREF"/>
<xs:attribute name="id" use="required" type="xs:ID"/>
</xs:complexType>
<xs:key name="admonrefID">
<xs:selector xpath="previous-sibling"/>
<xs:field xpath="@id"/>
</xs:key>
<xs:keyref name="admonKeyRef" refer="admonrefID">
<xs:selector xpath="."/>
<xs:field xpath="@admonref"/>
</xs:keyref>
</xs:element>
While trying to validate, I get errors such as:

Validating working.xml...
file:///u:/Schemas/New Structure/working.xml:133,127: The key for identity constraint of element 'step1' is not found.
file:///u:/Schemas/New Structure/working.xml:438,127: The key for identity constraint of element 'step1' is not found.
file:///u:/Schemas/New Structure/working.xml:494,127: The key for identity constraint of element 'step1' is not found.
file:///u:/Schemas/New Structure/working.xml:790,128: The key for identity constraint of element 'step1' is not found.

The XML document working.xml is NOT valid (4 errors)

What am I doing wrong????

Postnext
Kurt MartinSubject: xs:key and xs:keyref question
Author: Kurt Martin
Date: 25 Sep 2006 02:32 PM
Actually, I am still not understanding this. I want to use IDREF and ID as attribute types, correct? When I do, the document gets the following errors:

Validating working.xml...
file:///u:/Schemas/New Structure/working.xml:854,8: ID attribute 'x10184' was referenced but never declared
file:///u:/Schemas/New Structure/working.xml:854,8: ID attribute 'x10139' was referenced but never declared
file:///u:/Schemas/New Structure/working.xml:854,8: ID attribute 'x10149' was referenced but never declared
file:///u:/Schemas/New Structure/working.xml:854,8: ID attribute 'x10416' was referenced but never declared
file:///u:/Schemas/New Structure/working.xml:854,8: ID attribute 'x1037' was referenced but never declared

Does anyone see a problem with the syntax as previously shown?

Postnext
Tony LavinioSubject: xs:key and xs:keyref question
Author: Tony Lavinio
Date: 26 Sep 2006 11:52 AM
This is a forum for support of Stylus Studio users, and we don't
recognize the email address you used as one of our registered users.
Could you tell us which version you have so that we could help you
appropriately?

Postnext
Ivan PedruzziSubject: xs:key and xs:keyref question
Author: Ivan Pedruzzi
Date: 26 Sep 2006 12:38 PM
Hi Kevin,

It's not a good idea to post your installation ID on a public forum

Thank You
Ivan Pedruzzi
Stylus Studio Team

Posttop
Kurt MartinSubject: xs:key and xs:keyref question
Author: Kurt Martin
Date: 26 Sep 2006 02:01 PM
Oh, I guess it was my registration code? Sorry about that.

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.