12 Replies Latest reply: Feb 19, 2013 1:23 AM by PietjePost RSS

    XML not displaying correctly when larger

    PietjePost

      Hi,

      When my XML dataset exceeds 2350 lines, SpryDOMUtils.js seems to ad a <tab> to the XML string and it's not displayed correctly in it's container.

      I included 2 screenshots to show what's happening. Tnx a lot!!

      screenshots.jpg

        • 1. Re: XML not displaying correctly when larger
          Ben Pleysier CommunityMVP

          Please supply a link to the site

          • 2. Re: XML not displaying correctly when larger
            PietjePost Community Member

            www.warenwelenwee.nl/index.html

            • 3. Re: XML not displaying correctly when larger
              Ben Pleysier CommunityMVP

              There are a couple of irregularities in the markup

              1. Line 12 a stray <br />. This irritates IE

              2. Line 85 the red highlighted quotes are missing

              codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"

              3. Line 91 a stray </embed>

               

              Looking at the raw XML file, there are some irregularities such as extra blank lines (e.g. line 412). I don't think these matter, but it is worthwhile keeping in mind.

               

              On my test server, I added another 150 odd lines to the XML and noticed no problem.

               

              I did, what I usually do, place ALL scripts and links to scripts at the bottom of my document. Don't know if this makes a difference, but again it worked for me.

              • 4. Re: XML not displaying correctly when larger
                Ben Pleysier CommunityMVP

                Forgot to say, the first line in my XML file is always

                <?xml version="1.0" encoding="utf-8"?>

                That may also make a difference.

                • 5. Re: XML not displaying correctly when larger
                  PietjePost Community Member

                  Thank you very much for your advice.

                  I tried everything but it makes no difference.

                  Only some scripts aren't properly compiled when I place them outside the <head>, so I put them back.

                  The <embed> is necessary to display the .swf.

                   

                  You were right it's an IE problem - Chrome and Firefox display ok.

                  I've left it live, so you can see the problem.

                  • 6. Re: XML not displaying correctly when larger
                    Ben Pleysier CommunityMVP

                    Eerst naar bed, het is hier half één 's nachts; ik zal morgen weer kijken.

                     

                    from Down Under

                    • 7. Re: XML not displaying correctly when larger
                      Ben Pleysier CommunityMVP

                      Sorry for the delay, I have spent some time trying to find the culprit. Finally I decided to start afresh with the following markup, which works quite well in all browsers.

                       

                      <!doctype html>
                      <htm>
                      <head>
                      <meta charset="utf-8">
                      <title>Untitled Document</title>
                      <link href="SpryAssets/SpryAccordion.css" rel="stylesheet" type="text/css">
                      </head>
                      
                      <body>
                      <div id="Accordion1" class="Accordion" tabindex="0">
                        <div class="AccordionPanel">
                          <div class="AccordionPanelTab">Label 1</div>
                          <div class="AccordionPanelContent">
                            <div id="div1">
                              <table align="top" cellpadding="5">
                                <tr id="tr1">
                                  <td  valign="top">{datum}</td>
                                  <td valign="top"><a href="{link}">{inhoud}</a></td>
                                </tr>
                              </table>
                            </div>
                          </div>
                        </div>
                        <div class="AccordionPanel">
                          <div class="AccordionPanelTab">Label 2</div>
                          <div class="AccordionPanelContent">Content 2</div>
                        </div>
                      </div>
                      <script src="SpryAssets/SpryAccordion.js"></script> 
                      <script src="SpryAssets/SpryData.js"></script> 
                      <script src="SpryAssets/SpryDOMUtils.js"></script> 
                      <script src="SpryAssets/SpryTooltip.js"></script> 
                      <script src="design_template_info12.js"></script> 
                      <script type="text/javascript">
                      var Accordion1 = new Spry.Widget.Accordion("Accordion1");
                      </script>
                      </body>
                      </html>
                      

                       

                      May I suggest that you copy and paste the markup into a new document to then start adding your own stuff, making sure that you test in IE7 or IE8 at each step.

                       

                      Note that I have left xpath.js out of the markup. I think it will work either way. Just keep an eye on it.

                       

                      PS

                      I did reformat the XML to delete all of the empty lines. Not sure if this helped or not. You can do this within DW as follows

                      _Capture.jpg

                       

                      Message was edited by: Altruistic Gramps

                      • 8. Re: XML not displaying correctly when larger
                        PietjePost Community Member

                        tnx a lot.

                        I'll give it a try tomorrow en let you know.

                        • 9. Re: XML not displaying correctly when larger
                          Preran Employee Hosts

                          Hi PietjePost,

                           

                          Can I mark Altruistic Gramps answer as correct? That will help other users having a similar problem.

                           

                          Thanks,

                          Preran

                          • 10. Re: XML not displaying correctly when larger
                            PietjePost Community Member

                            I can't get it working when arranged like this. Basicaly, when i only want to display the xml data it won't work. In <HTML xmlns:spry="http://ns.adobe.com/spry"> seems necessary - although an error message when validating.

                            played with div tags but that didn't work. the only thing that fixes this poblem is removing 





                            <div style="clear:both;" ></div>

                            but when i do this the div blocks are completelely misplaced in the display. Quite strange that this solves the XML problem.

                            Maybe i"ve messed up something in the code, but i really have no idea.

                            I'll take a closer look at the <div> nesting, maybe that's an issue.

                            • 11. Re: XML not displaying correctly when larger
                              Ben Pleysier CommunityMVP

                              There is no need for the xml name space declaration. The markup that I showed is more than ample when only showing the data within an accordion panel.

                               

                              I would use the above markup as a starting point and build the rest of you document around that.

                              • 12. Re: XML not displaying correctly when larger
                                PietjePost Community Member

                                I did try it several hours in many ways but my page isn't displayed correct that way. the only correct display of the large XML in IE is achieved when removing <div style="clear:both;" ></div>.

                                The workaround is now to cut the xml in 2 seperate datasets. But that doesn't explain why.