xsl-list
[Top] [All Lists]

Xpointer with XSL question

2004-06-01 23:31:47
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.










<Prev in Thread] Current Thread [Next in Thread>
  • Xpointer with XSL question, AHynes <=