Home > Articles > Web Services > XML

XML Reference Guide

📄 Contents

  1. XML Reference Guide
  2. Overview
  3. What Is XML?
  4. Informit Articles and Sample Chapters
  5. Books and e-Books
  6. Official Documentation
  7. Table of Contents
  8. The Document Object Model
  9. Informit Articles and Sample Chapters
  10. Books and e-Books
  11. Official Documentation
  12. DOM and Java
  13. Informit Articles and Sample Chapters
  14. Books and e-Books
  15. Implementations
  16. DOM and JavaScript
  17. Using a Repeater
  18. Repeaters and XML
  19. Repeater Resources
  20. DOM and .NET
  21. Informit Articles and Sample Chapters
  22. Books and e-Books
  23. Documentation and Downloads
  24. DOM and C++
  25. DOM and C++ Resources
  26. DOM and Perl
  27. DOM and Perl Resources
  28. DOM and PHP
  29. DOM and PHP Resources
  30. DOM Level 3
  31. DOM Level 3 Core
  32. DOM Level 3 Load and Save
  33. DOM Level 3 XPath
  34. DOM Level 3 Validation
  35. Informit Articles and Sample Chapters
  36. Books and e-Books
  37. Documentation and Implementations
  38. The Simple API for XML (SAX)
  39. Informit Articles and Sample Chapters
  40. Books and e-Books
  41. Official Documentation
  42. SAX and Java
  43. Informit Articles and Sample Chapters
  44. Books and e-Books
  45. SAX and .NET
  46. Informit Articles and Sample Chapters
  47. SAX and Perl
  48. SAX and Perl Resources
  49. SAX and PHP
  50. SAX and PHP Resources
  51. Validation
  52. Informit Articles and Sample Chapters
  53. Books and e-Books
  54. Official Documentation
  55. Document Type Definitions (DTDs)
  56. Informit Articles and Sample Chapters
  57. Books and e-Books
  58. Official Documentation
  59. XML Schemas
  60. Informit Articles and Sample Chapters
  61. Books and e-Books
  62. Official Documentation
  63. RELAX NG
  64. Informit Articles and Sample Chapters
  65. Books and e-Books
  66. Official Documentation
  67. Schematron
  68. Official Documentation and Implementations
  69. Validation in Applications
  70. Informit Articles and Sample Chapters
  71. Books and e-Books
  72. XSL Transformations (XSLT)
  73. Informit Articles and Sample Chapters
  74. Books and e-Books
  75. Official Documentation
  76. XSLT in Java
  77. Java in XSLT Resources
  78. XSLT and RSS in .NET
  79. XSLT and RSS in .NET Resources
  80. XSL-FO
  81. Informit Articles and Sample Chapters
  82. Books and e-Books
  83. Official Documentation
  84. XPath
  85. Informit Articles and Sample Chapters
  86. Books and e-Books
  87. Official Documentation
  88. XML Base
  89. Informit Articles and Sample Chapters
  90. Official Documentation
  91. XHTML
  92. Informit Articles and Sample Chapters
  93. Books and e-Books
  94. Official Documentation
  95. XHTML 2.0
  96. Documentation
  97. Cascading Style Sheets
  98. Informit Articles and Sample Chapters
  99. Books and e-Books
  100. Official Documentation
  101. XUL
  102. XUL References
  103. XML Events
  104. XML Events Resources
  105. XML Data Binding
  106. Informit Articles and Sample Chapters
  107. Books and e-Books
  108. Specifications
  109. Implementations
  110. XML and Databases
  111. Informit Articles and Sample Chapters
  112. Books and e-Books
  113. Online Resources
  114. Official Documentation
  115. SQL Server and FOR XML
  116. Informit Articles and Sample Chapters
  117. Books and e-Books
  118. Documentation and Implementations
  119. Service Oriented Architecture
  120. Web Services
  121. Informit Articles and Sample Chapters
  122. Books and e-Books
  123. Official Documentation
  124. Creating a Perl Web Service Client
  125. SOAP::Lite
  126. Amazon Web Services
  127. Creating the Movable Type Plug-in
  128. Perl, Amazon, and Movable Type Resources
  129. Apache Axis2
  130. REST
  131. REST Resources
  132. SOAP
  133. Informit Articles and Sample Chapters
  134. Books and e-Books
  135. Official Documentation
  136. SOAP and Java
  137. Informit Articles and Sample Chapters
  138. Books and e-Books
  139. Official Documentation
  140. WSDL
  141. Informit Articles and Sample Chapters
  142. Books and e-Books
  143. Official Documentation
  144. UDDI
  145. UDDI Resources
  146. XML-RPC
  147. XML-RPC in PHP
  148. Informit Articles and Sample Chapters
  149. Books and e-Books
  150. Official Documentation
  151. Ajax
  152. Asynchronous Javascript
  153. Client-side XSLT
  154. SAJAX and PHP
  155. Ajax Resources
  156. JSON
  157. Ruby on Rails
  158. Creating Objects
  159. Ruby Basics: Arrays and Other Sundry Bits
  160. Ruby Basics: Iterators and Persistence
  161. Starting on the Rails
  162. Rails and Databases
  163. Rails: Ajax and Partials
  164. Rails Resources
  165. Web Services Security
  166. Web Services Security Resources
  167. SAML
  168. Informit Articles and Sample Chapters
  169. Books and e-Books
  170. Specification and Implementation
  171. XML Digital Signatures
  172. XML Digital Signatures Resources
  173. XML Key Management Services
  174. Resources for XML Key Management Services
  175. Internationalization
  176. Resources
  177. Grid Computing
  178. Grid Resources
  179. Web Services Resource Framework
  180. Web Services Resource Framework Resources
  181. WS-Addressing
  182. WS-Addressing Resources
  183. WS-Notifications
  184. New Languages: XML in Use
  185. Informit Articles and Sample Chapters
  186. Books and e-Books
  187. Official Documentation
  188. Google Web Toolkit
  189. GWT Basic Interactivity
  190. Google Sitemaps
  191. Google Sitemaps Resources
  192. Accessibility
  193. Web Accessibility
  194. XML Accessibility
  195. Accessibility Resources
  196. The Semantic Web
  197. Defining a New Ontology
  198. OWL: Web Ontology Language
  199. Semantic Web Resources
  200. Google Base
  201. Microformats
  202. StructuredBlogging
  203. Live Clipboard
  204. WML
  205. XHTML-MP
  206. WML Resources
  207. Google Web Services
  208. Google Web Services API
  209. Google Web Services Resources
  210. The Yahoo! Web Services Interface
  211. Yahoo! Web Services and PHP
  212. Yahoo! Web Services Resources
  213. eBay REST API
  214. WordML
  215. WordML Part 2: Lists
  216. WordML Part 3: Tables
  217. WordML Resources
  218. DocBook
  219. Articles
  220. Books and e-Books
  221. Official Documentation and Implementations
  222. XML Query
  223. Informit Articles and Sample Chapters
  224. Books and e-Books
  225. Official Documentation
  226. XForms
  227. Informit Articles and Sample Chapters
  228. Books and e-Books
  229. Official Documentation
  230. Resource Description Framework (RDF)
  231. Informit Articles and Sample Chapters
  232. Books and e-Books
  233. Official Documentation
  234. Topic Maps
  235. Informit Articles and Sample Chapters
  236. Books and e-Books
  237. Official Documentation, Implementations, and Other Resources
  238. Rich Site Summary (RSS)
  239. Informit Articles and Sample Chapters
  240. Books and e-Books
  241. Official Documentation
  242. Simple Sharing Extensions (SSE)
  243. Atom
  244. Podcasting
  245. Podcasting Resources
  246. Scalable Vector Graphics (SVG)
  247. Informit Articles and Sample Chapters
  248. Books and e-Books
  249. Official Documentation
  250. OPML
  251. OPML Resources
  252. Summary
  253. Projects
  254. JavaScript TimeTracker: JSON and PHP
  255. The Javascript Timetracker
  256. Refactoring to Javascript Objects
  257. Creating the Yahoo! Widget
  258. Web Mashup
  259. Google Maps
  260. Indeed Mashup
  261. Mashup Part 3: Putting It All Together
  262. Additional Resources
  263. Frequently Asked Questions About XML
  264. What's XML, and why should I use it?
  265. What's a well-formed document?
  266. What's the difference between XML and HTML?
  267. What's the difference between HTML and XHTML?
  268. Can I use XML in a browser?
  269. Should I use elements or attributes for my document?
  270. What's a namespace?
  271. Where can I get an XML parser?
  272. What's the difference between a well-formed document and a valid document?
  273. What's a validating parser?
  274. Should I use DOM or SAX for my application?
  275. How can I stop a SAX parser before it has parsed the entire document?
  276. 2005 Predictions
  277. 2006 Predictions
  278. Nick's Book Picks

At this point, we have a working, static version of a hierarchical tree structure. The text is displayed based on whether a particular nodte is open or closed, and the appropriate "plus" or "minus" icon is displayed based on whether the node is open or closed. What we don't have is a way to make sure that the page is displayed with the appropriate node open to start with. Several ways exist to accomplish this. We could, if we choose, add a handler to the event that signifies that the page is loaded, and create JavaScript that would read the URL, detect the appropriate node, and display it in the open state.

In this case, however, we are going to use this opportunity to look at the way in which we can use .Net to display hierarchical data on a page. In a later entry, we'll do this with XML, but before we get to that point, let's look at the basic process.

.Net was designed from the beginning to make it easier to create dynamic web sites. One way in which it accomplishes this task is to create "controls" to which you can bind a set of data. For example, you can easily create an HTML table of data from a database by "binding" the data to a DataGrid control. The control then inserts all of the appropriate HTML, and even gives you the opportunity to specify styles are the table was a whole and of alternate rows.

But we need even more control than that. After all, we are not creating a table. If we follow the HTML at the end of our last entry, in order to match the existing structure of the InformIT.com site, we will need to use lists instead. Fortunately, .Net provides a control that gives us complete power over what it outputs. It's called a Repeater.

Let's look at what we're actually going to do. We have a set of data, or rather two sets of data, that represent topics in the InformIT XML and Web Services Guide. One set represents the main topics, or "C heads", and the other represents the subtopics, or "D heads" that appear under them in the hierarchy. We can represent them in a database such as the one in figure 1:

