Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Getting Namespaces into a Transform

From: "Michael Kay" <mike@--------.--->
To: "'Jim Stanley'" <JimS@--------------.--->, <xmlschema-dev@--.--->
Date: 11/16/2004 6:43:00 PM
If you use a literal result element:

<root pageSizeUnits="{@pageSizeUnits}"
dayBreakPosition="{@dayBreakPosition}">

or

<root>
  <xsl:copy-of select="@pageSizeUnits|@dayBreakPosition"/>

then the namespaces in scope for the <root> element in the stylesheet are
copied into the result tree. 

If you use <xsl:element name="root"> they are not.

It's difficult to create explicit namespace nodes when you use <xsl:element>
in XSLT 1.0. It's easier in 2.0, because there is an <xsl:namespace>
instruction for the purpose.

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: xmlschema-dev-request@w... 
> [mailto:xmlschema-dev-request@w...] On Behalf Of Jim Stanley
> Sent: 16 November 2004 16:09
> To: xmlschema-dev@w...
> Subject: RE: Getting Namespaces into a Transform
> 
> 
> >If you put exactly that in your stylesheet, then you should 
> get exactly
> that
> >in your result tree.
> 
> My first thought was, "Wow, am I stupid for missing the obvious!" 
> (This is undoubtedly still true.)  But when I looked at the transform
> file I'm still mystified.  
> 
> I'm putting in all the elements programatically:
> 
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
> <xsl:template match="root">
> 	<xsl:element name="root">
> 		<xsl:attribute name="pageSizeUnits"><xsl:value-of
> select="@pageSizeUnits"/></xsl:attribute>	
> 		<xsl:attribute name="dayBreakPosition"><xsl:value-of
> select="@dayBreakPosition"/></xsl:attribute>
> 
> 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?
> 
> Thanks again for putting up with the inexperience.
> 
> Jim Stanley
> Media Services, Inc.
> 
> 


From nobody@w... Tue Nov 16 19:04:50 2004
Received: from wiggum.w3.org ([128.30.52.23])


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent