Mycontent not showing up when I use the xslt stylesheet
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 10
- Joined: Mon May 29, 2017 7:19 pm
Mycontent not showing up when I use the xslt stylesheet
I made an xsl stylesheet and followed all the instructions in a tutorial I found online. It showed me this:
And I did that with my own xsl, like this:
And what happens is the table header stuff arrives, but none of the table content appears. Can someone point out what I'm doing wrong? Thanks.
Code: Select all
<?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">
<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>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="2.0">
<xsl:template match="/">
<html>
<body>
<h2 style="text-align:center">
Marginalia in Mandeville's Travels
</h2>
<table>
<tr bgcolor = "#ffffff">
<th>Left Margin</th>
<th>Text Block</th>
<th>Right Margin</th>
</tr>
<xsl:for-each select="table">
<tr>
<td><xsl:value-of select="row/left"/></td>
<td><xsl:value-of select="row/middle"/></td>
<td><xsl:value-of select="row/right"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Mycontent not showing up when I use the xslt stylesheet
Hi,
What's your XML source?
Without seeing the source, I guess it should work with
Regards,
Adrian
What's your XML source?
Without seeing the source, I guess it should work with
Code: Select all
<xsl:for-each select="//table">
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service