RE: understanding trees

Subject: RE: understanding trees
From: Tony Graham <tgraham@xxxxxxxxxxxxxxxx>
Date: Wed, 16 Jun 1999 16:33:41 -0400 (EST)
At 15 Jun 1999 13:03 +0200, Andre Halama wrote:
 > thanks for all your responses, they helped clear up a lot of my problems.

That's good.

 > the one thing i couldn't get straight yet is one of the question that is
 > also in the spec (6.1.1):
 > 'Is the parent of an attribute node the element that the attribute is on?'
 > i processed one of my xml-files with both tony's stylesheet and
 > cranesoftwright's showtree and they both showed my attributes as children
 > of the elements they are associated with.

If you look at the excerpt from my stylesheet, you'll see there's
<xsl:apply-templates select="@*"/> that selects the attributes plus
the usual <xsl:apply-templates/> that selects the children of the
element node.  So the attributes really don't show up as children.

------------------------------------------------------------
  <xsl:template match="*">
    <div style="border: 1.5pt solid blue; padding: 3pt">
      <p><strong>Element: <xsl:value-of select="local-part()"/></strong></p>
      <blockquote style="background-color: silver">
	<!-- The spans are necessary because empty elements
	  count as element nodes, but Internet Explorer, at least,
	  doesn't cope very well with blockquotes containing nothing -->
	<span style="color: silver">|</span><xsl:value-of select="."/><span style="color: silver">|</span>
      </blockquote>
      <xsl:apply-templates select="@*"/>
      <xsl:apply-templates/>
    </div>
  </xsl:template>
------------------------------------------------------------

As someone else noted, however, the question in the working draft is
in the context of the parent axis for attribute nodes.

 > so, is this the answer or is michael right in saying 'They have a
 > relationship/association with the containing element but it is not the
 > "child" relationship.'?
 > 
 > hope this discussion isn't too annoying,

No.

Regards,


Tony Graham
======================================================================
Tony Graham                            mailto:tgraham@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9632
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


Current Thread