#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    8
    Rep Power
    0

    Embedding HTML in XML


    Hi
    By using the below code we can make text bold by embedding
    HTML in XML
    But how can we make same text as flash and how to increase the font size and color by embedding the HTML tags in XML

    <user user_Id="1"
    name="Name1"
    designation="Webdeveloper"
    content=" &lt;b&gt;Hi how are you doing?&lt;/b&gt;" >

    Any help
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2009
    Location
    Jakarta, Indonesia.
    Posts
    218
    Rep Power
    32
    Inside XML, replace "<" with "& l t ;" and ">" with "& g t ;" ?
    Last edited by hdewantara; December 16th, 2012 at 01:17 AM.
  4. #3
  5. Code Monkey V. 0.9
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Mar 2005
    Location
    A Land Down Under
    Posts
    2,136
    Rep Power
    1990
    The proper, and best, way to do it requires you to change your structure slightly so that the "content" value is the content between the <user> and </user> tags. This will let you use CDATA to enclose the HTML values so that you're guaranteed that there's no issues.

    Code:
    <user user_Id="1"
    name="Name1"
    designation="Webdeveloper">
      <![CDATA[<b>Hi how are you doing?</b>]]>
    </user>
    Using <![CDATA[ and ]]> basically tells the XML parser that everything inside this area is to be used exactly as it's written.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Location
    San Jose
    Posts
    9
    Rep Power
    0
    Try using CDATA, a CDATA section starts with "<![CDATA[" and ends with "]]>":

IMN logo majestic logo threadwatch logo seochat tools logo