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

RE: XSLT Filtering based on defined XML

Subject: RE: XSLT Filtering based on defined XML
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 16 Aug 2005 21:54:22 +0100
xslt dynamic filtering
Your first challenge is to specify this more precisely.

In early drafts of the XQuery specification there was a function called
filter() which was a bit like this, but it got taken out because no-one was
able to write a precise specification of what it was supposed to do.
Sketching out an example isn't good enough. Start by producing a dozen
examples: For example, what output do you want if one of the documents is

<a><b/></a>

and the other is

<b><c/></b>

then generalize from the examples to define the actual rules.

Michael Kay 

> -----Original Message-----
> From: Jacquo Johnson [mailto:genxgeek@xxxxxxxxx] 
> Sent: 16 August 2005 20:26
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  XSLT Filtering based on defined XML
> 
> Hi All,
> 
> Is there an elegant pattern via xslt to filter out an existing source
> xml document based on the contents of another filter xml document? 
> For example:
> 
> Source xml doc:
> <Root>
>    <Node1>
>       <Node11>
>         <Node111/>
>       </Node11>
>       <Node12/>
>    <Node2>
>    ...
> 
> Filter xml doc:
> <Root>
>    <Node1>
>      <Node111/>
>    </Node1>
> </Root>
> 
> Desired results:
> <Root>
>    <Node1>
>      <Node111/>
>    </Node1>
> </Root>
> 
> Now the issue that I'm dealing with is that the filter xml doc is
> dynamic.  That is, it can be different for any given xml source doc
> configuration based on what another server source specifies.  I could
> recursively build some dynamic xslt and add apply-templates for each
> node and make use of copy and copy-of based on if a node has children
> or not and then run that dynamically build transform on the xml doc
> source...however, can anybody think of another way to do this?
> 
> Thanks in advance!

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.