Christian, At the core of this issue is the desire to validate core LLRP parameters embedded within parameters in an extended namespace, without requiring the extended namespace to redefine the parameter in its namespace. Given the current schema, the XML document you included below will validate correctly in all schema-aware editors I tried:
<example:LLRP_CUSTOM_MESSAGE MessageID="1001" xmlns:example="http://ltk.example.com/ltk/schema/encoding/xml/0.1" xmlns:llrp="http://www.llrp.org/ltk/schema/core/encoding/xml/1.0"> <example:LLRPStatus> <llrp:StatusCode>M_Success</llrp:StatusCode> <llrp:ErrorDescription></llrp:ErrorDescription> </example:LLRPStatus> </example:LLRP_CUSTOM_MESSAGE> What I was trying to do, however, is eliminate the need to redefine LLRPStatus within the extended namespace. Essentially, I wanted to have the following document validate against the schemas: <example:LLRP_CUSTOM_MESSAGE MessageID="1001" xmlns:example="http://ltk.example.com/ltk/schema/encoding/xml/0.1" xmlns:llrp="http://www.llrp.org/ltk/schema/core/encoding/xml/1.0"> <llrp:LLRPStatus> <llrp:StatusCode>M_Success</llrp:StatusCode> <llrp:ErrorDescription></llrp:ErrorDescription> </llrp:LLRPStatus> </example:LLRP_CUSTOM_MESSAGE> Unfortunately, the only way I was able to accomplish this was to define the complex type LLRPStatus as a global element within the core LLRP schema. If there is another way to achieve this without the global scope, that would certainly be the way to proceed. Unfortunately, my limited knowledge of W3C schemas has been exhausted by this search. Given your (valid and agreed upon) objections, if there is no clean method to accomplish what I was attempting, we can just drop the topic. In fact, the only viable, backwards compatible solution seems to be to create a second schema that includes llrp.xsd and defines the global elements within. But that is as much of a kludge as anything. Thanks again for your help and time! C -----Original Message----- From: floerkem [mailto:[email protected]] Sent: Friday, June 05, 2009 6:00 AM To: LLRP Toolkit Development List Subject: Re: [ltk-d] Recommended change to llrp-1x0.xsd Chris, As one of the "Java guys" :), I am not convinced that we should make this change. * With this change, we can no longer verify that an LTK-XML message is in fact an LLRP compliant message using xsd validation (LLRP parameters by themselves will be validated as well). In my opinion this outweighs the benefits of being able to validate individual parameters in LTK-XML format. It also means that we would need to modify the existing implementations to maintain the same behavior. We would need to check the root element in any LTK-XML message against a list of valid LLRP Messages. * I agree that to the user it is not obvious from looking at the XML entity itself that LLRPStatus is an instance of the llrp namespace complexType LLRPStatus (see example below). However, nested elements of LLRPStatus will be qualified by the llrp namespace which will reduce potential confusion. The developer using the LTK-XML extension message will also be able to check in the extension schema. <example:LLRP_CUSTOM_MESSAGE MessageID="1001" xmlns:example="http://ltk.example.com/ltk/schema/encoding/xml/0.1" xmlns:llrp="http://www.llrp.org/ltk/schema/core/encoding/xml/1.0"> <example:LLRPStatus> <llrp:StatusCode>M_Success</llrp:StatusCode> <llrp:ErrorDescription></llrp:ErrorDescription> </example:LLRPStatus> </example:LLRP_CUSTOM_MESSAGE> * In the proposed schema, the note says: "It allows typical schema-aware XML editors to validate LTK-XML documents that include vendor extensions utilizing parameters within the core LTK-XML namespace." Are you saying that most typical schema-aware XML editors would not validate extension messages that import complex types as above and as in the current xsd? I thought the problems with the validation with XMLStartlet and the other tools you tried arose from using the ref attribute with a complexType rather than an element (which is not foreseen in XSD)? Christian ------------------------------------------------------------------------------ OpenSolaris 2009.06 is a cutting edge operating system for enterprises looking to deploy the next generation of Solaris that includes the latest innovations from Sun and the OpenSource community. Download a copy and enjoy capabilities such as Networking, Storage and Virtualization. Go to: http://p.sf.net/sfu/opensolaris-get _______________________________________________ llrp-toolkit-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/llrp-toolkit-devel
