[xsl] Re: Re: how to get string value of element node without children concatenated

Subject: [xsl] Re: Re: how to get string value of element node without children concatenated
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Fri, 14 Mar 2003 23:37:29 +0100
"Niko Matsakis" <niko@xxxxxxxxxxxxx> wrote in message
news:3E725111.5010702@xxxxxxxxxxxxxxxx
> While I agree that restructing the xml is best, the easiest option, as
> given by Michael Kay the last time this question was asked, is
>
> <xsl:copy-of select="text()"/>
>
> This not depend on what other templates you have in your stylesheet, it
> will always work, unlike <xsl:apply-templates select="text()"/>

Absolutely right!

I also proposed as a possible solution the use of

  <xsl:copy-of select="text()"/>

in my reply to Jeff.

It seems that many people would use xsl:value-of instead of xsl:copy-of.
This, of course, is not the solution, as it outputs only the first text-node
child.

It seems to me that the reason why people arrive at hurried conlusions like
this is because they use a concrete, very specific xml source document and
do not test their solution with other xml documents.

It would be extremely useful to have a test-data generator -- in this case a
generator of a series of xml documents that fit a particular DTD/Schema.
Also an automated testing environment, in which such generated test data is
continuously processed by the tested transformation and the results are
compared to the results that are required.

Does anybody know about any such tool?


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread