#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Location
    Manchester, UK
    Posts
    80
    Rep Power
    14

    IE specific XML not being displayed


    i've been working on a solution that is specifically intended for deployment with IE 5+ but i'm stumped on a problem.

    i've included some code below. the problem is that i can't see the text within the <suggestions> tags IE is inserting the correct number of table rows when i expand and if i mess with the XML it has an immediate effect when displaying. it's driving me nuts and i'm sure it's something very basic that i'm missing.

    any assistance would be greatly appreciated.

    robert.

    Code:
    <html>
    <head>
    
    <xml id="ge_info">
    <?xml version="1.0" encoding="ISO-8859-1" ?>
      <grammarerrorsummary>
        <generator>Microsoft Word</generator>
        <count>5</count>
        <plural>s</plural>
        <pointer>pointer</pointer>
        <expandicon>[+]</expandicon>
        <expand> Expand list of grammar errors</expand>
        <collapseicon>[-]</collapseicon>
        <collapse> Collapse list of grammar errors</collapse>
      </grammarerrorsummary>
    </xml>
    
    <xml id="ge_list">
    <?xml version="1.0" encoding="ISO-8859-1" ?>
      <grammarerrorlist>
        <suggestion>Some grammartically incowwect text</suggestion>
        <suggestion>Romanus oh nay go</suggestion>
        <suggestion>I just flumped the exam</suggestion>
        <suggestion>Lets just have some text here</suggestion>
        <suggestion>Three</suggestion>
        <suggestion>Two</suggestion>
        <suggestion>One</suggestion>
      </grammarerrorlist>
    </xml>
    
    </head>
    <body>
    
    <table border="1">
    <thead>
      <th style="text-align: left;">
        <span datasrc="#ge_info" datafld="generator"></span>&nbsp;reported&nbsp;<span datasrc="#ge_info" datafld="count"></span>&nbsp;grammar error<span datasrc="#ge_info" datafld="plural"></span><br />
        <!-- expand/collapse -->
        <span id="expand" style="display: inline;"><span datasrc="#ge_info" datafld="expandicon" style="cursor: pointer;" onclick='document.getElementById("collapse").style.display=""; document.getElementById("expand").style.display="none"; document.getElementById("ge_list_visible").style.display="";'></span><span datasrc="#ge_info" datafld="expand"></span></span>
        <span id="collapse" style="display: none;"><span datasrc="#ge_info" datafld="collapseicon" style="cursor: pointer;" onclick='document.getElementById("collapse").style.display="none"; document.getElementById("expand").style.display=""; document.getElementById("ge_list_visible").style.display="none";'></span><span datasrc="#ge_info" datafld="collapse"></span>
    	
      </th>
    </thead>
    <tr>
      <td>
      <table datasrc="#ge_list" border="1" id="ge_list_visible" style="display: none;">
        <tr>
          <td>
            Your text: [<span datasrc="#ge_list" datafld="suggestion" style="color: blue;"></span>]<br />
          </td>
        </tr>
      </table>
      <td>
    </tr>
    </table>
    
    </body>
    </html>
    Robert.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2002
    Location
    UK
    Posts
    59
    Rep Power
    13
    The reason is that you have multiple <suggestion></suggestion> tags. This appears to be causing confusion when accessing them
    though a datasrc/datafld. If you remove them all bar one you will see that it does display the text. I'm not 100% sure
    how to get round this without delving into my XML book which is at home (I'm at work). I'll take a look later.

    Also, your xml is not well formed. There is a missing </span> on line 43 and the last <td> (work up form the bottom
    of the page) should be </td>.
    Torrent
    www.ski-info-online.com

    ...silently carving the soft deep powder...
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2001
    Location
    Manchester, UK
    Posts
    80
    Rep Power
    14
    my XML is not well formed!? my wife will confirm that there has never been anything wrong with my xml

    cheers for spotting the missing </span> and missing slash in the </td>, however the multiple suggestions is valid and IE dynamically generates the correct number of rows for the datafld fields, the problem is that IE is generating the rows, but i get nothing between my quare brackets...

    Robert.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2002
    Location
    UK
    Posts
    59
    Rep Power
    13
    I agree it looks valid. It's just that when you remove four of the <suggestion> tags it does display the text. It kind of suggests that it is unable to pinpoint the exact datafld to display. I tried making the <grammarerrorlist> the datafld but this didn't work either.
    Torrent
    www.ski-info-online.com

    ...silently carving the soft deep powder...

IMN logo majestic logo threadwatch logo seochat tools logo