RE: [xsl] XPath count function in JavaScript

Subject: RE: [xsl] XPath count function in JavaScript
From: "Ragulf Pickaxe" <jawxml@xxxxxxxxxxx>
Date: Thu, 06 May 2004 09:40:12 +0000
Hi Tomas,

The parser does not count whitespace text that is between elements.

You would need something like:
<xsl:text>
</xsl:text>
in the xsl to create a newline.

Perhaps having:
<Cv>Har arbetat som konsult hos microsoft sedan barnsben
</Cv>
Is enough.

The default templates do not automatically create newlines between each time they are invoked (nor do any other template unless where told to).

Regards,
Ragulf Pickaxe :)


ok


I do like that now, but then another problem appeard.

my xsl is now like this:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">
<xsl:output method="text"/>
<xsl:variable name="fnamn-count" select="count(//*[@fnamn='Tomas'])"/>
</xsl:stylesheet>


and my xml doc:
<Katalog>
  <Person fnamn="Tomas" enamn="Olsson" tfn="026-789536">
    <Adress adress="Norrav. 34" postnr="50623" postort="Soderhamn"/>
    <Cv>Har arbetat som konsult hos microsoft sedan barnsben</Cv>
  </Person>
  <Person fnamn="Tomas" enamn="Orre" tfn="026-782576">
    <Adress adress="Sodrav. 34" postnr="50323" postort="Gavle"/>
    <Cv>Har arbetat som stadare hos ericsson</Cv>
  </Person>
.
.
.

when I use xml.transformNode(xsl) the result will be a list with the Cv- text,
like:
Har arbetat som konsult hos microsoft sedan barnsbenHar arbetat som stadare hos
ericsson....


What is wrong?

/Tomas


_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail


Current Thread