|
Subject: [xsl] Attribute value (...when false) From: Horace Burke <egrubs@xxxxxxxxx> Date: Wed, 7 Dec 2005 14:10:06 -0800 (PST) |
Hello!
I want to get an output of a single statement "I do
not have..." when the value of attribute "status" in
element entry is not 'rec'-- so I have the following
XSL:
<xsl:for-each select="//SoftwareDocInfo/table">
<xsl:for-each select="tgroup/tbody/row/entry">
<fo:block font-size="17pt">
<xsl:choose>
<xsl:when test="//entry and
not(@status='rec') and(@status='def')
or(@status='none') or(@status='exp')">
<fo:block space-before="3mm">
<fo:external-graphic content-width=".2in"
src="img/squ-bx.png"/>
<xsl:text>  I do not have</xsl:text>
<xsl:value-of select="//productID/productname"/>
</fo:block>
</xsl:when>
<xsl:otherwise>TEST</xsl:otherwise>
</xsl:choose>
</fo:block>
</xsl:for-each><!--table/tgroup/tbody/row/entry-->
</xsl:for-each><!--SoftwareDocInfo/table-->
The desire output when the value of symbol is not
'rec' is:
* I do not have [value of "productname" goes here]
This is the current output from the above snippet:
* I do not have ["productname"]
* I do not have ["productname"]
* I do not have ["productname"]
* I do not have ["productname"]
How can I get the statement to display once when the
value of attribute 'status' is not 'rec'
((and not(attribute::status='rec')))? In other words
when it is false. I know that the <xsl:choose>
<xsl:when...> test for a true value and the
<xsl:other> is process if <xsl:when> is not true. The
<xsl:if...> works similar to the <xsl:when>. Even when
I used <xsl:other> the result is still multiple
outputs (* I do not have...).
This is a snippet of the XML:
<SoftwareDocInfo>
<table>...
<tbody>
<row>
<entry status="def">
<para>X81258</para>
</entry>
<entry morerows="2" status="none">
<para>DX<superscript>®</superscript> 20
Upgrade Kits</para>
</entry>
<entry morerows="2" status="none">
<para>3.5</para>
</entry>
</row>
<row>
<entry status="def">
<para>X73194</para>
</entry>
</row>
</tbody>
</tgroup>
</table>
</SoftwareDocInfo>
Grouping problem?
Thank you,
Horace Burke
__________________________________________
Yahoo! DSL Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] Output Before DOCTYPE?, Michael B Allen | Thread | Re: [xsl] Attribute value (...when , David Carlisle |
| Re: [xsl] Default namespace in resu, Geert Josten | Date | Re: [xsl] Encoding problem or what , FC |
| Month |