[Project_owners] html entries in xml declined parsing?

Foreningen Selvet - Jesper Staun Hansen jesper at selvet.dk
Fri Jul 20 07:00:26 PDT 2007


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.



More information about the Project_owners mailing list