This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: suprised by <xsl:copy-of select="@*"/>


Hi Gerry,

At 03:08 PM 8/6/01, you wrote:
>Why did I get
><td colspan="2" bgcolor="#CC0000">
>instead of
><td>colspan="2" bgcolor="#CC0000"
>?????

because when you said <xsl:copy-of select="@*"/> the processor recognizes 
you are copying attribute nodes, and attribute nodes can only exist on 
element nodes, so that's where it puts them. When serialized, the element 
node with its associated attribute nodes gets written <td colspan="2" 
bgcolor="#CC0000">.

Remember, it's nodes we're processing not strings!

The <xsl:attribute> instruction works the same way. Notice that it's an 
error in your stylesheet to say <xsl:attribute> or <xsl:copy-of 
select="@*"> (both of which create attribute nodes) *after* instructions to 
put child nodes of the element into the tree.

Cheers,
Wendell


======================================================================
Wendell Piez                            mailto:wapiez@mulberrytech.com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
   Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]