How To do a Simple Convert of A single-tag HTML To XML?

  • Thread starter valued customer
  • Start date
V

valued customer

I have the following HTML code:

<code><b>Être en colère</b></code>

How do I convert that to well-formed XML?

I tried using HTML::Entities, but this does not produce well-formed
XML because it creates undefined entity references.

So how can it be done?
 
J

John Bokma

valued said:
I have the following HTML code:

<code><b>Être en colère</b></code>

How do I convert that to well-formed XML?

use an ISO encoding in your XML, e.g:

I tried using HTML::Entities, but this does not produce well-formed
XML because it creates undefined entity references.

or put those in the DTD.
So how can it be done?

see above. I use the encoding one. If you use XML::Twig, see:
<http://johnbokma.com/mexit/2004/04/22/xmltwiginputfilter.html>
 
J

Jürgen Exner

valued said:
I have the following HTML code:

<code><b>Être en colère</b></code>

How do I convert that to well-formed XML?

This example is well-formed XML
- every opening tag has a corresponding closing tag
- the tags are properly nested
- there is only one root tag
I tried using HTML::Entities, but this does not produce well-formed
XML because it creates undefined entity references.

So how can it be done?

Maybe you have an encoding problem rather then an XML problem?

jue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top