XML schemas, including arbitrary elements

Laurens

Usenet Archive
Joined
Mar 20, 2001
Messages
38
Reaction score
0
Hi,

I'm writing an XML schema for a format that should allow entire XSL stylesheets to be embedded within a particular element.

Example:

<cxl xmlns="http://www.mynamespace.com/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <document> <name>My document</name> <transform pattern=".*\.xml"> <xsl:stylesheet> <!-- Stylesheet --> </xsl:stylesheet> </transform> </document> </cxl>

Now there are two problems:

1) My input documents must be validated against a schema.
2) There is no schema for XSL.

I've looked at <xsd:any> but "any" elements still have to be declared in another schema.

Basically what I want is for validation to be temporarily "suspended" within particular elements, so as to allow inclusion of structures for which there is no schema. Is this possible?

Thanks
-Laurens
 

Martin Honnen

Usenet Archive
Joined
Apr 8, 2000
Messages
6,174
Reaction score
0
Laurens said:
I'm writing an XML schema for a format that should allow entire XSL stylesheets to be embedded within a particular element.

Example:

<cxl xmlns="http://www.mynamespace.com/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <document> <name>My document</name> <transform pattern=".*\.xml"> <xsl:stylesheet> <!-- Stylesheet --> </xsl:stylesheet> </transform> </document> </cxl>

Now there are two problems:

1) My input documents must be validated against a schema.
2) There is no schema for XSL.

I've looked at <xsd:any> but "any" elements still have to be declared in another schema.

No, you can specify
<xsd:any processContents="skip"
which then means the parsers skips the content when validating. Or you can use <xsd:any processContents="lax" to let the parser validate the content if a schema is present and otherwise skip the content.
 

Laurens

Usenet Archive
Joined
Mar 20, 2001
Messages
38
Reaction score
0
No, you can specify
<xsd:any processContents="skip"
which then means the parsers skips the content when validating. Or you can use <xsd:any processContents="lax" to let the parser validate the content if a schema is present and otherwise skip the content.

OK, thanks! I didn't know about processContents. (I'm a Schema newbie and it shows.) Will try this out.

Thanks again
-Laurens
 

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
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top