Guide Entry table

Notice that we have a pair of columns, id and parent_id, that relate the rows. For example, entry 12 is the parent for entries 14, 15, and 16. So we know that those items need to be displayed as children of entry 12. We can use this data relation in displaying the page, even if it doesn't formally exist in the database.

To display these items on the page, we'll start with a basic Repeater:

<%@ Page Language="VB" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
   <base href="http://www.informit.com" />
</head>
<body>
   <asp:Repeater id="CHeadRepeater" runat="server">

      <HeaderTemplate>
        <h1>Other page content, such as the top of the page</h1>
      </HeaderTemplate>

      <ItemTemplate>
          
         <p><a href="/guides/content.asp?g=xml&seqNum=<%# DataBinder.Eval(Container.DataItem, "id") %>">

            <%# DataBinder.Eval(Container.DataItem, "guideEntryTitle") %>
         </a></p>

      </ItemTemplate>

      <FooterTemplate>
        (The bottom of the page.)

      </FooterTemplate>
   </asp:Repeater>

</body>
</html>

Notice that the Repeater control uses a prefix of asp:. You're probably tempted to think, "oh, I recognize that, that's an XML namespace alias." Well, not really, but it does serve much of the same purpose; it tells the server that this is not a simple HTML element to display, and but rather an element to process. The runat attribute tells the server it's the one that should process it, and not the client.

As you might suspect, the HeaderTemplate and FooterTemplate elements are processed before the first item, and after the last item, respectively. The ItemTemplate element gets processed for each item the Repeater encounters, and that's where it gets interesting.

When the server encounters content in the <%# %> notation, it knows that it is supposed to process the contents based on the current row. For example, in this case we are executing the DataBinder.Eval function to get the id and guideEntryTitle attributes of the object representing the current item. We can add any function we want into one of these evaluation blocks, as we'll see shortly.

Now let's populate the Repeater:

<%@ Page Language="VB" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Odbc" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">

