webmasterbeta
New Member
ok i'm an xml newb which will become obvious once you see my code.
my xml:
<Data xmlns="">
<Elements>
<lastpage>0</lastpage>
<testing1>Box1</testing1>
<testing1>Box1</testing1>
<testing2>Box2</testing2>
</Elements>
<Queue>
<Reg>9</Reg>
</Queue>
</Data>
my xslt:
<xslutput method='xml' version='1.0' encoding='UTF-8' indent='yes' />
<xsl:template match="Data/Elements">
<root xmlns="">
<xsl:for-each select="testing1">
<xsl:if test=".='Box1'">
<queue>1</queue>
</xsl:if>
</xsl:for-each>
</root>
</xsl:template>
my output:
<?xml version="1.0" encoding="utf-16"?>
<root>
<queue>1</queue>
<queue>1</queue>
</root>9
My question is why does the 9 print out at the bottom? I'm not even matching on queue. Thanks in advance your help!
my xml:
<Data xmlns="">
<Elements>
<lastpage>0</lastpage>
<testing1>Box1</testing1>
<testing1>Box1</testing1>
<testing2>Box2</testing2>
</Elements>
<Queue>
<Reg>9</Reg>
</Queue>
</Data>
my xslt:
<xslutput method='xml' version='1.0' encoding='UTF-8' indent='yes' />
<xsl:template match="Data/Elements">
<root xmlns="">
<xsl:for-each select="testing1">
<xsl:if test=".='Box1'">
<queue>1</queue>
</xsl:if>
</xsl:for-each>
</root>
</xsl:template>
my output:
<?xml version="1.0" encoding="utf-16"?>
<root>
<queue>1</queue>
<queue>1</queue>
</root>9
My question is why does the 9 print out at the bottom? I'm not even matching on queue. Thanks in advance your help!