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

Re: Merging data based on attributes

Subject: Re: Merging data based on attributes
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 23 Aug 2006 18:02:04 +0100
Re:  Merging data based on attributes
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
you don't need to declare this namespace

    xmlns:fn="http://www.w3.org/2005/02/xpath-functions"
    xmlns:xdt="http://www.w3.org/2005/02/xpath-datatypes">

you don't need to declare these eithera nd shouldn't as they are specific
to specific drafts of XPath (and xdt isn't used at all in teh current
draft)

You do however need to declare the svg namespace, as otherwise you can
not match on svg elements.

This seems to do what you need:


<xsl:stylesheet version="2.0"
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns="http://www.w3.org/2000/svg"
		xmlns:svg="http://www.w3.org/2000/svg"
		exclude-result-prefixes="svg"
		>


<!-- copies all nodes/attributes into result tree unchanged -->
<xsl:template match="@*|node()">
    <xsl:copy>
        <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
</xsl:template>

<xsl:template match="svg:text[.=('element','phase')]">
  <text>
    <xsl:copy-of select="@*"/>
    <xsl:value-of select="key(.,../@id,doc('textsrc.xml'))"/>
  </text>
</xsl:template>

<xsl:key name="element" match="element" use="../@id"/>
<xsl:key name="phase" match="phase" use="../@id"/>

</xsl:stylesheet>

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.