<script language="VB" runat="server">

    Sub Page_Load(Src As Object, E As EventArgs)
        
        Dim MyConnection As OdbcConnection
        Dim MyCommand As OdbcCommand
        Dim ConnectionString As String
        Dim ds As DataSet 

        ConnectionString = _
           "Driver={Microsoft Access Driver (*.mdb)};" & _
           "Dbq="&Server.MapPath("guideentries.mdb")&";"
        
        myConnection = new Odbc.OdbcConnection(ConnectionString)

        Dim CHeads As OdbcDataAdapter = _
                 New OdbcDataAdapter( _
                     "select * from GuideEntries where parent_id=0 order by listOrder", _
                     myConnection )
        ds = New DataSet()
        CHeads.Fill(ds, "cheads")

        CHeadRepeater.DataSource = ds.Tables("cheads")
        CHeadRepeater.DataBind()

        myConnection.Close()
    End Sub
</script>

<html>
<head>
   <base href="http://www.informit.com" />

</head>
<body>
   <asp:Repeater id="CHeadRepeater" runat="server">
      <HeaderTemplate>
...

First, note that the server executes the Page_Load subroutine on, as you might have guessed, loading the page. To that end, we can use this opportunity to create a set of data and bind it to the Repeater. In my case, I'm running my ASP.net pages in a hosted environment in which I can only access an Access database, and only directly, so my first step is to create an ODBC connection. (If you are using, say, SQL Server, you'll load the System.Data.SqlClient classes instead.) Once we've got the connection, we create a DataAdapter that uses the connection to select all of the main topics, and use it to create a table in the DataSet. (We can tell they are main topics because they have a parent_ID of 0.)

It's important to note that we didn't just "populate" the DataSet, as we might have done with a RecordSet. One of the advantages of using a DataSet is that it can hold more than one table of data. In this case, we've created one arbitrarily called cheads. In a few moments, will create a second one and related to the first.

In the meantime, we are using this table as the data source for the Repeater, which we can identify from the id attribute we gave it in the body of the page. Once we assign it a data source, we bind the data to it, which gives us a page like figure 2:

 a simple repeater

Now we can go ahead and create the data relation so we can display the subtopics:

...
        Dim CHeads As OdbcDataAdapter = _
                 New OdbcDataAdapter( _
                     "select * from GuideEntries where parent_id=0 order by listOrder", _
                     myConnection )
        ds = New DataSet()
        CHeads.Fill(ds, "cheads")

        Dim DHeads As OdbcDataAdapter = _
                 New OdbcDataAdapter( _
                      "select * from GuideEntries where parent_id > 0 order by listOrder", _
                      myConnection )
        DHeads.Fill(ds, "dheads")

        ds.Relations.Add("topicRelation", _
                             ds.Tables("cheads").Columns("id"), _
                             ds.Tables("dheads").Columns("parent_id"))

        CHeadRepeater.DataSource = ds.Tables("cheads")
        CHeadRepeater.DataBind()

        myConnection.Close()
    End Sub
</script> 
...

Here we have a second data adapter that adds a second table of data, called "dheads", to the DataSet. We can then create the parent-child relationship, topicRelation, by relating to the parent_id column in the child table to the id column in the parent table.

It's important to note that this case, in which both sides of the relation represent the same table in the database, is actually a rarity. In most cases, you will use this capability to draw a relations between, say, a customer table and an order table, or even different types of data.

Now that we've got the relation, we can actually nest another Repeater within the first:

...
   <asp:Repeater id="CHeadRepeater" runat="server">
      <HeaderTemplate>
        <h1>Other page content, such as the top of the page</h1>

      </HeaderTemplate>

      <ItemTemplate>
          
         <p><a href="/guides/content.asp?g=xml&seqNum=<%# DataBinder.Eval(Container.DataItem, "id") %>">
            <%# DataBinder.Eval(Container.DataItem, "guideEntryTitle") %>

         </a></p>
         <asp:Repeater id="DHeadRepeater" runat="server" 
              datasource='<%# Container.DataItem.Row.GetChildRows("topicRelation") %>'>

              <HeaderTemplate>
                 <div style="border: 1px dashed black">
              </HeaderTemplate>

              <ItemTemplate>
                  <%# Container.DataItem("guideEntryTitle") %><br />
              </itemtemplate>

              <FooterTemplate>
                  </div>

              </FooterTemplate>

          </asp:Repeater>
      </ItemTemplate>

      <FooterTemplate>
        (The bottom of the page.)
      </FooterTemplate>

   </asp:Repeater>
