How to get elements of nods
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 3
- Joined: Tue Sep 17, 2019 10:27 pm
How to get elements of nods
Post by Brian_donovan »
Hi, pleas help I am in the need of getting all values from a nod here is my xml code:

here is my XSLT code:<?xml version="1.0" encoding="UTF-8"?>
<items>
<book>
<title font="arial" Textsize="12">The big book</title>
<price>10.90</price>
<year>1985</year>
</book>
</items >
right now I get this:<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<td><xsl:value-of select="items/book/."/></td>
</xsl:template>
but I whant this:The big book
10.90
1985
Pleas help!arial
12
The big book
10.90
1985

-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: How to get elements of nods
Hi,
You probably need to separately match and output the attributes like:
Regards,
Radu
You probably need to separately match and output the attributes like:
Code: Select all
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<td>
<xsl:value-of select="items/book/title/@font"/>
<xsl:text>
</xsl:text>
<xsl:value-of select="items/book/title/@Textsize"/>
<!-- This only outputs the text content -->
<xsl:value-of select="items/book/."/>
</td>
</xsl:template>
</xsl:stylesheet>
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “General XML Questions”
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