This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Altering specific value then outputing tree.


> I want to be able to output the above piece of XML in my 
> output document, and I
> can do this fine by doing an <xsl:copy-of select="//person"/> 
> but I want to be
> able to change the value of the member_number tag before 
> outputing the above so
> that it contains a number.  I am going to get the value for 
> the member_number
> from elsewhere within my XML document.  Is there an easy way 
> of doing this
> rather than a <xsl:copy-of..> of each individual element 
> within the above
> tree??

Write an identity template rule for most elements:

<xsl:template match="*">
  <xsl:copy-of select="*"/>
  <xsl:copy><xsl:apply-templates/></xsl:copy>
</xsl:template>

and override it with a special rule for member_number

<xsl:template match="member_number">
  <member_number><xsl:value-of select="..."/></member_number>
</xsl:template>

Mike Kay
Software AG 

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]