xsl-list
[Top] [All Lists]

Re: [xsl] Replacing values in one xml file from another xml file

2007-12-27 05:15:25
Mujahid - E - Azam wrote:
*****************2****************

<?xml version="1.0" encoding="UTF-8"?>
<chapter>
<p id="p1">text</p>
</chapter>

*********end of 2****************

If you see the 1 st xml file

At the node wikimedia\ projects\ project\ editions\ edition
language="English" in the place of p1. I should get value from the second
xml file ----- chapter\<p id="p1"> "text".

When I run an xslt and get the data from 1st xml in the place of p1. I
should get text displayed..
I mean it should be linked to the chapter\<p id="p1"> "text". Field of
source.xml..
please let me know how to do this.....

You can load any other xml document during you process by using the document() function (in XSLT 2.0 you can also use doc() and doc-available() etc). The result of document() points to the document node. So, to get you "text" text, you can do something like this, regardless what place of execution you are:

document("second-document.xml")/chapter/p[id='p1']

which will return "text" in your case. Because it is not relative to the wikimedia/projects etc node, you do not have to "link" it in anyway (but I am not sure what you mean with "linking").

HTH,

Cheers,
-- Abel Braaksma

--~------------------------------------------------------------------
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>