Xpointer with XSL question
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">90,009</pagenumber> <pagenumber nodeid="1" nodeoffset="263" xpath="/case/judgment/reasons/para">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. — 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.
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format