473,473 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

XInclude

I try to include some xml documents to another one and validate them.
I get 'invalid content starting with element "xi:include".' error message at
pointsample.xml line 6 from xml plugin of jedit which uses xerces lib.
I can't find what is wrong.
Here is my files:
sample.xsd:
<?xml version="1.0"?>
<schema
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:B="http://www.sample.com/Sample"
targetNamespace="http://www.sample.com/Sample"
xmlns:xi="http://www.w3.org/2001/XInclude"
elementFormDefault="qualified">
<element name="point" type="B:Point"/>
<complexType name="Point">
<sequence>
<element name="position" type="B:XYPosition"/>
<element name="colour" type="B:Colour"/>
</sequence>
</complexType>

<complexType name="XYPosition">
<sequence>
<element name="x-position" type="integer"/>
<element name="y-position" type="integer"/>
</sequence>
</complexType>

<complexType name="Colour">
<choice>
<element name="colour-index" type="integer"/>
<element name="absolute-colour" type="string"/>
</choice>
</complexType>

</schema>

position.xml:

<position>
<x-position>5</x-position>
<y-position>5</y-position>
</position>

colour.xml:

<colour>
<colour-index>5</colour-index>
</colour>

pointsample.xml:
<?xml version="1.0" encoding="UTF-8"?>
<point
xmlns="http://www.sample.com/Sample"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sample.com/Sample sample.xsd"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="point.xml"/>
<xi:include href="colour.xml"/>
</point>
Jul 20 '05 #1
1 2607
Check out what the content is you pass to the schema validator.
To me this seems like the includes are not resolved correctly. The
validator checks pointsample.xml 'as it is'.

Cheers Matthias
Erdem Guven wrote:
I try to include some xml documents to another one and validate them.
I get 'invalid content starting with element "xi:include".' error message at
pointsample.xml line 6 from xml plugin of jedit which uses xerces lib.
I can't find what is wrong.
Here is my files:
sample.xsd:
<?xml version="1.0"?>
<schema
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:B="http://www.sample.com/Sample"
targetNamespace="http://www.sample.com/Sample"
xmlns:xi="http://www.w3.org/2001/XInclude"
elementFormDefault="qualified">
<element name="point" type="B:Point"/>
<complexType name="Point">
<sequence>
<element name="position" type="B:XYPosition"/>
<element name="colour" type="B:Colour"/>
</sequence>
</complexType>

<complexType name="XYPosition">
<sequence>
<element name="x-position" type="integer"/>
<element name="y-position" type="integer"/>
</sequence>
</complexType>

<complexType name="Colour">
<choice>
<element name="colour-index" type="integer"/>
<element name="absolute-colour" type="string"/>
</choice>
</complexType>

</schema>

position.xml:

<position>
<x-position>5</x-position>
<y-position>5</y-position>
</position>

colour.xml:

<colour>
<colour-index>5</colour-index>
</colour>

pointsample.xml:
<?xml version="1.0" encoding="UTF-8"?>
<point
xmlns="http://www.sample.com/Sample"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sample.com/Sample sample.xsd"
xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="point.xml"/>
<xi:include href="colour.xml"/>
</point>

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: CB | last post by:
I am using xerces 2.5.0 and xalan 2.6.0, and am following the xinclude instructions on the xerces faq at http://xml.apache.org/xerces2-j/faq-xinclude.html, and I am having no luck. I imagine I...
3
by: rene | last post by:
Hello everybody, i have these 2 xml files ------1.xml------ <?xml version="1.0" encoding="UTF-8"?> <root> <element>1</element> <element>2</element> </root>
1
by: Larry | last post by:
Given the "includer" xml file: <?xml version="1.0"?> <test-includer xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:testns="http://www.w3.org/TR/REC-xml-names"...
9
by: Tjerk Wolterink | last post by:
I have an xml document that conforms to my xschema document. Now i wanted to use xinclude in my xml document. But when i want to validate the xml document to the xschema i get the following...
1
by: Sergey Numerov | last post by:
Of the numerous XML standards, the classes of System.XML support only XPath, XML Schema and DTD. If I want to exploit XLink, XInclude or XQuery, can .NET offer me anything? Are there third-party...
11
by: john fra | last post by:
Hi, I want to include a part of many XML files into an unique XML file with XInclude. Example! File1.xml, File2.xml, File3.xml... seems to that : <?xml version="1.0" encoding="UTF-8"?>
4
by: Tim Arnold | last post by:
I'm using ElementTree to access some xml configuration files, and using the module's xinclude capability. I've got lines like this in the parent xml file (which lives in the same directory as the...
7
by: shaun roe | last post by:
I should like to use xslt to produce a document like the following: <crate xmlns:xi="http://www.w3.org/2001/XInclude"> <rod id="0"> <slot>1</slot> <xi:include...
2
by: McSwell | last post by:
I have an XML file that looks something like this: ------------------------ <?xml ...?> <!DOCTYPE ...> <src:fragment id="foo" ...> <Ph:Itemsome stuff </Ph:Item> <Ph:Itemsome more stuff...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.