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

Re: Can I use <xsl:key>

Subject: Re: Can I use <xsl:key>
From: aaron apigo <aaronjose_apigo2001@xxxxxxxxx>
Date: Tue, 6 Sep 2005 23:32:39 -0700 (PDT)
span in xsl
Hi Ragulf,
   Thanks for your response. I see your point, I'm a
beginner in XSLT programming, that's why sometimes I
rely on this forum in search for my problem. I've
tried different simple XML structure, and I transform
it with want I want, but the XML that I posted really
bothered me, I know that for some, it only simple, but
as a newbie, its hard for me to transform that.

Here is my initial XSL, 

<xsl:template match="root">
        <xsl:element name="ce:author-group">          
 
            <xsl:for-each
select="text:p/text:span/text:user-field-get[@text:name='ce:author']"
>
                <xsl:element name="{@text:name}">     
                       
                                            
                        <xsl:call-template
name="author_given_name">
                            <xsl:with-param
name="authorCTR" select="position()"></xsl:with-param>
                                      
                        </xsl:call-template>          
              
                        
                        <xsl:call-template
name="author_surname">
                            <xsl:with-param
name="authorCTR" select="position()"></xsl:with-param>
                                      
                        </xsl:call-template>          
              
                        
                    <xsl:call-template
name="author_email_start">
                            <xsl:with-param
name="authorCTR" select="position()"></xsl:with-param>
                                      
                    </xsl:call-template>
                    
                        <xsl:call-template
name="author_email_end">
                            <xsl:with-param
name="authorCTR" select="position()"></xsl:with-param>
                                      
                        </xsl:call-template>          
               

                </xsl:element>
            </xsl:for-each>
        </xsl:element>                    
        
    </xsl:template>
    
    <!-- Author Given Name template -->
    <xsl:template
match="//text:user-field-get[@text:name='ce:given-name']"
 name="author_given_name">
        <xsl:param name="authorCTR"/>        
        <xsl:for-each
select="//text:user-field-get[@text:name='ce:given-name']">
       
            <xsl:if test="$authorCTR=position()">
                <xsl:element name="{@text:name}">
                    <xsl:value-of
select="./following::text:span/text()"/>
                    <xsl:value-of
select="parent::text:span/following::text()"/>        
           
                </xsl:element>                        
  
            </xsl:if>    
        </xsl:for-each>
    </xsl:template>                  
    
    <!-- Author Surname template -->    
    <xsl:template
match="//text:user-field-get[@text:name='ce:surname']"
 name="author_surname">
        <xsl:param name="authorCTR"/>        
        <xsl:for-each
select="//text:user-field-get[@text:name='ce:surname']">
       
            <xsl:if test="$authorCTR=position()">
                <xsl:element name="{@text:name}">
                    <xsl:value-of
select="./following::text:span/text()"/>              
     
                    <xsl:value-of
select="parent::text:span/following::text()"/>        
           
                </xsl:element>                        
  
            </xsl:if>    
        </xsl:for-each>
    </xsl:template>                  
    
    <!--Process   ce:email -->
    <xsl:template
match="//text:user-field-get[@text:name='ce:e-address']
|
//text:span/text:user-field-get[@text:name='ce:e-address']"
 name="author_email_start">
        <xsl:param name="authorCTR"/>
        <xsl:for-each
select="//text:user-field-get[@text:name='ce:e-address']
|
//text:span/text:user-field-get[@text:name='ce:e-address']">
       
            <xsl:if test="$authorCTR=position()">
                <xsl:text
disable-output-escaping="yes">&#x003C;ce:e-address&#x003E;</xsl:text>
           
                <xsl:value-of
select="./following::text:span/text()"/>              
     
                <xsl:value-of
select="parent::text:span/following::text()"/>        
           
            </xsl:if>    
        </xsl:for-each>
    </xsl:template>                  
    
    <xsl:template
match="//text:user-field-get[@text:name='/ce:e-address']
|
//text:span/text:user-field-get[@text:name='/ce:e-address']"
 name="author_email_end">
        <xsl:param name="authorCTR"/>
        <xsl:for-each
select="//text:user-field-get[@text:name='/ce:e-address']
|
//text:span/text:user-field-get[@text:name='/ce:e-address']">
       
            <xsl:if test="$authorCTR=position()">    
                <xsl:text
disable-output-escaping="yes">&#x003C;/ce:e-address&#x003E;</xsl:text>
               
            </xsl:if>
        </xsl:for-each>
    </xsl:template>    


well, hope you understand, my problem is, the e-mail
add were not in the place that was supposed to be.
Can you give me some thoughts about this.

regards.
aaron




	
		
______________________________________________________
Click here to donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/

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.