[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: display parts of XML tree with xsl:copy ?

Subject: Re: display parts of XML tree with xsl:copy ?
From: Robert Sösemann <robert.soesemann@xxxxxx>
Date: Thu, 28 Feb 2002 13:43:51 +0100
parts of a tree
Thanks a lot Jenni.
But unfortunately I forgat to mention that I need a generic solution.

I cannot include e.g. an extra template for issue because I do not know the
complete supertree.
This XSL should generally work with nearly all kinds of XML docs.
Maybe I forgat also to mention that this is part of an XML Wrapper program
which submit standardized queries to heterogenious XML sources. An attched
source description helps to map to query to xslt, but i definitivly don't
want the uses to note there that the (e.g. issue supertree) must be
traversed and how.

Do you see any possibility to do this generic or at least a bit more generic
;-)

Thanks Robert
----- Original Message -----
From: "Jeni Tennison" <jeni@xxxxxxxxxxxxxxxx>
To: "Robert Sösemann" <robert.soesemann@xxxxxx>
Cc: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, February 26, 2002 4:43 PM
Subject: Re:  display parts of XML tree with xsl:copy ?


> Hi Robert,
>
> > How can I controll that only those ancestors are copied that are in
> > an valid articles supertree?
>
> Using the push method (the identity template plus other templates to
> steer the processing), you need to add a template that matches the
> document element of your stylesheet (which I'll assume is called
> 'issues'), and tells the processor to only process those issue
> elements that contain an article with an author named 'Karen Botnich':
>
> <xsl:template match="issues">
>   <issues>
>     <xsl:apply-templates select="issue[articles/article/authors/author =
>                                        'Karen Botnich']" />
>   </issues>
> </xsl:template>
>
> Using the pull method (the single template with the xsl:for-each) you
> do roughly the same thing - just select those issues for processing:
>
> <xsl:template match="/">
>   <issues>
>     <xsl:for-each
>       select="/issues/issue[articles/article/authors/author =
>                             'Karen Botnich']">
>       <issue>
>         <xsl:copy-of select="volume | number" />
>         <articles>
>           <xsl:copy-of
>             select="articles/article[authors/author = 'Karen Botnich']" />
>         </articles>
>       </issue>
>     </xsl:for-each>
>   </issues>
> </xsl:template>
>
> Cheers,
>
> Jeni
>
> ---
> Jeni Tennison
> http://www.jenitennison.com/
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.