Subject: Re: [xsl] Identity question From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx> Date: Wed, 17 Jan 2001 18:52:36 +0000 |
Hi Chris, The usual question would be: Why am I getting <Child></Child> instead of <Child /> And the usual answer would be 'it doesn't make any difference which of these is used - they're logically equivalent - and this level of detail about the way the output is serialised cannot be affected by XSLT'. *However*, what you're getting (and what I get when I try it too) is: <Child> </Child> This is different from <Child /> because The Child element here has a text node in there with a carriage return in it. If you read this in again (with another processor - MSXML ignores whitespace-only text nodes by default) then you wouldn't have an empty element. There's nothing in the identity template to create this whitespace. So, this is actually a bug in MSXML - they're fairly rare on the ground these days, so well spotted! :) Turns out you can get around it by adding the template: <xsl:template match="*[not(node())]"> <xsl:copy-of select="." /> </xsl:template> In other words, make a direct copy of any element that doesn't have any children. I hope that helps, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Identity question, Michael Beddow | Thread | RE: [xsl] Identity question, Michael Kay |
Re: [xsl] Identity question, Michael Beddow | Date | RE: [xsl] format-number() causing p, Michael Kay |
Month |