xml-xalan-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aseem Bajaj" <aseem_ba...@intersolutions.stpn.soft.net>
Subject Re: Building XPath expressions - again
Date Wed, 02 Aug 2000 17:59:38 GMT
no i think what Tobias means is that for the given XML stream.... ( take the
example cited )

 /*/*[0]
 /animals/dog
 /animals/*[Animals which chase cats, determined by using a document()
function on some knowledge base]
 /animals/*[starts-with(local-name(),'d')]

should be optimised to
/animals/dogs


we can take it a bit further...
/animals/dogs[position()=1] should be optimised to /animals/dogs given the
schema/dtd which says that there would be only one occurange of <dog> in
<animals>


aseem


----- Original Message -----
From: Ed Staub <estaub@mediaone.net>
To: <xalan-dev@xml.apache.org>
Sent: Tuesday, August 01, 2000 6:35 PM
Subject: RE: Building XPath expressions - again


> Tobias,
> This is impossible to do in many cases.
> Filters are especially difficult.
> For instance, if I have input
>
> <animals>
> <dog/>
> <cat/>
> <squirrel/>
> </animals>
>
> and emit output
>
> <dog/>
>
> was I emitting:
>
> /*/*[0]
> /animals/dog
> /animals/*[Animals which chase cats, determined by using a document()
> function on some knowledge base]
> /animals/*[starts-with(local-name(),'d')]
> etc...
>
> -Ed
>
>
> -----Original Message-----
> From: Tobias Wahlström [mailto:tobias.wahlstrom@pricerunner.se]
> Sent: Tuesday, August 01, 2000 7:11 AM
> To: 'xalan-dev@xml.apache.org'
> Subject: Building XPath expressions - again
>
>
> Hello again!
>
> I previusly posted the message below.
> Since I didn't got any responce I guess that there is no code that does
what
> I want or even is close to do it. Since I really need something like it I
> wonder if anyone has any idea on how this could be done (without using an
> NP-complete algorithm)?
>
>
> Best regards,
> Tobias
>
> > Is there anyone that have written something that build XPath
> > expressions given a sample DOM tree and all nodes in that
> > tree that should be matched? Is there anything like that for
> > building select expressions?
> >
> > The second best is if there is something that takes a XPath
> > expression and a sample DOM tree and create an optimized
> > expression for that sample tree.
> >
> > If you don't know of anything that does what I want, do you
> > know of something that is even close that would help me to
> > build such a thing?
> >
> >
> > Best regards,
> > Tobias Wahlström
>


Mime
View raw message