cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Pietschmann" <Stefan.Pietschm...@inf.tu-dresden.de>
Subject whitespaces using xsl:copy-of
Date Sat, 31 May 2003 16:39:47 GMT
hi guys,

at the moment I'm writing a Transformer for Cocoon 2.0.4 and my problem is as follows:

There are certain tags not touched by the xslt a step earlier in the pipeline and I want to
read them out. let's say the structure is:

<tagA>
    <sub/>
</tagA>

Now I simply use xsl:copy-of in my XSLT to copy tagA over in the output, so I am able to read
it out in the following Transformer step.
There I can search for tagA and make it a Node variable. I want to check whether the first
childnode of it is called "sub" or "seb".
When I just output all the childnodes of tagA with their names (getNodeName()) I get
child1: "#text:     "
child2: "sub: ...."
child3: "#text:    "

well, it seems obvious that there are whitespaces before and after the sub tag, which occur
when using copy-of with an indented (a.k.a pretty-printed) document.
 If i change the original to be like <tagA><sub/></tagA> sub is the first
and only childnode, otherwise not.

Now the question: Can I somehow get rid of whitespaces between tags when copying tagA over
to the output in my xslt?

Thanx for your help and I hope you got what i meant :P

Stefan Pietschmann
Mime
View raw message