xml - XSL substring with in another string -
my xml
<?xml version="1.0" encoding="utf-8" standalone="no"?><?xml-stylesheet type="text/xsl" href="results.xsl"?> <testcase> <details> <platform>windows 7-firefox\prod</platform> </details> </testcase>
i need retrieve windows 7 firefox prod individual strings im able retrieve strings except "firefox", please to retrieve it
my xsl
<?xml version="1.0" encoding="iso-8859-1"?> <!-- edited xmlspy® --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:template match="/"> <html> <body> <os><xsl:value-of select="substring-before(testcase/details/platform, '-')"/></os> <inst><xsl:value-of select="substring-after(testcase/details/platform, '\')"/></inst> <brow><xsl:value-of select="substring-before(substring-after(testcase/details/platform, '\'),'-')"> </brow> </body> </html> </xsl:template> </xsl:stylesheet>
you have backwards (and missing closing!):
<brow><xsl:value-of select="substring-before(substring-after(testcase/details/platform, '\'),'-')"> </brow>
it should be:
<brow> <xsl:value-of select="substring-before(substring-after(testcase/details/platform, '-'),'\')"/> </brow>
Comments
Post a Comment