5 Replies Latest reply on Sep 20, 2007 4:14 AM by thedex1

    Reading HTML from XML

    thedex1
      Hi, how are all of you?
      I have simple problem. I have an external XML file with the following structure:

      <products>
      <product>
      <id_prd>0</id_prd>
      <title>Absolute-Platinum</title>
      <text>Absolute-Platinum <h3>under</h3> construction</text>
      <image>Absolute Plat top.jpg</image>
      <id_vid>17</id_vid>
      <id_file>0</id_file>
      <icon>Absolute-Plat.jpg</icon>
      </product>
      </products>

      You noticed that <text> </text> contains HTML and this is the place where the problem exist. When I try to read the contents of <text> tag....it displays "<object></object>" and nothing else.
      Any idea, help or advice will be really really appreciated.

      Sincerely,

      Wahab
        • 1. Re: Reading HTML from XML
          zbob99
          I think you will need to replace those "<,>" with special character codes. Not sure what they are at the moment. Just do a google search and you should find it. XML is finicky with stuff like that.
          • 2. Re: Reading HTML from XML
            kcell Level 2
            Try to use a CDATA section around the content of <text>
            • 3. Re: Reading HTML from XML
              thedex1 Level 1
              Hi Kcell,

              Thank you for your help. Yeah it is working by using CDATA but now again I have another problem. It ship to next line as it find any tag. For example, if I have:
              <products>
              <product>
              <id_prd>0</id_prd>
              <title>Absolute-Platinum</title>
              <text>Absolute-Platinum <b>under</b> construction</text>
              <image>Absolute Plat top.jpg</image>
              <id_vid>17</id_vid>
              <id_file>0</id_file>
              <icon>Absolute-Plat.jpg</icon>
              </product>
              </products>

              It will display:

              Absolute-Platinum
              under (in bold)
              construction

              Thanks again for your assistance. I appreciate your help....any idea and help with this issue will again be appreciated...

              Thanks,

              WAHAB
              • 4. Re: Reading HTML from XML
                kcell Level 2
                Hi,

                just one question:

                Which component do you use to display the text?

                I have tried it with the text area and it worked, but i just have set the htmltext with the "Absolute-Platinum <b>under</b> construction" text ...

                best regards.
                kcell
                • 5. Re: Reading HTML from XML
                  thedex1 Level 1
                  Hi,

                  Thank you very much for your reply. It is working now...thanks bundles of thanks...

                  Sincerely,

                  WAHAB