Get the following siblings with a limit
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 3
- Joined: Wed Oct 23, 2013 9:07 am
Get the following siblings with a limit
Post by sunnykeerthi »
Hi,
I'm want an XSLT that will extract the content following the h1 and before the next h1 or end of the document.
Here is my data.
when I try descendant::h1[1]/following::node() it retrieves everything. this works fine with descendant::h1[3]/following::node(), because there is no following h1 after h1[3]. Please let me know on how can I do it.
I'm want an XSLT that will extract the content following the h1 and before the next h1 or end of the document.
Here is my data.
Code: Select all
<div id="toc">
<h1>Head 1</h1>
<p>para text</p>
<div class="class1">div content</div>
<h1>Head 2</h1>
<p>para text</p>
<span>span content</span>
<h1>Head 3</h1>
<p>para text</p>
</div>
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Get the following siblings with a limit
Hi,
Maybe you can try something like this (descendant::h1[1]/following::*)[1]
By the way node() matches elements, text content, comments, processing instructions. This is why I used "*" which matches only elements.
Regards,
Radu
Maybe you can try something like this (descendant::h1[1]/following::*)[1]
By the way node() matches elements, text content, comments, processing instructions. This is why I used "*" which matches only elements.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
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