php xml parsing problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kenatessence
    New Member
    • Nov 2009
    • 2

    php xml parsing problem

    Hello,

    I am working on making a flash site dynamic by using XML. I have already made the flash site read the XML perfectly, but i now have to make a back end where the owner can go in and post new news or edit his articles.

    I put a tinymce on the page and want to basically store HTML inside an XML tag.

    so basically i would have something like
    <article><fon t size="10px">thi s is news</font></article>

    but i dont want the xml parser to see the HTML and think it is XML,
    i would want to get a string like "<font size=\"10px\">t his is news</font>" so flash can draw the text with the formatting.

    To fix this in flash i simply escaped all the <, >, = signs with &lt;, &gt;, and &eq;(i know that one isnt real but for some reason the = was throwing off the parser anyway.)

    I was wondering what the best approach would be to being able to insert/delete/edit the <article> tags and store the HTML information inside the XML tags(phps xml parser doesnt like the &eq; and gives me a problem, but flashs parser doesnt.)

    Thanks alot,
    Ken Koch
    Essence Designs
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    you could wrap your HTML code in a CDATA section (though I don’t know if flash likes that)
    Code:
    <article>
      <[CDATA[
        <span class="font10">this is news</span>
      ]]>
    </article>
    PS. the <font> tags are long deprecated.

    Comment

    • kenatessence
      New Member
      • Nov 2009
      • 2

      #3
      Yea i didnt think of that, ive never used those cdata tags before. Im pretty sure i saw them somewhere in flashs parser, i believe it picks them up as nodes.

      As far as <font> i only used it because it is how tinymce does formatting. Its not too bad because flash is the only place ill be displaying the text and flash renders the font tags fine.

      Thanks alot for the help,
      ken

      Comment

      Working...