Is it possible to validate XML with xinclude using WTP? [message #162518] |
Tue, 28 February 2006 22:50 |
Eclipse User |
|
|
|
Originally posted by: cknalini.gmail.com
Hello,
I am using wtp plug-in for editing and validating schemas and XML files.
We have a need to create a master XML document using xinclude and validate
this against a schema. Validation works very well when I try to create the
XML file with no xinclude elements. However with xinclude, it fails with
an error cvc-complex-type.2.4.a: Invalid content was found starting with
element 'xi:include'. One of '{"":bar}' is expected.
This document validates fine with xerces. I am wondering if I am seeing
this because wtp does not support validation for documents with xinclude
or I am missing some configuration.
I see this with both WTP versions 0.7 and 1.0.1.
Can anyone please help?
Thanks,
Nalini
Samples used for testing xinclude in WTP:
-----------------------------------------
Schema foo.xsd:
---------------
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="foo">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="bar" type="xsd:string"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
foo.xml (without xinclude, validates fine)
------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<foo xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="foo.xsd">
<bar>bar</bar>
</foo>
foo.xml (with xinclude):
------------------------
<?xml version="1.0" encoding="UTF-8"?>
<foo xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="foo.xsd">
<xi:include href="bar.xml"/>
</foo>
bar.xml
-------
<bar>bar</bar>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03715 seconds