Subject: RE: [xsl] How to handle dynamic XPath From: "Michael Kay" <mike@xxxxxxxxxxxx> Date: Tue, 14 Apr 2009 08:48:07 +0100 |
> I am using XSLT to walk through an XML Schema to construct an Xforms > (output) instance. > In parallel I am scanning an (input) instance (of a document > defined by the schema) to include default values in the form. > > Scanning of the input instance is done by means of a variable > that keeps track of the path. The variable is updated > (renewed) each time a template is > (recursively) called with the variable as parameter: You haven't given a great deal of detail about the requirements However, on the surface, I think my preferred approach here would be to write a (meta)stylesheet that takes the schema as input and generates an XSLT stylesheet as output. This latter stylesheet should then expand the default values in your form. This approach is more portable than using xx:evaluate(); it is also likely to be more efficient, more resilient to namespace variations, and more maintainable. The other part of your application architecture I would question is the idea of processing raw schema documents as your input. It's almost impossible in practice to do this correctly - there are so many different ways that users can write the same schema, and I bet that you end up testing your code on only a tiny fraction of these. As an alternative, you might consider using as input the SCM output available from the Saxon schema processor, which gives you an XML view of the compiled schema, eliminating all these variations. Michael Kay http://www.saxonica.com/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] How to handle dynamic XPa, Michael Kay | Thread | RE: [xsl] How to handle dynamic XPa, fred |
Re: [xsl] Re: How to handle dynamic, fred | Date | [xsl] Which XSLT processor on websi, himanshu padmanabhi |
Month |