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

Re: Identity Transform and Default Templates, I think.

Subject: Re: Identity Transform and Default Templates, I think...
From: "Schneeman, Brent" <BSchneem@xxxxxxxxxxx>
Date: Wed, 19 Jun 2002 12:06:13 -0700
heart on chest cartoon
Me again. As I was moving my lessons learned over to the real application, I
noticed that I need a bit more flexibility...

Given this input:

<C3PO>
   <SOUL id="anewmachine">The Soul</SOUL>
   <BD id="foo">
      <HEAD>The Head</HEAD>
      <TR>
         <RF>The Right Foot</RF>
         <RK>The Right Knee</RK>
         <HR>The Heart</HR>
         <Ext id="extid"><ANewLimb>Some new Limb</ANewLimb></Ext>
         <AnotherNewLimb>Another New Limb</AnotherNewLimb>
      </TR>
   </BD>
</C3PO>

I'd like to have the AnotherNewLimb element copied to the Torso element of
the output document as a sibling of Extension, Chest and RightLeg. But, I'd
like to be able to not be tied to the element name, much like I can rename
SOUL and HEAD and still get the node copied.

If I add 

	<xsl:apply-templates/>

to the TR template, I wind up applying the RF, RK, HR and Ext templates
twice - the output looks like this:

<SeeThreePO>
   <SOUL id="anewmachine">The Soul</SOUL>
   <Body id="foo">
      <HEAD>The Head</HEAD>
      <Torso>
         <Chest>
            <Heart>The Heart</Heart>
         </Chest>
         <RightLeg>
            <RightFoot>The Right Foot</RightFoot>
            <RightKnee>The Right Knee</RightKnee>
         </RightLeg>
         <Extension id="extid">
            <ANewLimb>Some new Limb</ANewLimb>
         </Extension>
         <RightFoot>The Right Foot</RightFoot>
         <RightKnee>The Right Knee</RightKnee>
         <Heart>The Heart</Heart>
         <Extension id="extid">
            <ANewLimb>Some new Limb</ANewLimb>
         </Extension>
         <AnotherNewLimb>Another New Limb</AnotherNewLimb>
      </Torso>
   </Body>
</SeeThreePO>

Which makes sense to me, but its not what I want.

Any ideas?
-Brent

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


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.