sibling vs child vs child of child


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: sibling vs child vs child of child

Hybrid View

  1. #1
    Join Date
    May 2009
    Posts
    1

    sibling vs child vs child of child

    Hi, new to xml but trying to get my head around it. I have a couple of questions that hope someone can help me with:

    In this example:

    <abbr title="DOM For N00BS"><em>DOM</em></abbr>;

    Is the title attribute node a sibling or child or neither of the <abbr> element node?

    Also, if <em> is the firstChild of <abbr>, is then the text "DOM" the firstChild of <em> or is it it's sibling?

    Thank you!

  2. #2
    Join Date
    May 2009
    Posts
    60
    http://www.4d.com/docs/CMU/CMU00724.HTM



    [CODE]
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xsl" href="node.xsl"?>
    <root>


    <abbr title="DOM For N00BS"><em>DOM</em></abbr>
    </root>
    [CODE]

    Code:
    <?xml version="1.0" encoding="UTF-8" ?>
    
    <!-- New document created with EditiX at Tue May 19 19:20:05 CEST 2009 -->
    
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    	<xsl:output method="text" indent="yes"/>
    	<xsl:variable name="lf" select="'
    '"/>
    	<xsl:template match="/">
    	result<xsl:value-of select="$lf"/>
    
    	from <xsl:value-of select="name(//abbr)"/><xsl:value-of select="$lf"/>
    	child<xsl:value-of select="$lf"/>
    	node	<xsl:value-of select="name(//abbr/child::*)"/>
    	content  <xsl:value-of select="//abbr/child::*"/><xsl:value-of select="$lf"/>
    	attribut<xsl:value-of select="$lf"/>
    	node	<xsl:value-of select="name(//abbr/attribute::*)"/>
    	content  <xsl:value-of select="//abbr/attribute::*"/><xsl:value-of select="$lf"/>
    	</xsl:template>
    </xsl:stylesheet>



    result


    from abbr

    child

    node em
    content DOM

    attribut

    node title
    content DOM For N00BS

Similar Threads

  1. how to Edit Child datalist in a parent Datalist
    By naijacoder in forum ASP.NET
    Replies: 0
    Last Post: 04-27-2006, 12:12 AM
  2. Parent, child forms question
    By NabeeL in forum .NET
    Replies: 2
    Last Post: 03-21-2006, 09:32 PM
  3. Replies: 15
    Last Post: 03-21-2006, 07:53 AM
  4. MDI Child form positioning Questions:
    By BOOGIEMAN in forum VB Classic
    Replies: 10
    Last Post: 04-25-2005, 02:54 AM
  5. Replies: 10
    Last Post: 04-06-2005, 06:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center