This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Has anyone got examples of these validating XSLTs? Was: Re: DTD Files !
- To: xsl-list at mulberrytech dot com
- Subject: Re: Has anyone got examples of these validating XSLTs? Was: Re: DTD Files !
- From: David Carlisle <davidc at nag dot co dot uk>
- Date: Wed, 10 May 2000 17:55:39 +0100 (BST)
- References: <8BD71A154EA6D211873E00105A125CDF25BD30@TSSMX1>
- Reply-To: xsl-list at mulberrytech dot com
> 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