Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML Schema with unknown elements

Reply
Thread Tools

XML Schema with unknown elements

 
 
hooomee@gmail.com
Guest
Posts: n/a
 
      06-12-2006
I am trying to create a schema that has a bunch of elements that are
well defined, but will also allow unknown elements. I would like the
known elements to still do validation and the unknown elements to match
a simple form: <xs:element name="*" type="xs:string />.

Is there any way to do this sort of thing? I tried creating an element
called <xs:element name="Details" form="unqualified"> with my known
child elements, but the validator complains: "Details should be
un-qualified" when i try to validate a document.

 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      06-13-2006


http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> I am trying to create a schema that has a bunch of elements that are
> well defined, but will also allow unknown elements. I would like the
> known elements to still do validation and the unknown elements to match
> a simple form: <xs:element name="*" type="xs:string />.
>
> Is there any way to do this sort of thing?


You can and should use the xs:any element in your schema to achieve
that, see
<http://www.w3.org/TR/xmlschema-0/#any>
in the XSD primer and

<http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#element-any>
in the formal specification.


--

Martin Honnen
http://JavaScript.FAQTs.com/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
web.xml / XML schema issue, why do some XML schema attributes disappear asciz@starmail.com Java 3 02-20-2007 09:56 AM
Validation with XSD using XML::LibXML::Schema, and XML::Validator::Schema huntingseasonson@gmail.com Perl Misc 5 11-29-2006 12:37 PM
[XML Schema] Including a schema document with absent target namespace to a schema with specified target namespace Stanimir Stamenkov XML 3 04-25-2005 09:59 AM
XML Schema to XML Schema Conversion Hari Om XML 1 03-02-2004 09:04 PM
XML schema regular expressions question and recommended XML Schema book Fred Smith XML 1 02-05-2004 11:12 AM



Advertisments