XML schemas, including arbitrary elements

L

Laurens

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
 
M

Martin Honnen

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

Laurens

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top