Following is the source XML that I am transforming. As you can see, the <text:a> tag is a child of the <text:p> tag:
Code:
<text:p text:style-name="Dog_Normal">
...the one hand, the national economy had performed...
<text:a xlink:type="simple" xlink:href="http://www.atomicdog.com/" office:name="Name" office:target-frame-name="_blank" xlink:show="new">prowess</text:a>
... or his ability to ...
</text:p>
According to my companies DTD, the XML containing links should not be nested in paragraph text nodes. So ideally, I would like to transfrom the above XML into this:
Code:
<Dog_Normal>
...the one hand, the national economy had performed...
</Dog_Normal>
<Dog_Link>
<Dog_URL>http://www.atomicdog.com/</Dog_URL>
<Dog_Reference>prowess</Dog_Reference>
</Dog_Link>
<Dog_Normal>
... or his ability to ...
</Dog_Normal>
So my question is, is there an efficient way of "breaking the parent" of the context node? So far I have had a rough time with thinking of a way to do this. My first instinct was to do something like this:
Code:
<xsl:template match="<text:a>">
</Dog_Normal>
<Dog_Link>...</Dog_Link>
<Dog_Normal>
</xsl:template>
However, this is malformed XML and does not pass the parser. Any thoughts?
Thanks in advance!
Aaron