[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

Subject: Re: Generating the xml: namespace from XSLT into a schema
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Sat, 20 Jul 2002 17:51:43 +0100
xslt force namespace declaration
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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.