File: Data.xml
<?xml version="1.0" encoding="utf-8"?>
<data>
<car id="a234" checked="yes"/>
<car id="a111" checked="yes"/>
<car id="a005"/>
</data>
File: Transform.xslt
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="car[@checked]">
<paragraph>
<xsl:text>Car: </xsl:text>
<xsl:value-of select="@id"/>
</paragraph>
</xsl:template>
</xsl:stylesheet>
Output:
<?xml version="1.0" encoding="UTF-8"?>
<paragraph>Car: a234</paragraph>
<paragraph>Car: a111</paragraph>
|