Selecting nodes between empty elements
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 2
- Joined: Fri Jun 05, 2009 11:36 am
Selecting nodes between empty elements
Hello everyone,
Could anyone help with this little puzzle which I haven't been about to solve.
I've got an XML file with something like this in it:-
<p>
<pb/>
</p>
<p>3 Prayers.</p>
<p>The Senate.</p>
<p>Speaker. 4</p>
<p/>
<p>
<pb/>
</p>
The <pb/> elements are empty but mark page breaks. What I would like to do is work out the word count for each page - ie for the <p> elements between the two <pb/> elements. I haven't been able to work this out - can anyone point me in the right direction?
Many thanks!
Richard
Could anyone help with this little puzzle which I haven't been about to solve.
I've got an XML file with something like this in it:-
<p>
<pb/>
</p>
<p>3 Prayers.</p>
<p>The Senate.</p>
<p>Speaker. 4</p>
<p/>
<p>
<pb/>
</p>
The <pb/> elements are empty but mark page breaks. What I would like to do is work out the word count for each page - ie for the <p> elements between the two <pb/> elements. I haven't been able to work this out - can anyone point me in the right direction?
Many thanks!
Richard
-
- Posts: 501
- Joined: Mon Feb 03, 2003 10:56 am
Re: Selecting nodes between empty elements
You can find a word count stylesheet here:
http://www.biglist.com/lists/xsl-list/a ... 00351.html
You can use it as a starting point.
You should group first the elements you are interested in counting the words for, using xsl:for-each-group, then apply the counting template over each group.
Examples:
http://www.w3.org/TR/xslt20/#grouping-examples
http://www.zvon.org/xxl/XSL-Ref/Tutoria ... tents.html
http://www.biglist.com/lists/xsl-list/a ... 00351.html
You can use it as a starting point.
You should group first the elements you are interested in counting the words for, using xsl:for-each-group, then apply the counting template over each group.
Examples:
http://www.w3.org/TR/xslt20/#grouping-examples
http://www.zvon.org/xxl/XSL-Ref/Tutoria ... tents.html
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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