"Jehanzeb" == Jehanzeb Hameed <jehanzebhameed(_at_)yahoo(_dot_)com>
writes:
Jehanzeb> Hello I am trying to use xslt to copy a modified version
Jehanzeb> of a xml file. Given a node A, I want to generate a new
Jehanzeb> XML file, which is exactly the same as old XML file, but
OK. So it's a variation on the identity transform.
Jehanzeb> with node A, now also the sibling of its parent.
So in addition to the standard identity transform, you want a template
that matches all nodes that have an A child.
Note that if A is the document element, then the result will not be a
well-formed XML document.
e.g. the tree:
/
|
A
/ \
B C
Cannot be transformed into anything sensible - the document node cannot
have a sibling. I presume you want to limit A to being a child of an
element.
In which case you want a template something like:
<xsl:template match="*[child::A]">
<xsl:copy-of select="."/>
<xsl:copy-of select="A"/>
</xsl:template>
Is A also to be only an element, or can it be some other kind of node?
If you can have A's nested as descendants of A's, then it will be more
complicated.
--
Colin Paul Adams
Preston Lancashire
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--