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

Re: Re: AW: AW: global variable and position() once mo

Subject: Re: Re: AW: AW: global variable and position() once more
From: Mulberry Technologies List Owner<xsl-list-owner@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 2 Sep 2003 13:35:58 -0400
what is global ownership
>From: fe.sola@xxxxxxxxxxxxxx
>Date: Tue,  2 Sep 2003 11:59:18 -0400
>To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>Subject: Re:  Re: AW: AW: global variable and position() once more
>
>Hello Dimitre:
>I tested the code and yes, it didn't copy the last element of the list but also had
>another problem and that is definetely my fault, I omitted to mention there are other
>lists
>like that in the input document, cause the description and the references appear as text
>nodes but numbered lists as well, so the algorithm takes part of the other lists as well.
>I'm going to try this new one and let you know the real output.
>Thanks a lot for your help, so far the tutorials and chapters about XPath I've read
>haven't mentioned the xsl:key tag, except for the specification, of course.
>I will take a look at Amazon and find about the books you mentioned.
>Best regards,
>Lizet
>
>Mensaje citado por Dimitre Novatchev <dnovatchev@xxxxxxxxx>:
>
>> > You guys are really masters of XPath...Let me read this slowly and try
>> > to understand...
>> > Do you have any book or tutorial with this tricky constructions??
>> > Thanks a lot!
>> > lizet
>>
>> Actually there was a small omission in the code and this would not allow
>> the last trailers to be copied.
>>
>> Here's the corrected code (the key definitions are omitted as they are the
>> same:
>>
>> <xsl:stylesheet version="1.0"
>>  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>>
>>  <xsl:output omit-xml-declaration="yes" indent="yes"/>
>>  <xsl:strip-space elements="*"/>
>>
>>  <xsl:key name="kStart"
>>   match="text()[preceding-sibling::*[1][self::br]]"
>>   use="contains(., '.')
>>      and
>>        number(substring-before(., '.'))
>>       =
>>        number(substring-before(., '.'))"/>
>>
>>   <xsl:key name="kTrail"
>>   match="text()[preceding-sibling::*[1][self::br]]"
>>    use="generate-id(
>>             preceding-sibling::text()
>>             [
>>              contains(., '.')
>>            and
>>              number(substring-before(., '.'))
>>             =
>>              number(substring-before(., '.'))
>>             ]
>>             [1]
>>                    )"/>
>>
>>   <xsl:template match="/">
>>     <xsl:for-each select="key('kStart', 'true')">
>>      <Claim>
>>       <xsl:copy-of select="normalize-space()"/>
>>       <xsl:variable name="vLastNumbered" select="position() = last()"/>
>>       <xsl:for-each select="key('kTrail', generate-id())">
>>         <xsl:if test="$vLastNumbered or not(position() = last())">
>>           <xsl:copy-of
>>            select="concat(substring(.,1,1),
>>                           normalize-space(substring(.,2))
>>                           )"/>
>>         </xsl:if>
>>       </xsl:for-each>
>>      </Claim>
>>     </xsl:for-each>
>>   </xsl:template>
>> </xsl:stylesheet>
>>
>> I believe that two very good books on XSLT are the following:
>>
>>   "Beginning XSLT" by Jeni Tennison
>>
>>   "XSLT Programmer's Reference" by Michael Kay.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> =====
>> Cheers,
>>
>> Dimitre Novatchev.
>> http://fxsl.sourceforge.net/ -- the home of FXSL
>>
>> __________________________________
>> Do you Yahoo!?
>> Yahoo! SiteBuilder - Free, easy-to-use web site design software
>> http://sitebuilder.yahoo.com
>>
>>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>>
>
>
>
>
>-------------------------------------------------
>Este mensaje fue enviado usando el servicio de correo en web de Infomed
>http://webmail.sld.cu



 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.