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
lucrecia chiartanoSubject: XSD - noNamespaceSchemaLocation control
Author: lucrecia chiartano
Date: 11 Jan 2006 09:21 AM
Hello,
Does anyone know if it is possible to validate the presence of the ‘xmlns:xsi’ and ‘xsi:noNamespaceSchemaLocation’ attributes on an xml, via schema?

This must be validated :
<mynode xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”path-name.xsd” />

This must NOT be validated :
<mynode xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=”anotherpath-name.xsd” />

This must NOT be validated :
<mynode/>


Thanks,
Lucrecia Chiartano

Postnext
Tony LavinioSubject: XSD - noNamespaceSchemaLocation control
Author: Tony Lavinio
Date: 11 Jan 2006 09:50 AM
Validators will act on what's there.

It is possible to have a schema that basically includes
almost anything, with xs:all, which you could use for your
anotherpath-name.xsd.

And many schema validators, such as Saxon, support a 'lax' mode,
which will only validate content when there is a schema present.

Postnext
lucrecia chiartanoSubject: XSD - noNamespaceSchemaLocation control
Author: lucrecia chiartano
Date: 11 Jan 2006 11:02 AM
Thanks for your reply but I think I did not understood it well.
I'm validating with Xerces using the following Schema, that validates all the examples I have reported on my first mail.
What I would like is to write in this Schema an instruction (maybe like the xs:attribute??) that makes the validation fail against the last two cases.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="mynode">
<xs:complexType>
<xs:attribute name="attribute1" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
</xs:schema>

Is there an instruction like that?
Thanks,
Lucrecia

Postnext
Tony LavinioSubject: XSD - noNamespaceSchemaLocation control
Author: Tony Lavinio
Date: 11 Jan 2006 11:18 AM
How would the schema validate for a missing schema location, if
no schema location were specified?

Assuming that you imposed the schema validation from outside of
the document, instead of inside, you could write a schema that
checks for a specific value in a schema location, but if I
understand you correctly, then there isn't really a way to do
what you want.

What problem are you trying to solve? Are you tring to make sure
that a specific schema is referenced always in the file?

Postnext
lucrecia chiartanoSubject: XSD - noNamespaceSchemaLocation control
Author: lucrecia chiartano
Date: 11 Jan 2006 12:07 PM
This validation has to be executed by different people, all using the same Schema.
But for one of this validations, that binds the xml to it’s Schema outsides (so using not the two validation attributes we are talking about), they want to verify also that a precise path is used within the xml.

Thanks,
Lucrecia

Posttop
Tony LavinioSubject: XSD - noNamespaceSchemaLocation control
Author: Tony Lavinio
Date: 11 Jan 2006 12:25 PM
This doesn't sound like a Stylus Studio related question, and this
is, after all, a Stylus Studio support forum.

You might try asking on the xmlschema-dev mailing list.

 
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.