1 Reply Latest reply on Sep 9, 2006 6:10 AM by LeftCorner

    XML child 'Title' does not show on web page

      I have imported an XML file and when I launch the page the title does not show.
      The following is on my page but does not display " <td><?xml version="1.0" encoding="UTF-8"?>
      <Title>Miss Congeniality 2: Armed and Fabulous</Title>xx </td>
      The rest of the field do display and I can not understand why 'Title' Does not display.

      Thanks for any help
      David Merchant

      The following is the code to display the data:
      <cfloop index="MyCounter" from="1" to="#Counter#">
      <td>#toString(mydoc.Collection.DVD[MyCounter]["Title"])#xx </td>

      This is the XML file I am reading
      <?xml version="1.0" encoding="us-ascii"?>
      <!-- DVD Profiler Version 2.4.0 Collection Export -->
      <!-- Exported: 9/3/2006 12:39:08 PM -->
      <ProfileTimestamp>2004-03-17 23:58:12</ProfileTimestamp>
      <Title>Doctor Zhivago</Title>
      <SortTitle>Doctor Zhivago</SortTitle>
        • 1. Re: XML child 'Title' does not show on web page
          LeftCorner Level 1
          I believe you want to print the XML node's text to a HTML table cell. To do so you would change:




          Try appending ".XMLText" to your variables.

          I would also consider droping the ToString method with:

          <td>#toString(mydoc.Collection.DVD[MyCounter]["Title"])#xx </td>



          I don't know why you are invoking the toString() function here and not on the other nodes. It only confuses me, and likely you when you have to return to this code later, unless you are trying to do something special with this node, like set your HTML <title> tag.

          If you are trying to set your document's <title> tag then it should belong between the <head> tag of your document and not inside your table, as a matter of semantics.