XML Schema with unknown elements

H

hooomee

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.
 
M

Martin Honnen

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top