From: Michael Kay mike(_at_)saxonica(_dot_)com
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com>
Sent: Monday, July 17, 2017 9:48 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Processing approach
Please show us some input and desired output that capture the essence of the
problem, and give enough information so we can see how one derives from the
other.
Then show us your best attempt at solving the problem. Your current logic
sounds
really contorted and you may find that people suggest tackling it in a
completely different way.
Hi Michael,
Sorry about the lack of detail. Given the following:
<?xml version="1.0" encoding="utf-8"?>
<root>
<nodeA>
<nodeB>
<nodeC ID="foo" />
<nodeC ID="bar">
<!-- XSL processing adds nodes here. -->
</nodeC>
<nodeC ID="baz" />
</nodeB>
</nodeA>
<nodeA>
<nodeD>
<nodeE />
</nodeD>
</nodeA>
</root>
I have a template that matches nodeC based on its ID, copies it contents and
appends child nodes.
Its at this time that much info gets derived which is useful elsewhere. Of
course I can use XPath in
another template and derive it all over again, however what I am after is to
simply insert a new node
in another position. The schema permits the second node I want to generate to
exist as a child of any
nodeA.
I will match on many IDs and encounter many scenario's where I end up
generating data used to
construct the new child elements appended to the nodeC elements whose ID is of
interest. Every
time that happens, I want to use this same info and insert other nodes as
children in any nodeA.
Thanks for the patience everyone,
jlc
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--