Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: search and replace

From: foolproofplan@-----.---
To: 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?



transparent
Print
Mail
Like It
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