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

Re: Using a pre-processor for dynamic inputs

Subject: Re: Using a pre-processor for dynamic inputs
From: David Adams <dpadams@xxxxxxxxx>
Date: Fri, 24 Sep 2004 07:51:19 +1000
david adams
On Sat, 11 Sep 2004 10:21:38 +0100, Michael Kay <mhk@xxxxxxxxx> wrote:
> There are three approaches to this problem [readining dynamic inputs], all of which are quite
> respectable and widely used.
> 
> (a) if the inputs are fairly predictable in structure, you can write your
> stylesheet to interpret the inputs. For example, you might supply a
> parameter to the stylesheet of the form:
> 
> <conditions>
>   <condition>
>     <attribute>name</attribute>
>     <value>robin</value>
>   </condition>
>   <condition>
>     <attribute>size</attribute>
>     <value>small</value>
>   </condition>
> </conditions>
> 
> and then write logic in your stylesheet to select all the birds that satisfy
> all the conditions.

I'd like to take this approach but am completely stumped at how to
process the input. How is it possible to use subelement values as
dynamic inputs in match/select statements? I keep reading it is
impossible. In my case, the input could looke like this:

<genera>
  <genus>Dromaius</genus>
  <genus>Coturnix</genus>
  <genus>Philemon</genus>
 </genera>

> (b) you can generate or modify the stylesheet each time it is used, to
> incorporate the specific conditions
Yes, pre-processing works great.

> > (c) you can use an extension xx:evaluate(), available in many XSLT
> processors, to intpret an XPath expression that's constructed dynamically.
In my case, I'm using an environment that embeds Xalan C++ 1.6 and
don't have access to evaluate.

Many thanks in advance for suggestions. I'm getting the felling I'm
suffering from thinking in the wrong language. Still, it's hard to
believe that reading dynamic inputs would be an incredibly common task
in XSLT. It also seems that supplying XML structures as inputs should
be quite natural. Perhaps I'm missing some fundamental concept here.
Perhaps the problem is that I'm not looking at the stylesheet aspect
of XSLT. I'm only interested in the transformational aspect and the
native querying abilities.

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.