Cleaning/parsing HTML & XML

Mark Smith lists at futilism.com
Sat Nov 8 21:28:32 EST 2008


Here's a function I've used in parsing the content of xml documents:

function xmlEntities pXmlContent
    replace """ with quote in pXmlContent
    replace "'" with "'" in pXmlContent
    replace "<" with "<" in pXmlContent
    replace ">" with ">" in pXmlContent
    replace "&" with "&" in pXmlContent
    return pXmlContent
end xmlEntities

According to wikipedia (http://en.wikipedia.org/wiki/ 
List_of_XML_and_HTML_character_entity_references)
there are only these 5 to deal with. For html there are 252!

Best,

Mark

On 8 Nov 2008, at 22:30, william humphrey wrote:

> I'm generating my own XML without using the XML functions of RunRev  
> (it's
> faster and I can format exactly how I want it to look). But I would  
> like a
> function for cleaning the text for "&" to & and that kind of  
> thing.
> Any suggestions for such a function? There must be one in RunRev  
> that the
> XML library uses.
>
> Thanks,  Bill
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list