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

RE: RE: Adding namespace nodes question

Subject: RE: RE: Adding namespace nodes question
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Mon, 17 Dec 2001 14:40:32 -0000
add namespace to node xsl
You modified the original incorrectly. The original used <xsl:copy-of> to
copy the context node. You've modified it to copy a string (the result of a
concat() operation).

Mike Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of
> Manos Batsis
> Sent: 17 December 2001 10:57
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  RE: Adding namespace nodes question
>
>
>
>
> I just saw [1] and tried to copy the namespace nodes:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <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="*">
> 		<xsl:element name="{@name}">
> 		<xsl:for-each select="ns[@type='extra']">
> 			<xsl:copy-of select="concat('xmlns:',
> @prefix,text())"/>
> 		</xsl:for-each>
> 		</xsl:element>
> 	</xsl:template>
> </xsl:stylesheet>
>
>
> It doesn't work.
> Isn't there a descent way to copy my namespace nodes to the result
> element?
> I'm using msxml4 RTM (It's the best choice I have on the client side).
>
> [1]
http://www.biglist.com/lists/xsl-list/archives/200107/msg01675.html

Kindest regards,

Manos


> -----Original Message-----
> From: Manos Batsis
> Sent: Monday, December 17, 2001 12:02 PM
> To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
> Subject: Adding namespace nodes question
>
>
>
> Hi folks,
>
> Suppose I have this XML:
>
> <elem name="myElem">
>  <ns type="own" prefix="">http://www.domain1.org/ns</ns>
>  <ns type="extra" prefix="pre2">http://www.domain2.org/ns</ns>
>  <ns type="extra" prefix="pre3">http://www.domain3.org/ns</ns>
> </elem>
>
> Which actually represents the this XML:
>
> <myElem xmlns="http://www.domain1.org/ns"
>  xmlns:pre2="http://www.domain2.org/ns"
>  xmlns:pre3="http://www.domain3.org/ns" />
>
> What is the most efficient method to add these namespaces to
> the element in the result tree?
>
> Thanks for your time.
>
> Kindest regards,
>
> Manos
>

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 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.