|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSL Theory
[Jon Smirl]
>Suppose I have an XML document conforming to Schema A and I want to
>transform it into a document that conforms to Schema B. Has any work been
>done trying to prove that my stylesheet will always generate a valid
>document?
Given a particular input document, it's obviously possible (in the trivial
case, just process the document and check the output). Given only a
schema, it's not generally possible. However, a sufficiently sophisticated
analyzer could tell you that a transformation sheet will always generate a
document compliant with Schema B; will never generate a document compliant
with Schema B; or may generate a document compliant with Schema B depending
on the exact input document.
As a simple case, imagine Schema B allows exactly one empty <b/>. A
stylesheet might have:
<xsl:template match="/"><b/></xsl:template>
or
<xsl:template match="/"><xyzzy>FOO!</xyzzy></xsl:template>
or
<xsl:template match="/">
<xsl:choose>
<xsl:when test=". = 'yes'"></b></xsl:when>
<xsl:otherwise><xyzzy>FOO!</xyzzy></xsl:otherwise>
</xsl:choose>
</xsl:template>
corresponding to the three cases enumerated above.
-Chris
--
Christopher R. Maden, Solutions Architect
Yomu (formerly Exemplary Technologies)
One Embarcadero Center, Ste. 2405
San Francisco, CA 94111
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








