0 Replies Latest reply on Apr 20, 2010 11:36 AM by Bill Milhoan

    XML question

    Bill Milhoan

      Hello,

       

      A couple questions relating to the page:

       

      http://academic.csuohio.edu/milhoan_g/windows7/_index2.html

       

      I've hit a snag with my use of XML via Spry Dataset. It might be an XML logic question but I'm not sure. I read somewhere that you cannot use CDATA to allow HTML code in XML when it is being used as a attribute to an element because of the various brackets EVEN if you use the appropriate coding. For instance, this code:

       

      <topic name="New Desktop features">
          <item>Shake &#8212;instantly hides all windows but the top window</item>
          <pic1 path="images/windows7caps/shake1.png" caption="You often find yourself with too many windows open. Shake can make it easier to hide the ones you don't need."/>
          <pic2 path="images/windows7caps/shake2.png" caption="&lt;!&#91;CDATA&#91;&lt;p&gt;To minimize windows using Shake&lt;/p&gt;
              &lt;ol&gt;
              &lt;li&gt;Click the menu bar of the window you want to keep open.&lt;/li&gt;
              &lt;li&gt;Drag (or shake) the window back and forth quickly.&lt;/li&gt;
              &lt;/ol&gt;
              &lt;p&gt;To restore the minimized windows, shake the open window again.&lt;/p&gt;&#93;&#93;>"/>
        </topic>


      ...doesn't work because I have used CDATA and escaped html coding.

       

      However, the XML file validates at http://validator.w3.org! Also, someone in my office said it shouldn't be a problem either so I'm wondering if it is possible to use properly escaped HTML via CDATA as an attribute of an XML element.

       

      If this is not possible, what other options do I have? Each of the topics have images, each of the images have captions and some of the captions must have HTML. Is this my only option?

       

      <topic name="New Desktop features"><item>Shake &#8212;instantly hide all windows but the top window</item>
        <pic1 path="images/windows7caps/shake1.png"/>
        <pic1_caption>You often find yourself with too many windows open. Shake can make it easier to hide the ones you don't need.</pic1_caption>
        <pic2 path="images/windows7caps/shake2.png"/>
        <pic2_caption>&lt;!&#91;CDATA&#91;&lt;p&gt;To minimize windows using Shake&lt;/p&gt;
          &lt;ol&gt;
          &lt;li&gt;Click the menu bar of the window you want to keep open.&lt;/li&gt;
          &lt;li&gt;Drag (or shake) the window back and forth quickly.&lt;/li&gt;
          &lt;/ol&gt;
          &lt;p&gt;To restore the minimized windows, shake the open window again.&lt;/p&gt;&#93;&#93;</pic2_caption>
      </topic>

       

      Seems like a lot of extra stuff.

       

      Any thoughts?

       

      Bill Milhoan