...

Notice that the new Repeater is within the ItemTemplate of the first one. That means it will be executed once for each row of the original set of data. But what will it use for data? Well, notice the datasource attribute. Remember, when the server encounters that type of evaluation block, it knows it has to calculate the contents based on the current row. Because we have created a data relation, the server can pull all of the child rows for the current row. The results look something like figure 3:

 embedding a Child

Now that we have the basic Repeaters working, we can insert the actual HTML we want to output:

<html>
<head>
   <base href="http://www.informit.com" />

   <script type="text/javascript">

      function toggle(plusminus){
         if (plusminus.src=="http://www.informit.com/display/common/images/icons/plus.gif"){
            plusminus.src="/display/common/images/icons/minus.gif";
         } else {
            plusminus.src="/display/common/images/icons/plus.gif";
         }

         base = plusminus.parentNode;

         allChildren = base.getElementsByTagName("ul")[0].getElementsByTagName("li");
         for (i = 0; i < allChildren.length; i++){
            el = allChildren[i];
            if (el.style.display!="block"){
               el.style.display="block";
            } else {
               el.style.display="none";
            }
         }
      }

   </script>
   <style type="text/css">
      ul { display: block;
           list-style-type: none; }
   </style>

</head>
<body>
   <asp:Repeater id="CHeadRepeater" runat="server">
      <HeaderTemplate>
        <h2>Other page content, such as the top of the page</h2>
        <ul>

      </HeaderTemplate>

      <ItemTemplate>
         <li class="chead">
           <img src="/display/common/images/icons/plus.gif" alt="Expand" onclick="toggle(this)" />
           <span class="cheadT">
              <a href="/guides/content.asp?g=xml&seqNum=<%# DataBinder.Eval(Container.DataItem, "id") %>">

               <%# DataBinder.Eval(Container.DataItem, "guideEntryTitle") %>
              </a>
           </span>
           <ul style="display: block;">
          
             <asp:Repeater id="DHeadRepeater" runat="server" 
                datasource='<%# Container.DataItem.Row.GetChildRows("topicRelation") %>'>

                <ItemTemplate>
                   <li class="dhead" style="display: block">
                      <img src="/display/common/images/icons/plus.gif" alt="Expand" onclick="toggle(this)" />
                      <a href="/guides/content.asp?g=xml&seqNum=<%# Container.DataItem("id") %>">
                        <%# Container.DataItem("guideEntryTitle") %>

                      </a>
                   </li>
                </itemtemplate>

             </asp:Repeater>

           </ul>

         </li>

      </ItemTemplate>

      <FooterTemplate>
        </ul>
        (The bottom of the page.)
      </FooterTemplate>

   </asp:Repeater>

</body>
</html>

Now the page is virtually identical to the one we created earlier. (There is a slight change to the toggle script based on the fact that we will be manipulating the li elements directly.) As before, the JavaScript gets executed by the browser, not the server. But it is the server that creates the HTML, including the links.

The result looks like figure 4:

 adding the correct HTML

At this point, we are essentially right back where we started. We have a page that displays our information, and opens and closes the appropriate node when requested. But we still need to have the server display nodes in their proper state to start with. We'll start by determining which main topic should be open:

<%@ Page Language="VB" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Odbc" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">

