Re: xml comment syntax
Jan Wielemaker <[email protected]> Thu, 7 Aug 2014 21:35:08 +0200
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
On 08/07/2014 09:16 PM, Carlo Capelli wrote:
> Well, really of little importance, but I can't determine if this is really
> an error:
>
> <!--- Replaced so that we have a unionOf construct
> Aug 20 02 MKS, suggestion by R. Volz.
>
> <owl:Class rdf:ID="Fruit">
> <rdfs:subClassOf rdf:resource="#EdibleThing" />
> </owl:Class>
>
> -->
>
> as reported while running thea2 unit tests:
>
> Warning: Unknown file-extension: . Assuming RDF/XML
>
> ERROR: SGML2PL(xmlns):
> http://www.w3.org/TR/2003/PR-owl-guide-20031209/food:869: Illegal comment,
> found "<!---"
>
> % Parsed "http://www.w3.org/TR/2003/PR-owl-guide-20031215/food" in 0.06
> sec; 954 triples
>
>
> wikipedia <http://en.wikipedia.org/wiki/XML#Comments> informal description
> seems suggest that should be valid...
The WikiPedia text is not very explicit. The code is (parser.c in sgml
package)
case S_CMT1: /* <!-- */
{ if ( f[CF_CMT] == chr ) /* <!--- */
{ if ( IS_XML_DIALECT(dtd->dialect) )
gripe(p, ERC_SYNTAX_ERROR, L"Illegal comment", L"<!---");
}
p->state = S_CMT;
return TRUE;
}
It is long ago, but it seems I programmed this quite deliberately (I
think it
should be a warning; the parsing just accepts it as a comment). So, I'll
leave the search for whether or not this is allowed to you :-) And I'll
only accept references from the official XML standard or approved XML
test cases. There are plenty incorrect claims floating on the web ...
Cheers --- Jan