Re: [xslt] template matching issue with node-sets?



On Thu, Mar 21, 2002 at 11:11:37AM -0700, Vakoc, Mark wrote:
> 
> The following stylesheet applys templates on identical xml, the first
> instance is in a variable/node-set, the second is from the source document.
> They xml is the same so the same template should be found for either.  the
> template match is "DIRTREE[d][f]".  It finds the correct match on the xml on
> the source document, and incorrectly when from a node-set
> 
> Here's the interesting part.  If you remove one set of brackets from the
> match (i.e match="DIRTREE[d]") it will act correctly, so it appears that
> having multiple brackets in the match when run against a variable/node-set
> will not work.  

  Yes. 

> Is this a bug or am I insane (or, possibly, both).

  Both. It's insane because initially the XSLT data model did NOT
allow that kind of constructs. It get possible only via the use of
the node-set extension and this create a huge amount of technical 
problems.

  a template matching DIRTREE[d][f] means it matches all the nodes
//DIRTREE[d][f] in the current document. the node set has no document
or if it has a document it is not reachable from the node itself.

  Log the bug please, but understand that the use and abuse of the
node-set extension was not initially part of the XSLT model.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]