Re: [xsl] Value-of, copy-of

Subject: Re: [xsl] Value-of, copy-of
From: Mike Ferrando <mikeferrando@xxxxxxxxx>
Date: Wed, 27 Feb 2002 08:47:22 -0800 (PST)
Eric,
I am having the same problem. I want to use the copy-of to get all my
coding from a node, but I don't want the node in my output.

Mike F.

XML:
<SHOW>
<C1001>
<TITLE>Allegro</TITLE> (
<UNITDATE>1947</UNITDATE>) lyrics by 
<PERSNAME>Oscar Hammerstein</PERSNAME> II
</C1001>
</SHOW>

Stylesheet:
<xsl:for-each select="//SHOW">
<TR><TD><xsl:copy-of select="./C1001"/></TD></TR>
</xsl:for-each>

Output:
<TR>
<TD>
<C1001>
<TITLE>Allegro</TITLE> (
<UNITDATE>1947</UNITDATE>) lyrics by 
<PERSNAME>Oscar Hammerstein</PERSNAME> II
</C1001>
</TD>
</TR>




--- Eric Vitiello <xsl-list@xxxxxxxxxxxx> wrote:
> ok.
> 
> so awhile back we had a somewhat heated discussion of
> value-of/copy-of, and where the line is drawn between content and
> structure.
> 
> taking the discussion to heart, I evaluated my practice of using
> CDATA blocks to enclose data which I felt was not part of the
> structure, and using value-of, with disable-output-escaping="yes",
> and have switched some of my data to a CDATA-less layout, and I'm
> attempting to convert the style sheets to use copy-of.  I have the
> following XML (this is a small portion of it):
> 
> <?xml version="1.0"?>
> 	<rdf:RDF 
> 		xmlns:dc="http://purl.org/dc/elements/1.1/"; 
> 		xmlns="http://purl.org/rss/1.0/"; 
> 		xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; 
> 		xmlns:sy="http://purl.org/rss/1.0/modules/syndication/";>
> 		<item>
> 			<title>Rebuilding of the website</title>
> 			<description>
> 				<p>this website has now been rebuilt.  We're using an all-css
> all-the-time layout.  The backend articles is now in formatted with
> <acronym title="Resource Description Format">RDF</acronym>, ready
> for syndication.</p>
> 			</description>
> 			<dc:date>2002-02-26</dc:date>
> 			<dc:language>en</dc:language>
> 			<dc:source></dc:source>
> 			<dc:creator></dc:creator>
> 			<dc:contributor>Eric</dc:contributor>
> 		</item>		
> 	</rdf:RDF>
> 
> 
> the chunk of XSL in question is:
> 
> <div class="blurb">
> <xsl:copy-of select="rss:description"/>
> </div>
> 
> my problem is that the processor output is:
> 
> <div class="blurb">
> <description xmlns="http://purl.org/rss/1.0/";
> xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
> xmlns:sy="http://purl.org/rss/1.0/modules/syndication/";>
> <p>this website has now been rebuilt.  We're using an all-css
> all-the-time layout.  The backend articles is now in formatted with
> <acronym title="Resource Description Format">RDF</acronym>, ready
> for syndication.</p>
> </description>
> </div>
> 
> 
> I don't want it to output the <description> elements, only the
> content inside.
> 
> I've tried using child::rss:description  and
> descendant::rss:description, but I get exactly the same output. 
> I'm also a bit annoyed by it putting the namespace declarations in
> the output, but I think it's probably a simple namespace mixup.
> 
> I have the following namespaces defined in the XSL:
> 
> <xsl:stylesheet version="1.0"
> 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
> 	xmlns:rss="http://purl.org/rss/1.0/";
> 	xmlns:dc="http://purl.org/dc/elements/1.1/";
> 	xmlns="http://www.w3.org/1999/xhtml";>
> 
> 
> I wasn't able to find anything dealing with this value-of and
> copy-of issue anywhere.
> 
> I'm just learning to deal with namespaces, so bear with me!
> 
> 
> ---
> Eric Vitiello
> Perceive Designs
> <www.perceive.net>
> 
> 
> 
>  XSL-List info and archive: 
> http://www.mulberrytech.com/xsl/xsl-list
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

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


Current Thread