Hi
I have this problem which might be a dumb thing after all, but I would
really appreciate any help available.
I'm using Xerces 2.1.0 and my instance document is using a schema which
imports it's types from another schema, simple hah?
That's what I thought, but unfortunately I get the following error:

An exception occurred! Type:RuntimeException, Message:Warning: The primary
document entity could not be opened. Id=

As you can see the Id is empty, so I tried to override the EntityResolver
and noticed the systemId is really empty.
This only happens with <import>, since when I embed the types in the first
schema instead of importing them - everything's fine.
Btw: XMLSpy says everything's alright.
I'm attaching a short fragment of the schemas (they are much longer), but it
should produce the same behavior:

The main schema:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.screenpeaks.com/schema/generic";
xmlns:xs="http://www.w3.org/2001/XMLSchema";
xmlns:gt="http://www.screenpeaks.com/schema/genericTypes";
xmlns="http://www.screenpeaks.com/schema/generic";
elementFormDefault="qualified">
        <xs:import
namespace="http://www.screenpeaks.com/schema/genericTypes";
schemaLocation="GenericTypes.xsd"/>
        <xs:element name="VICData">
                <xs:complexType>
                        <xs:choice maxOccurs="unbounded">
                                <xs:element ref="Frames"/>
                        </xs:choice>
                </xs:complexType>
        </xs:element>
        <xs:element name="Frames">
                <xs:complexType>
                        <xs:sequence>
                                <xs:element ref="Frame"
maxOccurs="unbounded"/>
                        </xs:sequence>
                </xs:complexType>
        </xs:element>
        <xs:element name="Frame">
                <xs:complexType>
                        <xs:sequence maxOccurs="unbounded">
                                <xs:choice>
                                        <xs:element ref="Text"/>
                                </xs:choice>
                        </xs:sequence>
                </xs:complexType>
        </xs:element>
        <xs:element name="Frame">
                <xs:complexType>
                        <xs:sequence maxOccurs="unbounded">
                                <xs:choice>
                                        <xs:element ref="Text"/>
                                </xs:choice>
                        </xs:sequence>
                </xs:complexType>
        </xs:element>
        <xs:element name="Text">
                <xs:complexType mixed="true">
                        <xs:attribute name="Font" type="gt:font"
use="optional" default="Arial"/>
                        <xs:attribute name="Left" type="gt:xCoord"
use="required"/>
                        <xs:attribute name="Top" type="gt:yCoord"
use="required"/>
                        <xs:attribute name="Right" type="gt:xCoord"
use="required"/>
                        <xs:attribute name="Bottom" type="gt:yCoord"
use="required"/>
                        <xs:attribute name="Size" type="gt:fontSize"
use="optional" default="26"/>
                        <xs:attribute name="Color" type="gt:color"
use="optional" default="000000"/>
                </xs:complexType>
        </xs:element>
</xs:schema>

The imported types:
<?xml version="1.0" encoding="UTF-8"?>
<!-- VIC-TV ver 2.0 -->
<!-- All rights reserved to Screenpeaks Ltd. 2002 -->
<xs:schema targetNamespace="http://www.screenpeaks.com/schema/genericTypes";
xmlns="http://www.screenpeaks.com/schema/genericTypes";
xmlns:xs="http://www.w3.org/2001/XMLSchema"; elementFormDefault="unqualified"
attributeFormDefault="unqualified">
        <!-- Types -->
        <xs:simpleType name="font">
                <xs:restriction base="xs:string">
                        <xs:minLength value="1"/>
                </xs:restriction>
        </xs:simpleType>
        <xs:simpleType name="fontSize">
                <xs:restriction base="xs:unsignedInt">
                        <xs:minInclusive value="26"/>
                </xs:restriction>
        </xs:simpleType>
        <xs:simpleType name="yCoord">
                <xs:restriction base="xs:unsignedInt">
                        <xs:minInclusive value="0"/>
                        <xs:maxInclusive value="575"/>
                </xs:restriction>
        </xs:simpleType>
        <xs:simpleType name="xCoord">
                <xs:restriction base="xs:unsignedInt">
                        <xs:minInclusive value="0"/>
                        <xs:maxInclusive value="719"/>
                </xs:restriction>
        </xs:simpleType>
        <xs:simpleType name="color">
                <xs:restriction base="xs:string">
                        <xs:pattern value="([A-F]|[a-f]|\d){6}"/>
                </xs:restriction>
        </xs:simpleType>
</xs:schema>

The xml document:
<?xml version="1.0" encoding="UTF-8"?>
<VICData xmlns="http://www.screenpeaks.com/schema/generic";>
        <Frames>
                <Frame>
                        <Text Left="100" Top="100" Right="500"
Bottom="500">mumu</Text>
                </Frame>
        </Frames>
</VICData>

(The schema location for the namespaces is set inside the code).
What's going on here?

Cheers
Dvir Ofek
Software Engineer
Screenpeaks Ltd.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to