Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > XML schemas, including arbitrary elements

Reply
Thread Tools

XML schemas, including arbitrary elements

 
 
Laurens
Guest
Posts: n/a
 
      01-09-2004
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/"
xmlnssl="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


 
Reply With Quote
 
 
 
 
Martin Honnen
Guest
Posts: n/a
 
      01-09-2004


Laurens wrote:

> 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/"
> xmlnssl="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.
--

Martin Honnen
http://JavaScript.FAQTs.com/

 
Reply With Quote
 
 
 
 
Laurens
Guest
Posts: n/a
 
      01-09-2004

"Martin Honnen" <(E-Mail Removed)> wrote in message
news:3ffea346$(E-Mail Removed)...

> 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


 
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
Arbitrary content (including XML) as binary stream Generic Usenet Account XML 1 03-25-2009 08:47 AM
Rotating arbitrary sets of elements within a list phil_nospam_schmidt@yahoo.com Python 3 04-08-2005 08:19 PM
calling an arbitrary function w/ arbitrary arguments Honestmath C++ 5 12-13-2004 06:18 AM
Using XSL to delete fixed text in arbitrary elements Fred Bartlett XML 1 02-17-2004 09:24 PM
Help on including one XML document within another XML document using XML Schemas Tony Prichard XML 0 12-12-2003 03:18 PM



Advertisments