Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - search and replace >Thread Next - Re: search and replace Re: search and replaceTo: NULL Date: 2/6/2007 11:49:00 AM
On Feb 6, 5:57 pm, foolproofp...@gmail.com wrote:
> Hey everyone. I am running into a problem with unique ids
> that need to be compared in two xml files. The actual
> object name is represented with its unique id later in
> the xml file, so i need to do a search on an id, find its
> name, and then replace the original id with the name
> instead. If this doesn't make much sense, here is an
> example:
>
> <DBViewer template_id=" .... />
Ouch. That's not particularly well-formed.
> <Fruits
> type="ObjectLink" >:1170775272:459887139:</Fruits>
> </DBViewer>
>
> <excel_database template_id=":324:431:"
> id=":1170775272:459887139:" name="banana" />
>
> In this example, the Fruit ObjectLink should be "banana"
> because it has the same id as the database below.
You should've posted some code. What precisely your problem
is? Something like this:
<xsl:template match="*[@type='ObjectLink']">
<xsl:copy>
<xsl:apply-templates
select=
"
//excel_database[@id=current()/text()]/@name
"/>
</xsl:copy>
</xsl:template>
...should do the trick.
--
roy axenov
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
