All,

When dealing with rdf:XMLLiteral's which includes HTML entities such as ’ does preference go to:

  • Including the Entities in a <!DOCTYPE section
  • Double encoding &amp;rsquo;
  • Converting the chars to plain Unicode characters of their numerical form. &#000;

Cheers,

asked 10 Jun '10, 14:43

Nathan's gravatar image

Nathan
43918
accept rate: 5%

I assume you ask how to write such entities in an RDF/XML document?

(10 Jun '10, 21:27) cygri ♦ cygri's gravatar image

To maximise portability, and that includes people round-tripping the data through different syntaxes and/or stores I'd recommend that you use the numeric forms in RDF/XML (and appropriate escaping in other syntaxes).

link

answered 10 Jun '10, 15:48

ldodds's gravatar image

ldodds
1.8k1314
accept rate: 32%

So true. Don't expect characters outside of US-ASCII to live through many transitions from one to another system.

(10 Jun '10, 16:41) cygri ♦ cygri's gravatar image

good answer, cheers

(11 Jun '10, 16:15) Nathan Nathan's gravatar image
-2

XML Literals are supposed to be in exclusive canonical form. If I read correctly that means you ought to do the following:

  • Use the literal character except...
  • in attribute values use &amp; &lt; &quot; &#x9; &#xA; and &#xD; for the relevant character.
  • in text content use &amp; &lt; &gt; &#xD;

So for &rsquo; you should enter '’', the character itself.

Serialisations other than rdf/xml may impose further restrictions. For example in N-Triples you must encode everything beyond US-ASCII, so <span>’</span> would be written as <span>\u2019</span>.

link

answered 10 Jun '10, 21:09

Comment%20Bot's gravatar image

Comment Bot
3.1k49
accept rate: 41%

1

They are supposed to be in canonical form after parsing. This does in no way imply that they should be written in canonical form in RDF/XML. Canonicalization is the RDF/XML parser's job.

(10 Jun '10, 21:23) cygri ♦ cygri's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×852
×13

Asked: 10 Jun '10, 14:43

Seen: 3,077 times

Last updated: 10 Jun '10, 21:09