B
barkeeper
Hi,
I have a xml input file like this:
<root>
<element>
<name>elem1</name>
<child>
<name>1</name>
</child>
<child>
<name>2</name>
</child>
</element>
<element>
<name>elem2</name>
<child>
<name>2</name>
</child>
<child>
<name>3</name>
</child>
</element>
Now I want apply a template on every element element that has a child
with name="3" or name="1" for example.
I do this right now:
<xsl:for-each-group select="root/elment" group-by="name">
<xsl:if test="contains(current()/child/name, '3') or
contains(current()/child/name, '1')" >
<xsl:apply-templates select="current-group()"/>
</xsl:if>
</xsl:for-each-group>
But I get a "too many items" error. I guess because there are more
than one child nodes in a elment node.
Thanks
Peter
I have a xml input file like this:
<root>
<element>
<name>elem1</name>
<child>
<name>1</name>
</child>
<child>
<name>2</name>
</child>
</element>
<element>
<name>elem2</name>
<child>
<name>2</name>
</child>
<child>
<name>3</name>
</child>
</element>
Now I want apply a template on every element element that has a child
with name="3" or name="1" for example.
I do this right now:
<xsl:for-each-group select="root/elment" group-by="name">
<xsl:if test="contains(current()/child/name, '3') or
contains(current()/child/name, '1')" >
<xsl:apply-templates select="current-group()"/>
</xsl:if>
</xsl:for-each-group>
But I get a "too many items" error. I guess because there are more
than one child nodes in a elment node.
Thanks
Peter