[Project_owners] html entries in xml declined parsing?

Ezequiel Calderara ezechico at gmail.com
Fri Jul 20 07:25:16 PDT 2007


you should put it inside a CDATA.
And you could use some encoding method to convert to html entities...

On 7/20/07, Foreningen Selvet - Jesper Staun Hansen <jesper at selvet.dk>
wrote:
>
> I am testing with the following piece of code (shorted down to the roots):
>     var domParser =
> Components.classes["@mozilla.org/xmlextras/domparser;1"]
>
> .createInstance(Components.interfaces.nsIDOMParser);
>
>     var configContents =
> getContents(getConfigFileURI(this.configFile.leafName));
>     var doc = domParser.parseFromString(configContents, "text/xml");
>     var nodes = doc.evaluate("/Letters/Letter", doc, null, 0, null);
>
>     for (var node = null; (node = nodes.iterateNext()); )
>     dump("Contains: "+ node.textContent +"\n");
>
>
> Where the this.configFile.leafName contains:
> <Letters>
>     <Letter>Vias sad sad åasd sad sad asd sad</Letter>
>     <Letter>heh&aring; test</Letter>
>     <Letter>Thanks<br />yes sir</Letter>
> </Letters>
>
>
> If I remove both &aring; and <br /> then it works. What gives about
> this. I cant use < and & it seems. I can use ! ½ § " @ # $ / ( ) +
> ???==> ;;; as tests and they work, but it really dislikes < and &... I
> want & for html entries and just displaying & when they're used in the
> file.
>
>
>
> My best summer regards.
>
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
>



-- 
______
Ezequiel.

Http://www.ironicnet.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/project_owners/attachments/20070720/70c10e58/attachment.html 


More information about the Project_owners mailing list