Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Retrieve HTML from XML doc

Posted on 2004-03-27
3
Medium Priority
?
188 Views
Last Modified: 2010-04-06
I hope this easy. I wrote a php code that save HTML tags inside XML file as below:

<DOC>
  <TITLE ID="96001">test</TITLE>
  <PAR ID="96002”>
<!—HTML tags here-- > 
</PAR>
  </DOC>

But the file appear like this

<DOC>
  <TITLE ID="96001">test</TITLE>
  <PAR ID="96002">&lt;ul&gt;&lt;BR&gt;&nbsp; &lt;li&gt;&lt;strong&gt;123456789&lt;/strong&gt;&lt;/li&gt;&lt;BR&gt;&nbsp; &lt;li&gt;&lt;strong&gt;987654321 &lt;/strong&gt;&lt;/li&gt;&lt;BR&gt;&nbsp; &lt;li&gt; &lt;/li&gt;&lt;BR&gt;&lt;/ul&gt;</PAR>
  </DOC>
 and when I print the content of the file it appear like this

<ul><BR>  <li><strong>123456789</strong></li><BR>  <li><strong>987654321 </strong></li><BR>  <li> </li><BR></ul>

which I want but not as a pure tags but I want it formatted like this

·      123456789
·      987654321

Can any one help me.
Thanks in advance  


0
Comment
Question by:ALNMOO
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 10695039
You need to print it from a browser so that the html gets rendered.

Try opening it with Internet Explorer and then printing it.

Cd&

0
 
LVL 7

Author Comment

by:ALNMOO
ID: 10695099
when I print it this what i get in the browser

<ul><BR>  <li><strong>123456789</strong></li><BR>  <li><strong>987654321 </strong></li><BR>  <li> </li><BR></ul>

but I want this

·     123456789
·     987654321

Thank you for your response.
0
 
LVL 15

Accepted Solution

by:
Timbo87 earned 375 total points
ID: 10695471
If you're trying to store HTML inside of XML, you need to put the HTML in CDATA.

<![CDATA[<b>My HTML tags</b>]]>

CDATA starts with <![CDATA[ and ends with ]]>
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question