[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSL Theory

Subject: Re: XSL Theory
From: crism@xxxxxxxxxxxxx (Christopher R. Maden)
Date: Thu, 9 Mar 2000 02:20:40 -0800
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.