[XML-DEV Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: Schema fragments form style sheets?
- From: Christian Mahnke <cmahnke.sub@g...>
- To: Michael Kay <mike@s...>
- Date: Thu, 12 Feb 2009 13:49:23 +0100

Hi Micheal,
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.
Thanks for your pointers.
What I'm trying to do is transforming assertions expressed in XSLT or better XQuery, into a schema.I think using assertions is a better approach, since I can express more conditions then in a singe instance.
I just discovered Schematron [1], it looks that this could be a way.
With best wishes, Christian Mahnke
[1] http://www.schematron.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]
|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
RSS 2.0 |
 |
Atom 0.3 |
 |
|
Stylus Studio has published XML-DEV in RSS and ATOM formats,
enabling users to easily subcribe to the list from their preferred news reader application.
|
Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website.
they were not included by the author in the initial post. To view the content without the Sponsor Links please
click here.
|
|