[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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>
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|