- From: Kay, Michael <Michael.Kay@softwareag.com>
- Date: Thu, 5 Jun 2003 11:00:20 +0200
- To: "'Ellis Cohen'" <e.cohen@acm.org>, public-qt-comments@w3.org
> Suppose the element Stuff were defined as
>
> <!ELEMENT Stuff (Thing1, Thing2, ...., Thing99)>
>
> If $aStuff identified a Stuff element node
> and $parts contained the sequence ('Thing24', 'Thing27', 'Thing82')
>
> one would be sorely tempted to write $aStuff/$parts
> to get the corresponding sub-elements of the Stuff node
>
> That wouldn't work, but how easy would it be write the
> necessary expression (preferably in XPath alone) given
> $aStuff and $parts?
This kind of expression is very common in XSLT. The answer is:
$aStuff/*[name()=$parts]
Michael Kay
Received on Thursday, 5 June 2003 05:00:25 UTC