Page 1 of 1
Default schema not validating in eclipse
Posted: Sun Sep 21, 2003 4:32 pm
by gavinm
Eclipse 3.0 M3 Mac OS X oxygen 2.0.4
I select a default schema for code insight (my.dtd) and the validation fails.
If I declare
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="my.dtd"
as attributes of the root element then validation works.

Posted: Mon Sep 22, 2003 1:23 am
by george
Hi,
The default schema for code insight is used for driving the code completion in cases when a schema or a dtd is not specified in a document.
To have a document validated against a schema or a DTD you should specify that schema or DTD in the document. A DTD can be specified using a DOCTYPE declaration, a W3C XML Schema can be specified using xsi:schemaLocation or xsi:noNamespaceSchemaLocation attributes where xsi is mapped to the
http://www.w3.org/2001/XMLSchema-instance namespace. In the Relax NG case there is no specified way to make an association of a document with a Relax NG schema therefore you can either specify it on the validate with Relax NG action dialog or use the oxygen processing instruction.
See below same sample documents.
DTD specification:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE personnel SYSTEM "personal.dtd">
<personnel>
</personnel>
XML Schema specification:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<personnel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation='personal.xsd'>
</personnel>
Relax NG schema specification:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<?oxygen RNGSchema="test/rng/test1.rng" type="xml"?>
<foo>
</foo>
Best Regards,
George