File: Data.xml
<?xml version="1.0" encoding="utf-8"?>
<DOCUMENT>
<TAG1>Hello</TAG1>
<TAG2>Hello</TAG2>
<TAG3>World</TAG3>
<TAG4>Europe<TAG5>World</TAG5>
</TAG4>
</DOCUMENT>
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:output method="html"/>
<xsl:template match="/">
<xsl:if test="//DOCUMENT[TAG1 = TAG2]">
<xsl:value-of select="//DOCUMENT/TAG1"/>
</xsl:if>
<BR/>
<xsl:if test="//DOCUMENT[TAG3 = TAG4/TAG5]">
<xsl:value-of select="//TAG4/text()"/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Output:
Hello<BR>Europe
|