Subject: [xsl] Determining if an optional attribute is present From: "Sam Carleton" <scarleton@xxxxxxxxxxxxxxxx> Date: Tue, 17 Oct 2006 12:36:35 -0400 |
<node id="1" version="1"> </node> <node id="4" version="3" revision="2"> </node>
<node id="1" version="1" revision="0"> </node> <node id="4" version="3" revision="2"> </node>
<xsl:attribute name="revision"> <xsl:if test="not(string(@revision)) = false()"> <xsl:value-of select="@revision"/> </xsl:if> <xsl:if test="not(string(@revision))"> <xsl:text>0</xsl:text> </xsl:if> </xsl:attribute>
But in both cases, whether or not the revision is present, not(string(@revision)) always returns false. I have tried this with both the debugger in XMLSpy and with MSXML 4.0. The target parser is MS .Net 2.0.
Sam -- Miltonstreet Photography http://www.miltonstreet.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] template processing with , Michael Kay | Thread | Re: [xsl] Determining if an optiona, David Carlisle |
Re: [xsl] Question about table colu, ms | Date | [xsl] Can axis specifiers be used i, ms |
Month |