[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Finding a String and adding a line

Subject: RE: Finding a String and adding a line
From: <rick.fraser@xxxxxx>
Date: Thu, 12 May 2005 15:48:07 +0100
rick fraser
Thanks for the help - I have used part of the advice and solved the
problem. Works in Xray and in actual Application. It was MUCH MUCH
easier using Xray.

There were indeed child nodes to get around. Using the original XML, I
now have this XSLT code which does exactly what I needed to do....

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="BT_CONTRACT_PERSON_SYNC">
<BT_CONTRACT_PERSON_SYNC>

<!-- remove this...   <xsl:copy-of select="FieldTypes"/> and add... -->
   <FieldTypes>
         <xsl:apply-templates select="FieldTypes"/>
   </FieldTypes>
<!-- end of inserted code -->
   <MsgData>
      <!-- Transaction -->
         <xsl:apply-templates select="MsgData/Transaction"/>
      <!-- /Transaction -->
   </MsgData>
</BT_CONTRACT_PERSON_SYNC>
</xsl:template>

<!-- main added code - -->

<xsl:template match="FieldTypes">
         <xsl:apply-templates select='BT_PROV_SYNC[@class="R"]'/>
         <xsl:copy-of select='SPB_PERSON_TBL[@class="R"]'/>
</xsl:template>

<xsl:template match='BT_PROV_SYNC[@class="R"]'>
   <xsl:copy>
      <xsl:attribute name="class"> <xsl:value-of select="@class"/>
</xsl:attribute>
      <xsl:apply-templates select="node()"/>
   </xsl:copy>
</xsl:template>

<xsl:template match='BUSINESS_UNIT[@type="CHAR"]'>
     <BUSINESS_UNIT type="CHAR"/>
     <COMPANY type="CHAR"/>
</xsl:template>

<!-- end of main added code -->

<xsl:template match="MsgData/Transaction">
<Transaction>
         <xsl:apply-templates select="BT_PROV_SYNC"/>
         <xsl:copy-of select="SPB_PERSON_TBL"/>
</Transaction>
</xsl:template>

<xsl:template match="BT_PROV_SYNC">
   <xsl:copy>
      <xsl:attribute name="class"> <xsl:value-of select="@class"/>
</xsl:attribute>
      <xsl:apply-templates select="node()"/>
   </xsl:copy>
</xsl:template>

other transformation code goes in here

<!-- copy other fields -->
<xsl:template match="*">
   <xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>

Basically, I had to replace the 'bulk' copy of "FieldTypes" with some
template transformations (main added code).

Thanks again for the start hint "[@" Prakash and Michael

Regards,
Rick

-----Original Message-----
From: David Carlisle [mailto:davidc@xxxxxxxxx]
Sent: 12 May 2005 12:41
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  Finding a String and adding a line


me> does that cut down version generate the error? (It looks OK to me)

but Michael looked harder...
(still odd to get an EOF error from that though....)

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.