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

RE: Replace values based on external files

Subject: RE: Replace values based on external files
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 14 Jan 2005 12:42:41 -0000
axsl
This solution only works if the XPath expressions are all valid XSLT
patterns. It would certainly make the problem easier if this can be
guaranteed.

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

> 
> Either run file2.xml through
> 
> <xsl:stylesheet version="1.0"
>                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>                 
> xmlns:axsl="http://www.w3.org/1999/XSL/Transform/alias">
>   <xsl:namespace-alias stylesheet-prefix="axsl" result-prefix="xsl"/>
>   <xsl:template match="mapping">
>     <axsl:stylesheet version="1.0">
>       <xsl:for-each select="replace">
>         <axsl:template match="{xpath}">
>           <axsl:attribute name="{{name()}}">
>             <xsl:value-of select="with"/>
>           </axsl:attribute>
>         </axsl:template>
>       </xsl:for-each>
>       <axsl:template match="@* | node()">
>         <axsl:copy>
>           <axsl:apply-templates select="@* | node()"/>
>         </axsl:copy>
>       </axsl:template>
>     </axsl:stylesheet>
>   </xsl:template>
> </xsl:stylesheet>
> 
> and then process file1.xml with the generated stylesheet. Or 
> use Mike's solution that used the extension function.
> 
> Cheers,
> 
> Jarno

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.