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

regex stuff, last character being chomped

Subject: regex stuff, last character being chomped
From: "Ihe Onwuka ihe.onwuka@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 30 Oct 2014 09:47:57 -0000
 regex stuff
Transforming some text like this which is a director and movie title
separated by a tab delimiter.

&Oumlzkul, Ahmet Salih Ii (2013)

with

  <xsl:template name="main">
    <directors>
     <!-- process a line of text at a time -->
     <xsl:for-each
select="tokenize(unparsed-text('directors.list','iso-8859-1'),'.\n')">
       <!-- deal with tab delimiter -->
       <xsl:variable name="lineSplit"
select="tokenize(.,'\t')[normalize-space(.)]"/>
       <xsl:if test="count($lineSplit) eq 2">
         <director>
           <xsl:value-of select="normalize-space($lineSplit[1])"/>
         </director>
       </xsl:if>
       <movie>
         <xsl:value-of select="$lineSplit[last()]"/>
       </movie>
     </xsl:for-each>
    </directors>
  </xsl:template>

and am getting

   <director>&amp;Oumlzkul, Ahmet Salih</director>
   <movie>Ii (2013</movie>

i.e the closing bracket of what should be the movie text node is missing.

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.