|
Subject: [xsl] Problem with xsl:if From: "Gerald Fingerlos" <gerald@xxxxxxxxxxxx> Date: Wed, 21 Apr 2004 18:04:34 +0200 |
I have the following XML Document:
<?xml version="1.0" encoding="UTF-8"?>
<input>
<add class-name="User">
<add-attr attr-name="jkuSLABS">
<value>90</value>
</add-attr>
<add-attr attr-name="jkuSLART">
<value>50</value>
</add-attr>
<add-attr attr-name="jkuPeHabd">
<value type="string">7777-33-11</value>
</add-attr>
</add>
</input>
What Id like to to is the get an output document which should contain
the
<add-attr attr-name="jkuPeHabd">
<value type="string">7777-33-11</value>
</add-attr>
only, if the jkuSLABS=90 AND jkuSLART=50. Otherwise the 3 lines should
be omitted.
I thought of the following, but I think I am misunderstanding
something:
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="*[@attr-name='jkuPeHabd']">
<xsl:variable name="slart"
select="//*[@attr-name='jkuPeBeschSAP22SLART']//value"/>
<xsl:variable name="slabs"
select="//*[@attr-name='jkuPeBeschSAP22SLABS']//value"/>
<xsl:if test="($slart!='50') or ($slabs!='90')">
</xsl:if>
</xsl:template>
As far as I can see the if never gets true, but still if it would be
true, I would need some "else" operation. Maybe you can give me a hint
how to solve this.
Thank you in advance,
Gerald
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] XML Group with XSL, Michael Kay | Thread | RE: [xsl] Problem with xsl:if, Kenny Akridge |
| RE: [xsl] Preceding-Sibling Axes in, Patel, Viral | Date | Re: [xsl] Preceding-Sibling Axes in, David Carlisle |
| Month |