<script language="VB" runat="server">

    Dim openId as String
    Dim ds As DataSet 

    function getParentId(childId as String)

       Dim targetRows As Array
       targetRows = ds.Tables("dheads").select("id="&childId)
       if (targetRows.Length = 0)
          return 0
       else 
          Dim thisRow As DataRow = targetRows.GetValue(0)
          return thisRow("parent_id")
       end if

    end function

    Sub Page_Load(Src As Object, E As EventArgs)
        
        Dim MyConnection As OdbcConnection
        Dim MyCommand As OdbcCommand
        Dim ConnectionString As String

        ConnectionString = _
           "Driver={Microsoft Access Driver (*.mdb)};" & _
           "Dbq="&Server.MapPath("guideentries.mdb")&";"
        
        myConnection = new Odbc.OdbcConnection(ConnectionString)

        Dim CHeads As OdbcDataAdapter = _
                 New OdbcDataAdapter( _
                     "select * from GuideEntries where parent_id=0 order by listOrder", _
                     myConnection )
        ds = New DataSet()
        CHeads.Fill(ds, "cheads")

        Dim DHeads As OdbcDataAdapter = _
                 New OdbcDataAdapter( _
                      "select * from GuideEntries where parent_id > 0 order by listOrder", _
                      myConnection )
        DHeads.Fill(ds, "dheads")

        ds.Relations.Add("topicRelation", _
                             ds.Tables("cheads").Columns("id"), _
                             ds.Tables("dheads").Columns("parent_id"))

        Dim selectedId As String = Request.QueryString("seqNum")&" "
        if (selectedId = " ")
           selectedId = 0
           openId = 0
        else 
           Dim parentId As String = getParentId(selectedId)
           if (parentId = 0)
              openId = trim(selectedId)
           else
              openId = parentId
           end if
        end if

        CHeadRepeater.DataSource = ds.Tables("cheads")
        CHeadRepeater.DataBind()

        myConnection.Close()
    End Sub
</script> 
...

A couple of things to notice here. First, we have declared two global variables, which will be needed by other functions. One, the DataSet, we've moved from inside the Page_Load subroutine so that we can use it in the getParentId function, which accepts an id value, and uses it to to locate a specific row in the dheads table. If the record exists in that table, it returns the value of the parent_id column. If not, it is assumed to be a main topic, which has a parent_id of 0.

We can then use that function to determine which main node should be open. If the URL for the request contains a main topic ID, then of course that is the topic that should be open. If the URL contains the id of a sub topic, we'll want to use its parent. The actual openId variable is global so we can use it to set the style for each subtopic:

...
          return thisRow("parent_id")
       end if

    end function

    function itemStyle(thisId as String)

       Dim style As String

       if (thisId = openId or getParentId(thisId) = openId) 
          style = "style='display: block'"
       else 
          style = "style='display: none'"
       end if
       return  style

    end function

    Sub Page_Load(Src As Object, E As EventArgs)
        
...         
             <asp:Repeater id="DHeadRepeater" runat="server" 
                datasource='<%# Container.DataItem.Row.GetChildRows("topicRelation") %>'>

                <ItemTemplate>
                   <li class="dhead" <%# itemStyle(Container.DataItem("id")) %>>

                      <img src="/display/common/images/icons/plus.gif" alt="Expand" onclick="toggle(this)" />
                      <a href="/guides/content.asp?g=xml&seqNum=<%# Container.DataItem("id") %>">
                        <%# Container.DataItem("guideEntryTitle") %>
                      </a>
                   </li>

                </itemtemplate>
...

The itemStyle function simply compares the current id (or rather, its parent id) with the openId and provides the appropriate style, which we add to the element using the evaluation block.

If you now display the page without specifying a node to open, it should open with all nodes closed:

 all nodes closed

If you then display the page with a selected node, as in:

http://farmernick.somee.com/guide4.aspx?seqNum=12

 one node open

you can see that node 12, "DOM and Java", is open. But what about we want one of the subtopics? For example, topic 29 is a sub topic of "DOM Level 3". So the URL:

http://farmernick.somee.com/guide4.aspx?seqNum=29

gives us a page like:

 sub node open

because the server first determines the parent node and opens that one. Now all that's left is to make sure that the open node gets the appropriate icon:

...
          return thisRow("parent_id")
       end if

    end function

    function getPlusMinus(thisId As String)
       if (thisId = openId)
         return "minus.gif"
       else
         return "plus.gif"
       end if
    end function

    function itemStyle(thisId as String)

       Dim style As String

...
      <ItemTemplate>
         <li class="chead">
           <img src="/display/common/images/icons/<%# getPlusMinus(Container.DataItem("id"))%>" alt="Expand" onclick="toggle(this)" />
           <span class="cheadT">

...

Subtopics will never be displayed as open to start with, so they always get the plus sign, but in this case the open main topic does get the minus sign.

So now we have a working tree navigational structure, which displays on the page with the appropriate node open, and enables users to open and close other nodes at will.

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.