canmove, Confirmed users
1,567
edits
Line 99: | Line 99: | ||
Because we are only outputting a fragment there is no xml prolog in the string. Additionally there is no declaration of the namespace prefixes used. The only two prefixes that should appear are <code>RDF</code> and <code>em</code>. | Because we are only outputting a fragment there is no xml prolog in the string. Additionally there is no declaration of the namespace prefixes used. The only two prefixes that should appear are <code>RDF</code> and <code>em</code>. | ||
The serialised string is "pretty-printed" xml. This is done for readability in diagnostic situations. Essentially each child tag is indented one level above it's parent tag. The level of indent chosen is 2 spaces. The rules for outputting the rdf as set out in the next section ensure that an element only ever contains character data, or a number of child elements, never both. | The serialised string is "pretty-printed" xml. This is done for readability in diagnostic situations. Essentially each child tag is indented one level above it's parent tag. The level of indent chosen is 2 spaces. The rules for outputting the rdf as set out in the next section ensure that an element only ever contains character data, or a number of child elements, never both. Lines are separated by a single \n character regardless of platform. | ||
If the element contains only character data then it is outputted as a single line with spaces at the start indenting the tag to one level of indent higher than that of the parent element. If the literal data happens to contain newlines then it is still outputted as is, i.e. no attempt to indent the character data is performed. | If the element contains only character data then it is outputted as a single line with spaces at the start indenting the tag to one level of indent higher than that of the parent element. If the literal data happens to contain newlines then it is still outputted as is, i.e. no attempt to indent the character data is performed. |