Forum Moderators: open
I am a beginner learning XML.
I have created the following XSL file:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org" version = "1.0">
<xsl:template match = "/">
<xsl:for-each select = "MARKS/CORE">
<xsl:text>MARK IN SUBJECT 1</xsl:text>
<xsl:value-of select = "M1"/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
And the following XML file :
<?xml version ="1.0"?>
<?xml-stylesheet type="text/xsl" href = "Trial.xsl"?>
<MARKS>
<CORE>
<M1>100</M1>
<M2>90</M2>
</CORE>
<ALLIED>
<M3>100</M3>
<M4>100</M4>
</ALLIED>
</MARKS>
But when I run the above file in the browser it is just displaying the text "Mark in Subject 1" but the value of m1 is not displayed can any one identify the changes I should make to get the correct output.
Please help me out.
Thanks in advance!
The code above looks perfect to me. Visually. Unless someone else jumps in with advice, I'll try running it through a parser tomorrow to see what gives.
In the mean time, I'll recommend that you get yourself one of those nifty XSLT debugging tools - there are several to choose from if you search for "xslt software". Grab a trial version and give it a whirl.