I have a pretty interesting problem on my hands here, I will try to explain it the best I can.
First let me say "Essentially I need a way to related the transformed data from and xslt stylesheet ( as best possble ) back to its xml source no matter what stylesheet is used to transform it. "
Below is my best example:
Suppose I have an xml document, we will cal it doc.xml and it looks similar to below:
<document>
<heading name="heading1">
My Heading
</heading>
<body name="body1">
Some body data
</body>
</document>
Also suppose I have some xslt document ( Could be any xslt document ) which transforms this xml into another xml document which might look like some html:
<div>
<h1>My Heading</h1>
<p>Some body data</p>
</div>
Now I need to be able to insert information in that resulting xml document that will allow me to related the transformed data back to the original document.
At frist I used two xslt pipes, the first marked the original document with unique id's. The second modified the stylesheeet so that these values were propagaed whenever the user used a value-of. The problem with that is it does not account for someone used complex xslt etc.
Essentially I need a way to related the transformed data ( as best possble ) back to its xml source no matter what stylesheet is used to transform it.
I know xopus [
http://xopus.com/] does this through some sort of processing instructions and xslt pipes however I am not sure exactly how.
It seems to me that this would be a fairly common problem that needs to be solved when writing any type of xml editor that uses stylesheets, if anyone has experience with this I would really appreciated your help.
Note: This needs to be a pure xml/xslt solution. If you don't fully understand the problem I am presenting and want to get more information please e-mail me at cdj8050@rit.edu instead of posting questions here.
Thanks!
Cheers