|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Generating the xml: namespace from XSLT into a sch
Hi Danny,
> I have a stylesheet that builds a Schema. In this schema I need to
> output the xml:lang attribute on some elements in this schema. My
> stylesheet creates the schema import statement as well as creating
> the xml:lang attributes at the right place. The problem is I don't
> get a namespace declaration at the top of the schema which the IBM
> quality checker and MSV complain about.
The Namespaces in XML Rec. states:
The namespace prefix, *unless it is xml* or xmlns, must have been
declared in a namespace declaration attribute in either the
start-tag of the element where the prefix is used or in an an
ancestor element (i.e. an element in whose content the prefixed
markup occurs). The prefix xml is by definition bound to the
namespace name http://www.w3.org/XML/1998/namespace.
http://www.w3.org/TR/REC-xml-names/#nsc-NSDeclared
(my emphasis)
So MSV and the IBM quality checker should not complain about the fact
that the xml prefix has not been declared; they are buggy.
Unfortunately, the only work-around around their bugginess in XSLT is
to revert to disable-output-escaping to create the xs:schema element,
which is very ugly and might not even work (it depends on how you're
calling the transformation). There's no clean way to force the XSLT
processor to output a namespace declaration for the XML namespace.
What I recommend you do, therefore, is use your stylesheet as is, and
either write a custom serialiser to add a namespace declaration for
the XML namespace or do a bit of search-and-replace text processing on
the output of the transformation to add the namespace declaration. Oh,
and I recommend that you write bug reports to the MSV and SQC
developers.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|

Cart








