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

template question: copy-of and non-continuous childre

Subject: template question: copy-of and non-continuous children and grandchildren
From: Mike Ferrando <mikeferrando@xxxxxxxxx>
Date: Fri, 1 Mar 2002 08:52:39 -0800 (PST)
xslt calling children of childre
Dear List (et al.),
I have a question about how I can call a template for children and
grandchildren in as <xsl:copy-of select="node()"/>.

I have been processing all C1007 nodes with a template. But these
C1007 nodes occur at different levels of the C1009 node sometimes as
great great grand children but all C1007 are within ITEM node.

What do you think would be the best way to do this?

Mike F.

XML:
My xml is rather huge. I hope my schema will suffice.


Here is my C1007 template:

<xsl:template match="C1007">
  <xsl:element name="NOTE">
  <xsl:attribute name="ENCODINGANALOG">
    <xsl:value-of select="./@LINK"/>
  </xsl:attribute>
      <xsl:element name="P">
        <xsl:copy-of select="node()"/>
      </xsl:element>
  </xsl:element>
</xsl:template>

Here is my C1009 template:

<xsl:template match="C1009">
  <xsl:element name="NOTE">
  <xsl:attribute name="ENCODINGANALOG">
    <xsl:value-of select="./@LINK"/>
  </xsl:attribute>
      <xsl:element name="LIST">
        <xsl:copy-of select="node()[not(child::C1007)]"/>
      </xsl:element>
  </xsl:element>
</xsl:template>


Here is my schema:

<element name="C1009" occurs="62">
  <element name="HEAD" occurs="62"/>
  <element name="ITEM" occurs="355">
     <element name="TITLE" occurs="246">
        <element name="EMPH" occurs="1"/>
     </element>
     <element name="LIST" occurs="109">
        <element name="HEAD" occurs="109"/>
        <element name="ITEM" occurs="262">
           <element name="TITLE" occurs="262">
            <element name="EMPH" occurs="1"/>
           </element>
           <element name="C1007" occurs="26">
            <element name="PERSNAME" occurs="1"/>
            <element name="TITLE" occurs="29"/>
            <element name="DATE" occurs="1"/>
           </element>
           <element name="C1010" occurs="1">
            <element name="PERSNAME" occurs="2"/>
           </element>
           <element name="C1011" occurs="2"/>
        </element>
     </element>
     <element name="C1007" occurs="13">
        <element name="TITLE" occurs="10"/>
        <element name="DATE" occurs="2"/>
        <element name="CORPNAME" occurs="1"/>
        <element name="SUBJECT" occurs="2"/>
     </element>
     <element name="C1011" occurs="2"/>
  </element>
</element>

__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

 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.