xsl-list
[Top] [All Lists]

Replace values based on external files

2005-01-14 02:28:21
Hello,

I need to implement a XSL that will replace text values in file1.xml
based on replacement information in file2.xml.

file2.xml provides an XPath that points to an attribute / element value
and a replacement value. The XML has the form of:

<mapping>
    <!-- should replace @attribute1 value that are 'foo' of all element1
elements in file1.xml with 'bar'-->
    <replace>  
        <xpath>//element1/@attribute1[.='foo']</xpath>
        <with>bar</with>
    </replace>
    <replace>
        ...                    <!-- other replacement operations -->
    </replace>
    ...
</mapping>

Is there an easy way to dynamically generate replacement instructions in
my XSL. I thought of extracting replacement information from file2.xml
with the document function.


Any help is much welcome.

Robert

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>