You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Gene Roske <Ge...@Computer.org> on 2002/02/11 19:36:58 UTC

Re: How to get specific parent value

Miroslav -

Within a stylesheet, you can use the XPath location path ancestor::page
to get the page node that contains the current article.

                    - Gene Roske

Miroslav Nachev wrote:

>
>    Hi,
>
>    I have the following XML Tree:
>    <doc>
>       <pages>
>          <page id="pg_1">
>          </page>
>          <page id="pg_2">
>             <chapter>
>                <article>
>                   <article>
>                      <article>
>                      </article>
>                   </article>
>                   <article>
>                      <article>
>                         <article>
>                         </article>
>                      </article>
>                   </article>
>                </article>
>             </chapter>
>          </page>
>          <page id="pg_3">
>          </page>
>       </pages>
>    </doc>
>
>    I have some XSL transformation file and when I am in the position
> "<article>" I would like to see on which page ID I am. Can some body
> help me? How to get the current parent with name "page"? In my case I
> don't know on which level of article element I am !!!
>
>
>    Best Regards,
>    Miroslav Nachev