Re: [xsl] Matching a recursive local element structure

Subject: Re: [xsl] Matching a recursive local element structure
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Sat, 05 Feb 2011 14:23:05 +0000
On 05/02/2011 01:06, David Lee wrote:
Thanks for the ideas (all!)
Let me restate my question maybe it might lead to another idea  (I'm still
floundering !)

For every element declaration in an XSD I would like to generate a unique
XSLT match expression that matches that element declaration (but no others).

First, take any named complex types/groups etc and move them inline within the element declaration to which they refer. Then every element declaration is either a global element declaration E, in which case it matches the pattern schema-element(E), or it is a local element declaration within a schema declaration, in which case it matches a pattern such as schema-element(E)/F/G/H.


So, it can certainly be done with schema-aware patterns (unsurprisingly). Can it be done in all cases with patterns that are not schema-aware? I don't know - but why would you want to? Surely this is what schema-aware XSLT is designed for?

Michael Kay

Current Thread