Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] Merging two xml documents using xslt

From: Jianyu Lai <jlai@-------->
To:
Date: 2/1/2005 6:25:00 PM
Charles,

Thanks for the reply. I see your point, however, the xapth/xvalue in
updates.xml is dynamic - the xslt doesn't know what it is until run time.

I guess my question is essentially how to pass a list of xpath/xvalue (from
one document) to xslt, and use that to update the source xml document based
on the criteria I described below. I heard xslt cannot take dynamic xpath as
parameter, but in this case, I want xslt to treat these xpath as literal
strings (got the idea from a thread here titled "yet another XPath
question").  But I just cannot get the dynamic xpath strings part going.

Thanks,
Jianyu Lai

---------------------------------------------------------------------------
To:  xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
Subject:  RE: [xsl] Merging two xml documents using xslt 
From:  cknell@xxxxxxxxxx 
Date:  Tue, 01 Feb 2005 12:48:24 -0500 

I don't think I see enough of your files to give you a complete answer, but
you 
can read the external file into the XSLT with the document() function, as in

<xsl:variable name="updates" select="document('updates.xml')" />

>From this point on in your XSLT file, you can refer the value of
/updates/elem 
>[@xpath="/employee/address/country" ]/@xvalue from the external document as

<xsl:value-of select='$updates/updates/elem
[@xpath="/employee/address/country" 
]/@xvalue' />

which should return the string "USA".
-- 
Charles Knell
cknell@xxxxxxxxxx - email


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent