[XSL-LIST Mailing List Archive Home]
[Reply To This Message]
Re: Query info on XSD.
Subject: Re: Query info on XSD.|
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Wed, 20 Jul 2011 10:54:07 +0100
One thing you could try is to use the Saxon schema processor to create a
representation of your schema as a .SCM document - this is an XML
representation of the Schema Component Model. It's relatively easy to
query the .SCM document using XPath to find the information you need
(but you'll need to do a bit of exploration to understand the format).
There's more information here:
On 19/07/2011 19:11, Giuseppe Briotti wrote:
First of all, sorry for my bad english...
I have a question about a transformation from xml to xml with different xsd.
I start from a flat docx with custom tag. The following example is a
fragment of such docx:
<w:attr w:name="idA" w:val="18769"/>
<w:attr w:name="idB" w:val="25201"/>
<w:t>This is a bold text</w:t>
Due to the fact that this docx is generated with mynamespace XSD
loaded in MSWord, if I transform
with a XSLT such docx in my xml, I obtain as result a valid XML.
Some of my custom tag allow presentation elements as children, and
The idea is thus to query on my XSD to see if that particular element
allows text or paragraphs as childre.
I didn't find any example. I find xsom  that implements SCD  but
it seems that you must now the correct
and complete SCD path (probably I must implement some kind of visitor...).
I check XSLT2.0 schema aware, but if I understood right, it validates
the source XML and destination XML,
throwing exception if something goes wrong. I don't know if it is
possible, for instance, to change a template
behaviour depending on schema.
At the moment, the only working solution is to create a some king of
XML configuration file that contains all
the required information and open such file as document in xslt and
check it in a template.
This solution works fine, but probably there is a more efficient approach.
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