|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Bizarre problem with MSXML4 that doesn't happen in
Josh,
I agree with Philip, and raise him $10. Your XSLT in general could be cleaned up, and might behave better if it were... Instead of <xsl:when test="count(object/data/row) > 0"> <xsl:value-of select="/object/data/row[1]/field[@ref='f1']"/> </xsl:when> try test="object/data/row" (avoids count function and greater-than test, with the same result of testing true if the node exists). Likewise, instead of <xsl:when test="boolean(/object/securityacl)=true"> <xsl:value-of select="/object/securityacl"/> </xsl:when> Just <xsl:value-of select="/object/securityac1"/> will return the value of the node if it exists, nothing if it doesn't. (The boolean test in the when is buggy, it should be test="boolean(/object/securityacl)=true()" except like the other this is quite redundant.) In fact, the first one looks like a buggy version of the same problem as the second (there is a difference between object/data/row and /object/data/row unless your template is matching the root, which I'm guessing it is). If this is the case, you don't need the when test around the first value either. The only reason you can't simply do <xsl:value-of select="/object/data/row[1]/field[@ref='f1']"/> <xsl:value-of select="/object/securityacl"/> is that apparently these are meant to be exclusive -- and you want your 00000000 if neither of the others is there. Scrubbed, your logic would be (assuming your template matches the root, as I'm guessing): <xsl:choose>
<xsl:when test="/object/data/row">
<xsl:value-of select="/object/data/row[1]/field[@ref='f1']"/>
</xsl:when>
<xsl:when test="/object/securityacl">
<xsl:value-of select="/object/securityacl"/>
</xsl:when>
<xsl:otherwise>00000000</xsl:otherwise>
</xsl:choose>Which is the same as (less intelligible but more concise): <xsl:value-of select="/object/data/row[1]/field[@ref='f1']"/> <xsl:if test="not(/object/data/row)"> <xsl:value-of select="/object/securityacl"/> <xsl:if test="not(/object/securityac1)">00000000</xsl:if> </xsl:if> It's worth a try, Wendell At 12:34 PM 4/11/2003, Philip wrote: I'm guessing it's the same problem - just boolean() causing the problem.... Try doing the same, such as boolean(/object/securityacl/text())
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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








