[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
RE: [xml-dev] Schema fragments form style sheets?
- From: "Michael Kay" <mike@saxonica.com>
- To: <cmahnke@gmail.com>,<xml-dev@lists.xml.org>
- Date: Thu, 12 Feb 2009 09:59:08 -0000
This is closely related to what Saxon-SA does internally
when processing a schema-aware stylesheet - it analyzes the paths that are
present in each template rule and checks that they are consistent with
structures defined in the schema. Actually generating a schema that the
paths are consistent with would not be too different.
The
path analysis that Saxon does to support document projection (which is then used
when loading documents, to filter out the parts of the document that are
reachable) is also very similar, though it only works well for XQuery, because
of the difficulty of doing static matching of apply-templates calls. If you want
to try grovelling in the internals of the product, you could certainly use the
output of this path analysis as the basis for a schema generator. However, I'm
not sure why you would want to - I would think that generating a schema from the
instance document is usually more reliable.
Michael Kay
http://www.saxonica.com/
Dear all,
I hope this is the right list for my
question:
Is anyone aware of attempts to generate a XML schema (or even
fragments) from a XSLT style sheet?
For example:
From my point of
view it should be a reasonable assumption that, if there is a template
matching element X there should be a definition of the same element in the
resulting schema. The same should apply to attributes as well, if the style
sheet looks for attribute Y inside the template for element X, the schema
fragment for X should have a attribute Y. It should even be possible to make
assumptions on invalid constructs by looking for fatal XSLT message
elements.
I'm aware that there are many limitations, starting with
complex matching attributes of the XSLT template element and not ending with
complex XPaths.
With best wishes,
Christian
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]