Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: search and replace >Thread Next - Re: search and replace Re: search and replaceTo: NULL Date: 2/9/2007 7:40:00 AM
I had tried using your code:
<xsl:template match="*[@type='ObjectLink']">
<xsl:copy>
<xsl:apply-templates
select=
"
//excel_database[@id=current()/text()]/@name
"/>
</xsl:copy>
</xsl:template>
which works perfectly for the certain xml file I was talking about.
I also tried using it for another one:
<?xml version="1.0" encoding="UTF-8"?>
<EnCapta>
<Document type="Part" id=":1170780883:1282681815:" name="New
Document" >
<FileName>\New Document</FileName>
<Unit/>
<ApplicationData id=":1170780887:48766733:" name="HierarchyApp" >
<ApplicationReference id_ref=":21339045:1265399:" >
<Name>HierarchyApp</Name>
<MajorVersion>0</MajorVersion>
<MinorVersion>0</MinorVersion>
</ApplicationReference>
<Colors template_id=":234334:9087980:" id=":1170780887:2185726:"
name="Colors Galore!" >
<Name type="FixedString" >Colors Galore!</Name>
<Index type="Real" >0</Index>
</Colors>
<Blue template_id=":0:534:" id=":1170780890:1627341938:" name="I'm
Blue" >
<Name type="FixedString" >I'm Blue</Name>
<Index type="Real" >0</Index>
<Parent type="ObjectLink" >:1170780887:2185726:</Parent>
</Blue>
<Green template_id=":12045115:5403534:" id=":
1170780894:1308108165:" name="I'm Green" >
<Name type="FixedString" >I'm Green</Name>
<Index type="Real" >0</Index>
<Parent type="ObjectLink" >:1170780887:2185726:</Parent>
</Green>
<Red template_id=":120045115:534:" id=":1170780900:313735256:"
name="I'm Red" >
<Name type="FixedString" >I'm Red</Name>
<Index type="Real" >0</Index>
<Parent type="ObjectLink" >:1170780887:2185726:</Parent>
</Red>
<Link_Hierarchy template_id=":120888115:534:" id=":
1170780904:1346796842:" name="Link_Hierarchy" >
<Root type="ObjectLink" >:1170780900:313735256:</Root>
</Link_Hierarchy>
<Portal_Hierarchy template_id=":177778115:534:" id=":
1170780908:132006292:" name="Portal_Hierarchy" >
<Root type="ObjectLink" >:1170780887:2185726:</Root>
</Portal_Hierarchy>
</ApplicationData>
</Document>
</EnCapta>
and reworked the code as this:
<xsl:template match="*[@type='ObjectLink']">
<xsl:copy>
<xsl:apply-templates
select="//*[@id=current()/text()]/@name"/>
</xsl:copy>
</xsl:template>
However, nothing is copied into the ObjectLinks.
Am I wrong on using * as a wildcard?
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
