xsl-list
[Top] [All Lists]

RE: xsl:value-of select : how to make some tags printed and others not

2003-10-07 04:57:54
Hi Judith

This template:

<xsl:template match="text">
  <xsl:copy-of select="text()|node()"/>
</xsl:template>

gives you:

This is the <sw>content</sw> of my first book, where
<sub>I</sub> would like to leave in the sub-tag, but leave out the
sw-tag.

in the output.

HTH

Rod

-----Original Message-----
From: Judith Rog [mailto:Judith(_dot_)Rog(_at_)kb(_dot_)nl]
Sent: 07 October 2003 12:46
To: XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] xsl:value-of select : how to make some tags printed and
others not


Hi, 
Could anyone help me with the following?

Suppose I have the following XML:

<book>
   <title>My first book</title>
   <chapter>
     <nr>1</nr>
     <text> This is the <sw>content</sw> of my first book, where
<sub>I</sub> would like to leave in the sub-tag, but leave out the
sw-tag.</text>
   </chapter>
</book>

Is it possible to make an xsl statement that would print the content of
the <text> tag and all sub tags (<xsl:value of select="text"/>) but then
somehow leave the html formatting tags <sub> in the output? So:
This is the content of my first book, where <sub>I</sub> would like to
leave in the sub-tag, but leave out the sw-tag.
instead of:
This is the content of my first book, where I would like to leave in
the sub-tag, but leave out the sw-tag.

Thanks for your help.
Judith


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


________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________


________________________________________________________________
Any opinions expressed in this email are those of the individual and not 
necessarily the Company. Unless expressly stated to the contrary, this email is 
not intended to give rise to a new, or affect an existing, contractual or other 
legal relationship.This email and any files transmitted with it, including 
replies and forwarded copies which may contain alterations) subsequently 
transmitted from the Company, are confidential and solely for the use of the 
intended recipient. The unauthorised use, disclosure or copying of this email, 
or any other information contained or attached,is prohibited and could, in 
certain circumstances, be a criminal offence.

If you have received this email in error please notify the sender as soon as 
possible.

This footnote also confirms that this email message has been swept for the 
presence of computer viruses.

www.focusdiy.co.uk
_________________________________________________________________

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________

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



<Prev in Thread] Current Thread [Next in Thread>
  • RE: xsl:value-of select : how to make some tags printed and others not, Rod Humphris - FLPTN <=