[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Xpointer with XSL question

Subject: Xpointer with XSL question
From: AHynes@xxxxxxxxxx
Date: Wed, 2 Jun 2004 16:31:47 +1000
xpointer in xsl
Hello Everybody,

Long story, but ...
I have a series of 'case' xml files that when composed allow the parsing of
a by-product text file that Xpointer expressions can be derived from. When
publishing the cases electronically we need to also include pagenumbers (an
archaic way of doing things, but unfortunately something our customers are
accustomed to and we cannot change).

I have been able to create small 'xpointer' files resembling:
<?xml version="1.0"?>
<pagenumberpaths>
      <pagenumber nodeid="3" nodeoffset="64"
xpath="/case/judgment/reasons/para[45]">90,009</pagenumber>
      <pagenumber nodeid="1" nodeoffset="263"
xpath="/case/judgment/reasons/para[51]">90,010</pagenumber>
</pagenumberpaths>

where it would be fairly simple to construct a proper xpointer expression
which from the XPointer TR requires the offset and node identifer in
something like ...xpath.../1/nodeid.nodeoffset to create a point() [haven't
used the exact syntax as I'm trying to demonstrate that all the information
is in the XML file) as in section 4.4.5 of that document.

So, if all I want to do is insert a <pagenumber> element at a point within
PCDATA in an input document resulting in an exact replicant of the input
document with the additional pagenumber elements inserted, can this be done
with XSL?
I am planning on 'dirtying' character entites so they will be treated
simply as text so there won't be issues with those upsetting the offset
(i.e. &mdash; would become something like !mdash; prior to the application
of the stylesheet, creating a 7 offset rather than ignoring the character
entity or resolving it to one character).

If the answer is no (i.e. XSL cannot be used) then that's okay, it just
means using DOM to manipulate the input document, which is my fallback.

Many thanks in advance,
Alan.









Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.