?
Solved

Retrieve HTML from XML doc

Posted on 2004-03-27
3
Medium Priority
?
185 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

752 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