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
Conferences Close Tree View
+ Stylus Studio Feature Requests (1192)
+ Stylus Studio Technical Forum (14621)
+ Website Feedback (249)
- XSLT Help and Discussion (7625)
-> + Use of before and after string (3) Sticky Topic
-> - How do I substitute element ty... (1)
-> + How does one add working days ... (4)
-> - Help, I have existing XLT and... (1)
-> + Need help on XSLT issue - (2)
-> + EDI to XML Conversion (7)
-> - XML To JSON Conversion using X... (1)
-> + Formatting Paragraphs to same ... (2)
-> - Grouping of records (1)
-> + Problems with xsd 1.1 (4)
-> + XML to HL7 mapping (3)
-> + XSLT 3 and Iterate (2)
-> + XSL-FO to PDF preview (3)
-> + java.lang.RuntimeException: Er... (2)
-> + Create Acroforms with Stylus X... (2)
-> + How to change XSLT parameter s... (3)
-> + how to change format of the da... (2)
-> + Search "Next 8 Results " doesn... (2)
-> - Support for Git (1)
-> + newbee (8)
-- [1-20] [21-40] [41-60] Next
+ XQuery Help and Discussion (2017)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
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.

   
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.