[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: tags and elements

Subject: Re: tags and elements
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Mon, 02 Sep 2002 19:25:08 +0200
Re:  tags and elements
Hello Elke,

if you want to copy all the elements, you have to tell it the processor. You can't manipulate the input document. At http://www.w3.org/TR/xslt#copying you can find a template that copies everything to the output. If you want to add some elements, you must add some more template so that these elements will not be matched with the general one, but with the specific one:

identity transformation template:

<xsl:template match="@*|node()">
  <xsl:copy>
    <xsl:apply-templates select="@*|node()"/>
  </xsl:copy>
</xsl:template>

specific template:

<xsl:template match="entries">
  <xsl:copy>
    <xsl:appply-templates select="@*|node()"/>
    <entry>a new entry</entry>
  </xsl:copy>
</xsl:template>

Hope this helps a bit,

Joerg


Naraschewski, E. wrote:
Hello,

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?

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>.

I am hoping to hearing from you soon.

Best regards
Elke Naraschewski


--

System Development
VIRBUS AG
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409
joerg.heinicke@xxxxxxxxx
www.virbus.de


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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.