RE: [xsl] how to insert the *complete* content of a node

Subject: RE: [xsl] how to insert the *complete* content of a node
From: "Peter Gibbons-BU" <peter.gibbons.01@xxxxxxxxx>
Date: Fri, 21 Mar 2003 16:54:34 -0000
I too have hit this problem, perhaps I have overlooked something here
but an xs:copy-of or a deep copy will return an exact copy:

Given an input of:
<mytag>blabla <foo>foo text</foo> other stuff </mytag>
an xsl:copy-of will result in:
<mytag>blabla <foo>foo text</foo> other stuff </mytag>

ie , the same, which is not necessarily what you want, ie you may want:

<peter name="yes" att="yes">
blabla <foo>foo text</foo> other stuff
</peter>

so how would I get this, ie what would the xsl be?

Regards Peewee

-----Original Message-----
From: David.Pawson@xxxxxxxxxxx [mailto:David.Pawson@xxxxxxxxxxx] 
Sent: 21 March 2003 14:07
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE: [xsl] how to insert the *complete* content of a node


<grin/> Got me too!

Try 
<xsl:template match="mytag">
  <xsl:copy>
    <xsl:copy-of select="*|@*"/>
  </xsl:copy>
</

Instead of copying the value of the contents,
copies the contents and its markup.

HTH DaveP


> I've a problem I can't resolve:
> 
> I have some node that may contain *any* text, including xml/html-like
> text.
> I mean something like:
> 
> <mytag>blabla <foo>foo text</foo> other stuff </mytag>
> 
> I have to produce the complete content of the mytag tag:
> 
> blabla <foo>foo text</foo> other stuff 
> 
> I've tried some combination, but I still can't do it,
> the problem is that I do not know *which* tags and *how many* could be
> nested in the mytag tag.
> 
> may anyone help me?
> 
> thanks,
> Danilo.
> 
> 
> 
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 

- 

NOTICE: The information contained in this email and any attachments is 
confidential and may be legally privileged. If you are not the 
intended recipient you are hereby notified that you must not use, 
disclose, distribute, copy, print or rely on this email's content. If 
you are not the intended recipient, please notify the sender 
immediately and then delete the email and any attachments from your 
system.

RNIB has made strenuous efforts to ensure that emails and any 
attachments generated by its staff are free from viruses. However, it 
cannot accept any responsibility for any viruses which are 
transmitted. We therefore recommend you scan all attachments.

Please note that the statements and views expressed in this email 
and any attachments are those of the author and do not necessarily 
represent those of RNIB.

RNIB Registered Charity Number: 226227

Website: http://www.rnib.org.uk 

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



BBCi at http://www.bbc.co.uk/

This e-mail (and any attachments) is confidential and may contain 
personal views which are not the views of the BBC unless specifically 
stated.
If you have received it in error, please delete it from your system, do 
not use, copy or disclose the information in any way nor act in 
reliance on it and notify the sender immediately. Please note that the 
BBC monitors e-mails sent or received. Further communication will 
signify your consent to this.


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


Current Thread