[oXygen-user] Validating entities?
Radu Coravu
radu_coravu at sync.ro
Thu Sep 1 03:00:36 CDT 2011
Hi Espen,
The TEI P5 document is validated against the RelaxNG schema but the
Xerces parser is used to parse the XML file (and also the associated DTD
infoset).
By default the Xerces parser does not report unknown entity declarations
when it is used to parse an XML file.
To activate this behavior you can modify the XML declaration on top of
the file to set the "standalone" flag like:
> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
If you do not specify the flag the parser will consider the file as
being a possible module and thus does not report the unknown entity
references as errors.
The specs for the "standalone" attribute is here:
> http://www.w3.org/TR/xml/#sec-rmd
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
On 9/1/2011 9:48 AM, Espen S. Ore wrote:
> This is possibly a silly question, please forgive me if that is the case:
>
> We have text files and RelaxNG schemas for them. In addition we point to
> DTD-fragments for defining entities. It seems that validation in Oxygen
> (both 12.x and 13) out-of-the-box does not check to see if entities used
> in the text file are declared or not, that the files are considered
> valid even if they use entity-names that are not used. A typical
> start-of-textfile may look like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE TEI
> [
> <!ENTITY % HIS_entiteter SYSTEM
> 'http://www.edd.uio.no/ibsen/schema/ibsen-charent.dtd'>
> %HIS_entiteter;
> ]>
> <?xml-model href="http://www.edd.uio.no/ibsen/schema/tei_his.rnc"
> type="application/relax-ng-compact-syntax"?>
> <TEI xmlns="http://www.tei-c.org/ns/1.0"
> xmlns:HIS="http://www.example.org/ns/HIS">
> <teiHeader xml:lang="nob">
> <fileDesc>
> <titleStmt>
> <title level="s" type="main">Henrik Ibsens skrifter</title>
> <title level="s" type="sub">Diplomatarisk tekstarkiv</title>
> <title level="a" type="main">Peer Gynt</title>
> <title level="a" type="sub">NBO Ms.8° 894 (trykt eksemplar med
> rettelser)</title>
> <title level="a" type="origYear">[1874]</title>
>
> What can we do to have an error flagged if[ is not declared?
>
> Best regards,
> Espen Ore
> University of Oslo
> _______________________________________________
> oXygen-user mailing list
> oXygen-user at oxygenxml.com
> http://www.oxygenxml.com/mailman/listinfo/oxygen-user
>
More information about the oXygen-user
mailing list