This is my XSL stylesheet:
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pp="passcodeProfile">
<xsl:template match="/">
<xsl:apply-templates select="elements"/>
</xsl:template>
<xsl:template match="element1">
output1
</xsl:template>
<xsl:template match="element2">
output2
</xsl:template>
</xsl:stylesheet>
And this is the input XML:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elements>
<element1>value1</element1>
<element2>value2</element2>
<element3>value3</element3>
<element4>value4</element4>
</elements>
The current spreadsheet outputs the value of the non-matching elements (outputs element1 element2 value3 value 4). How to ignore elements that are not element1 and element2 (outputs element1 element2)?
Your stylesheet outputs the original text nodes as well. You can suppress them by matching them and doing nothing with them, e.g. add <xsl:template match="text()"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With