[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] regex stuff, last character being chomped
Transforming some text like this which is a director and movie title separated by a tab delimiter. Özkul, 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>&Oumlzkul, Ahmet Salih</director> <movie>Ii (2013</movie> i.e the closing bracket of what should be the movie text node is missing.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|