gudii9
asked on
XML XSL Message
Hi,
I am trying below example
https://www.tutorialspoint.com/xslt/xslt_message.htm
My code is as below
Dinkar Kad Dinkar 85 Gupta Vinni 95 Jasvir Singh Jazz 90
I am trying below example
https://www.tutorialspoint.com/xslt/xslt_message.htm
My code is as below
<?xml version = "1.0"?>
<?xml-stylesheet type = "text/xsl" href = "students.xsl"?>
<class>
<student rollno = "393">
<firstname>Dinkar</firstname>
<lastname>Kad</lastname>
<nickname>Dinkar</nickname>
<marks>85</marks>
</student>
<student rollno = "493">
<firstname></firstname>
<lastname>Gupta</lastname>
<nickname>Vinni</nickname>
<marks>95</marks>
</student>
<student rollno = "593">
<firstname>Jasvir</firstname>
<lastname>Singh</lastname>
<nickname>Jazz</nickname>
<marks>90</marks>
</student>
</class>
<?xml version = "1.0" encoding = "UTF-8"?>
<xsl:stylesheet version = "1.0"
xmlns:xsl = "http://www.w3.org/1999/XSL/Transform">
<xsl:template match = "/">
<html>
<body>
<h2>Students</h2>
<table border = "1">
<tr bgcolor = "#9acd32">
<th>Roll No</th>
<th>First Name</th>
<th>Last Name</th>
<th>Nick Name</th>
<th>Marks</th>
</tr>
<xsl:for-each select = "class/student">
<xsl:if test = "firstname = ''">
<xsl:message terminate = "yes">A first name field is empty.
</xsl:message>
</xsl:if>
<tr>
<td><xsl:value-of select = "@rollno"/></td>
<td><xsl:value-of select = "firstname"/></td>
<td><xsl:value-of select = "lastname"/></td>
<td><xsl:value-of select = "nickname"/></td>
<td><xsl:value-of select = "marks"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
i am getting below wrong output without message. please advise on how to fix itDinkar Kad Dinkar 85 Gupta Vinni 95 Jasvir Singh Jazz 90
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
well, the only two processor supporting XSLT3 is
- Saxon 9.6 and above
but you do need a paid version in order to use XSLT3 (Saxon professional edition or enterprise edition)
that processor comes with a bunch of examples that are a bit useless without the processor itself
- exselt (http://exselt.net/)
you can download a beta, but that one is dot net only
- Saxon 9.6 and above
but you do need a paid version in order to use XSLT3 (Saxon professional edition or enterprise edition)
that processor comes with a bunch of examples that are a bit useless without the processor itself
- exselt (http://exselt.net/)
you can download a beta, but that one is dot net only
ASKER
can you point to good examples in xslt3.
looks like tutorialpoint examples based on xslt2