[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] copying namespaces question

Subject: RE: [xsl] copying namespaces question
From: Robby Pelssers <Robby.Pelssers@xxxxxxx>
Date: Tue, 3 Jul 2012 10:46:26 +0200

For the ones interested ... I wrote an article explaining 2 approaches used to
solve the problem:


Thx for the help !!

-----Original Message-----
From: Robby Pelssers [mailto:Robby.Pelssers@xxxxxxx]
Sent: Monday, July 02, 2012 12:53 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] copying namespaces question

It seems like great minds think alike !! ;-)

Thx a lot (again)... !!!!


-----Original Message-----
From: Andrew Welch [mailto:andrew.j.welch@xxxxxxxxx]
Sent: Monday, July 02, 2012 12:50 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] copying namespaces question

On 2 July 2012 11:40, Michael Kay <mike@xxxxxxxxxxxx> wrote:
> I think I would do it like this:

bah, as I was typing it out....

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

    <xsl:output indent="yes"/>

    <xsl:template match="@* | node()">
            <xsl:apply-templates select="@* ,node()"/>

    <xsl:template match="/">
        <xsl:for-each select="//*:object">
            <xsl:result-document href="path/to/{*:name}.xml">
                <xsl:apply-templates select="root(.)/*">
                    <xsl:with-param name="current-object" select="."

    <xsl:template match="*:object">
        <xsl:param name="current-object" tunnel="yes"/>
        <xsl:if test=". is $current-object">
                <xsl:apply-templates select="@*, node()"/>


Andrew Welch

Current Thread