|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: end.tag minimization problem continued
Mikael,
With this XML: <dataType>
<sequence>
<moRef name="ManagedObject"/>
<length>5</length>
</sequence>
</dataType>And this XSL (on xalan): <?xml version="1.0" encoding="iso8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="text"/> <xsl:template match="sequence">
<!-- Check if <sequence>-element has no <length> attribute.-->
foo
<xsl:if test="not(length)">
<xsl:message terminate="yes">
<!-- class name and attribute error message -->
Attribute:<xsl:value-of select="../@name"/>
Class: <xsl:value-of select="../../@name"/>
Error: sequence missing child element, length.
</xsl:message>
</xsl:if>
bar
</xsl:template></xsl:stylesheet> I get: foo
barwhich is what was expected. Same with empty-element <length/>. When I remove the <length> element I get a termination message, again as expected. Regards, --A From: "Mikael Petterson (KI/EAB)" <mikael.petterson@xxxxxxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: end.tag minimization problem continued Date: Tue, 17 May 2005 07:35:07 +0200 _________________________________________________________________ Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/
|
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








