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 (1182)
- Stylus Studio Technical Forum (14569)
-> + EDIFACT guideline from Stylus ... (3)
-> + CSV file putting all the data ... (5)
-> + Can't install Home version 64b... (5)
-> + presale - Can I covers this sc... (5)
-> + Problem with UNB (5)
-> + Splitting EDIFACT files pipeli... (4)
-> + Problem with SAXO processor - ... (5)
-> + PDF Format Help (4)
-> + License check unreliable (2)
-> - XML related issue (1)
-> + Need help regarding pipeline o... (2)
-> + Error converting XML to EDIFAC... (4)
-> + XSLT Profiling for XSLT 1.0 s... (2)
-> + Grouping (2)
-> + Best Practice for Pipeline err... (2)
-> + pdf generation (4)
-> + Problems excuting a Pipeline w... (2)
-> + XML serializer (3)
-> + Supported EDIFACT versions (5)
-> - Anyone know XActimate ESX file... (1)
-- [1-20] [21-40] [41-60] Next
+ Website Feedback (247)
+ XSLT Help and Discussion (7617)
+ XQuery Help and Discussion (1966)
+ Stylus Studio FAQs (159)
+ Stylus Studio Code Samples & Utilities (364)
+ Stylus Studio Announcements (113)
David BanburySubject: Error when data type not specified for key attributes
Author: David Banbury
Date: 14 Feb 2008 07:29 PM
We have an XML Schema that uses keys and keyrefs at different levels in the element hierarchy. The keys and keyrefs are based on attributes of elements, the elements are generally empty.

Stylus Studio handles the keyrefs correctly as long as a "type" is specified for the key attributes in the XSD. If you take the same schema and remove the data type definitions from these attributes the built-in Stylus Studio parser returns the error:
"The key for identity constraint of element '...' is not found."

The attached example files are cut down to the bare minimum. The "GoodFile" example works, the "BadFile" example returns errors.

The Xalan, XSV & Saxonica parsers handle the BadFile examples perfectly well. (Microsoft parsers can't handle this keyref structure in either case!)

David Banbury

XSD for the error case

XML for the error case

XSD for the good case

XML for the good case

(Deleted User) Subject: Error when data type not specified for key attributes
Author: (Deleted User)
Date: 28 Feb 2008 08:53 AM
Hi David,
when you don't specify a type for an attribute, it is defined to be the special anySimpleType type. The specification warns that in this case "the mapping from lexical space to value space is unspecified for items whose type definition is the simple ur-type definition. Accordingly this specification does not constrain processors' behaviour in areas where this mapping is implicated, for example checking such items against enumerations, constructing default attributes or elements whose declared type definition is the simple ur-type definition, checking identity constraints involving such items".
So, having a key/keyref involving anySimpleType values will have a different behavior depending on which processor is being used.

Hope this helps,

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!  

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.