This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: tags and elements
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Mon, 2 Sep 2002 18:29:25 +0100
- Subject: RE: [xsl] tags and elements
- Reply-to: xsl-list at lists dot mulberrytech dot com
> I am just at the beginning using xslt. Right now I am
> doubting my comprehension of xslt. I am trying to transform
> an xml file into another xml file just wishing to be able to
> add a new element into my result file. I thought I should be
> able to keep all my already existing tags in the result file.
> Am I wrong? They all vanish. Is there a way to keep them?
yes. You're doing something wrong, but unless you show us what you're
doing, it's impossible to say what.
>
> While adding a new element I only get the result <entry/>.
> Actually I would like to enclose some more elements like this
> <entry>...</entry>.
>
> The last question is, whether it is possible to ask wether an
> element is filled or not when using <xsl:if> or <xsl:choose>.
>
Yes. It depends exactly what you mean by "filled". For example, which of
the following are "filled"?:
<a/>
<a><!-comment--></a>
<a> </a>
<a><b/></a>
if the answer is none of them, then you probably want:
<xsl:if test="normalize-space(a)">
Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list