Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Is it possible to validate XML with xinclude using WTP?
Is it possible to validate XML with xinclude using WTP? [message #162518] Tue, 28 February 2006 22:50 Go to next message
Eclipse UserFriend
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>
Re: Is it possible to validate XML with xinclude using WTP? [message #163012 is a reply to message #162518] Tue, 07 March 2006 08:00 Go to previous message
Craig Salter is currently offline Craig SalterFriend
Messages: 169
Registered: July 2009
Senior Member
Currently WTP does not support validation of documents with XInclude. You
may be interested to know that WTP uses Xerces for XML validation. Xerces
DOES support XInclude (see the feature docs [1]). So it's literally just
a line or two of code required to switch that feature on in WTP. Of
course we'd need to test to make sure that change didn't break anything.

Feel free to open a bug to request this enhancement. If you're willing to
sign up to do some testing I'll be happy to make the code change.

[1] http://xerces.apache.org/xerces2-j/features.html
Previous Topic:WTP 1.01 update site install problem
Next Topic:libs are thrown out of classpath
Goto Forum:
  


Current Time: Thu Apr 25 14:57:14 GMT 2024

Powered by FUDForum. Page generated in 0.03715 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top