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

Apply-templates for getting around my XML doc?

Subject: Apply-templates for getting around my XML doc?
From: emitchell154@xxxxxx
Date: Wed, 11 Oct 2000 10:33:25 -0400
xml letter template
Hello
Imagine an XML doc with 'letter' elements, in doc order, from A-Z.  Each 'letter' element has 10 child 'digit' elements, 0-9, 
and each digit element number '0' has 10 'roman numeral 'children, i-ix, so that a random letter, say, L, looks like this:
<L>
   <0>...</0>
        <i>...</i>
        <ii>...</ii>
         //etc.
        <ix>...</ix>
    <1>...</1>  <!--no roman numeral children-->
    <2>...</2>
    //etc
</L>
<M>
    <0>...</0>
         <i>...</i>
   //and so on

OK. If I wanted to process specific elements only, and no others, in the order listed in the stylesheet, 
would the following XSLT be a correct way to navigate around?
<xsl:stylesheet etc.>
   <xsl:template match='/'>
      <xsl:apply-templates select="/L/0/iii"/>   <!-- does this pass the ball directly to the template listed  below?-->
   </xsl:template>

  <xsl:template match="/L/8/iii">
    <!--do something-->
    <xsl:apply-templates select="/X/4/vii"/>  <!--and then does this go to the  next template?-->
 </xsl:template>

 <xsl:template match="/X/4/vii">
    <!--do domething-->
    <xsl:apply-templates select="/L/0/i"/>  
 </xsl:template>

 <xsl:template match="/L/0/i">  <!--this is where I had a problem.  Should it have jumped up again and matched this?  It didn't-->
    <!--do domething-->
    <xsl:apply-templates select="(next victim)
    etc.

Hopefully this can eliminate [this style of navigating] as a potential error.  I don't understand how the processor thinks, and I had some problems with templates being ignored,  but a wise man recommended this style as a [simple-enough-for-even-me-to-understand]
potential solution.  Have I missed even that boat?
Thanks
Edmund
p.s.-processor=xt standalone
edmund_mitchell@xxxxxxxxxxx


 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.