Looking up only the parent node
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 2
- Joined: Tue Aug 05, 2008 10:11 pm
Looking up only the parent node
Hi, I'm working with some XML that looks something like this:
<root>
<example>
text text
<code>
text text
</code>
</example>
</root>
I am only interested in extracting the <example> text into my XSLT document. How can I go about this without also extracting the child <code>?
<root>
<example>
text text
<code>
text text
</code>
</example>
</root>
I am only interested in extracting the <example> text into my XSLT document. How can I go about this without also extracting the child <code>?
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Looking up only the parent node
Post by sorin_ristache »
Hello,
Use the expression /root/example/text() in your XSLT stylesheet, for example:
Regards,
Sorin
Use the expression /root/example/text() in your XSLT stylesheet, for example:
Code: Select all
<xsl:apply-templates select="/root/example/text()"/>
Sorin
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