XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Schema fragments form style sheets?

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/
 



 

From: Christian Mahnke [mailto:cmahnke.sub@googlemail.com]
Sent: 12 February 2009 09:49
To: xml-dev@lists.xml.org
Subject: [xml-dev] Schema fragments form style sheets?

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]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS