[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Getting Namespaces into a Transform

From: Jeni Tennison <jeni@jenitennison.com>
Date: Tue, 16 Nov 2004 17:03:59 +0000
Message-ID: <15436909.20041116170359@jenitennison.com>
To: "Jim Stanley" <JimS@Media-Services.Com>
CC: xmlschema-dev@w3.org
xsl attributes with namespace xsi

Hi Jim,

> So there are several attributes to the root besides the namespace
> declaration. Since I declare the root element programatically, what
> do I need to do to stick literals in there?

The namespace declaration will be added automatically if you add an
attribute that uses that namespace declaration to the element. So if
you do:

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<xsl:template match="root">
  <xsl:element name="root">
    ...
    <xsl:attribute name="xsi:noNamespaceSchemaLocation">
      <xsl:text>NewPPSSchema.xsd</xsl:text>
    </xsl:attribute>
    ...
  </xsl:element>
  ...
</xsl:template>
...
</xsl:stylesheet>

you should get the xsi:noNamespaceSchemaLocation attribute you want,
plus the namespace declaration that it needs.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Tuesday, 16 November 2004 17:04:02 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

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-2007 All Rights Reserved.