Subject: Re: : RE: [xsl] suppressing default template rules From: "Joerg Heinicke" <joerg.heinicke@xxxxxx> Date: Fri, 29 Mar 2002 13:21:12 +0100 |
> <?xml version="1.0" ?> > <custdet>custdettag > <employee>emptag</employee> > <firstname>first</firstname> > <lastname>last</lastname> > </custdet> > The expected output (as per the following node > structure)_ > > / (root node) > +- custdet > | +- 'custdettag' > +- employee > | +- 'emptag' > +- firstname > | +- 'first' > +- lastname > +- 'last' This is correct when using <xsl:strip-space elements="*"/>. And from the name 'strip-space' you can already see where it comes from: from the whitespaces. They are between the end of one node and the beginning of the next node. The complete tree of custdet: +-- custdet | +-- 'custdettag ' (including one linebreak) +-- employee +-- ' ' (whitespaces + linebreak) +-- firstname +-- ' ' +-- lastname If you write the whle XML in 1 line without whitespaces, you will see the expected output too. You also can change the <xsl:apply-templates/> in the template matching on * change to <xsl:apply-templates select="*|text()[normalize-space()]"/>. Or change the template matching on text() to <xsl:template match="text()[normalize-space()]"/>. Regards, Joerg XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: : RE: [xsl] suppressing default, Aseef Jamaluddin | Thread | RE: RE: [xsl] suppressing default t, Michael Kay |
[xsl] merging 2 xml's to 1 xml, Joeri Belis | Date | Re: [xsl] Retrieving subelemets att, Joerg Heinicke |
Month |