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

Re: Has anyone got examples of these validating XSLTs? Was:

Subject: Re: Has anyone got examples of these validating XSLTs? Was: Re: DTD Files !
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 10 May 2000 17:55:39 +0100 (BST)
xsl message examples
> Surely XML Schema is more suitable for those who are disatisfied with DTDs?

`more suitable' depends on what constraints your are trying to enforce.
The types of constraint that you can express using xpath are different.

For example in MathML a cn element (number) normally just takes
character data (as a real number) but if the the type attribute is used
with value complex-cartesian then the cn element has to have exactly one
<sep/> child, with the real and imaginary parts being represented by the
characters either side of the <sep/>.

You can't express this in a DTD (and I don't think you can in a schema
either)  but 


<xsl:template 
  match="m:cn[@type='complex-cartesian' and not(count(m:sep)=1)]">
<xsl:message>don't do this</xsl:message>
</xsl:template>


<xsl:template 
  match="m:cn[m:sep and not(@type)]">
<xsl:message>don't do this either</xsl:message>
</xsl:template>

David


 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.