xsl-list
[Top] [All Lists]

[xsl] How do I search ancestors in the output tree?

2012-08-31 14:32:22
Hi Folks,

I have some xsl:templates. 

Each template outputs an XML element with an attribute.

For example, I process this element in the input:

     <A>

And output this:

    <Publication id="foo">

Nested within <A> in the input document there is a <B> element:

    <A>
         <B>

The template rule for <B> outputs this:

     <Article id="bar">

So, in the output tree I have this:

     <Publication id="foo">
          <Article id="bar">

And so forth, with the templates processing deeper and deeper into the input 
tree, building a corresponding deeper and deeper nested output tree.

Now I get to this element in the input tree:

    <Book id="PM">

I am at a certain nesting in the output tree. I would like to look up (i.e., to 
the ancestors) of the *output* tree to see if there is an ancestor element with 
the same id value as the id value in the *input* element.

How do I search ancestors in the output tree?  (As opposed to searching 
ancestors in the input tree).

I apologize for my question being so abstract.

/Roger

--~------------------------------------------------------------------
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>
--~--


<Prev in Thread] Current Thread [Next in Thread>