[Project_owners]   in a RDF datasource file?

Julian Reschke julian.reschke at gmx.de
Thu Apr 20 16:34:49 EDT 2006

Gerald Vogt wrote:
> I want to save some data in a rdf datasource that is written to a local
> file. Everything seems to work fine except for one little problem: one
> literal contains HTML code. It appears correctly encoded in the file, e.g.:
> <p>sample text&nbsp;more text</p>
> appears like
> ... NS1:html="&lt;p&gt;sample text&amp;nbsp;more text&lt;/p&gt;" ...
> However, when I retrieve the literal from the datasource like this:
>   var target = gMojiDS.GetTarget(resource,
>      RDFService.GetResource(MOJI_NS + 'html'), true);
>   target.QueryInterface(Components.interfaces.nsIRDFLiteral);
>   html = target.Value;
> My sample text from above looks like this:
> <p>sample text?more text</p>
> i.e. there is a "?" where should be "&nbsp;". I haven't tested all 
> entities but át least "&gt;" works fine...
> Do I miss something or is this a bug?

Potentially you're looking at that value with a tool that doesn't have a 
glyph for code 160 (which is NBSP), or even can't deal with non-ASCII 
characters at all?

Best regards, Julian

More information about the Project_owners mailing list