Subject: Re: [xsl] XML Schema 1.0 files From: davep <davep@xxxxxxxxxxxxx> Date: Thu, 28 Mar 2013 07:25:22 +0000 |
Thanks Mike, Quite comprehensive.
In general, extracting information from schema documents using XSLT is difficult, unless you are prepared to make assumptions and approximations - for example, you might be prepared to ignore the impact of xs:redefine, or the risk of finding xs:element declarations within an xs:documentation element.
In this case I think you can get a reasonable answer fairly easily. If you find an <xs:element name="N"> then the namespace in question is one of the following:
(a) if parent::xs:schema then ../@targetNamespace if present, else ""
(b) otherwise, if normalize-space(@form)="qualified" or empty(@form) and normalize-space(ancestor::xs:schema/@elementFormDefault)="qualified", then ancestor::xs:schema/@targetNamespace if present, else ""
(c) otherwise, ""
I think this caters for most possibilities; an exception is chameleon include where the declarations in a schema document acquire the target namespace of the including schema document.
-- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XML Schema 1.0 files, Michael Kay | Thread | [xsl] Processing tab delimited text, Rick Quatro |
Re: [xsl] XML Schema 1.0 files, Michael Kay | Date | [xsl] XML and JSON performance test, David Lee |
Month |