Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > How To do a Simple Convert of A single-tag HTML To XML?

Reply
Thread Tools

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

 
 
valued customer
Guest
Posts: n/a
 
      07-04-2004
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?
 
Reply With Quote
 
 
 
 
John Bokma
Guest
Posts: n/a
 
      07-05-2004
valued customer wrote:

> 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:

<?xml version="1.0" encoding="ISO-8859-1"?>

> 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>

--
John MexIT: http://johnbokma.com/mexit/
personal page: http://johnbokma.com/
Experienced Perl programmer available: http://castleamber.com/
Happy Customers: http://castleamber.com/testimonials.html
 
Reply With Quote
 
 
 
 
Jürgen Exner
Guest
Posts: n/a
 
      07-05-2004
valued customer wrote:
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to call a simple perl script from HTML without need of HTTPS but simple HTTP ? Wladimir Borsov Perl Misc 4 05-11-2006 09:29 AM
RE: Convert HTML to XML or Paser HTML Steven Cheng[MSFT] ASP .Net 3 02-12-2004 07:15 PM
Re: Convert HTML to XML or Paser HTML Q.Z ASP .Net 0 01-13-2004 04:20 PM
Re: Convert HTML to XML or Paser HTML Joerg Jooss ASP .Net 0 01-11-2004 12:23 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57