I'm a newbie to xml and xsl, I've looked everywhere on the web and I know this is probably a straight forward answer but I can't seem to be able to get it to work. The problem I have is that I have a .xml file and a .xsl file (both are in totally different directories) and I am trying to get the data from the .xml file, but when I view it in IE browser; I just get a blank screen. Please help.
Test.xml
<root>
<tags>abc</tags>
<tags>def</tags>
<tags>ghi</tags>
<tags>jkl</tags>
<tags>mno</tags>
<tags>qpr</tags>
</root>
Test.xsl
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://ift.tt/tCZ8VR">
<xsl:variable name="file" select="'C:\Test.xml'"/>
<xsl:variable name="info" select="document($file)/root/tags"/>
<xsl:template match="/">
<xsl:for-each select="tags">
<xsl:value-of select="$info"/>
</xsl:for-each>
</xsl:template>
</stylesheet>
Output should be:
abcdefghijklmnopqr
No comments:
Post a Comment