IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

unable to load schema Options · View
svensson
Posted: Monday, November 22, 2010 11:00:12 AM
Rank: Newbie

Joined: 11/22/2010
Posts: 6
i have got an issue with xsd file which is importing other xml schemas. following error is shown if the document was opened into XMLSpy (professional, 2011, sp 1):

Unable to load schema with target namespace 'http://www.ech.ch/xmlns/eCH-0058/2' from ''.


here is the basic xsd file header:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:eCH-0058="http://www.ech.ch/xmlns/eCH-0058/2"
xmlns:ssk-common="http://www.steuerkonferenz.ch/xmlns/ssk-common/1" xmlns:ssk-3001-000101="http://www.steuerkonferenz.ch/xmlns/ssk-3001-000101/1"
targetNamespace="http://www.steuerkonferenz.ch/xmlns/ssk-3001-000101/1"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
version="00">
<xs:annotation>
<xs:documentation xml:lang="de">
Steuerausscheidung
</xs:documentation>
</xs:annotation>
<xs:import namespace="http://www.ech.ch/xmlns/eCH-0058/2"/>
<xs:import namespace="http://www.steuerkonferenz.ch/xmln/ssk-common/1"/>


i tried different things for referencing the other xsd files, e.g.:

<xs:import namespace="http://www.ech.ch/xmlns/eCH-0058/2" schemaLocation="eCH-0058-2-0.xsd"/>
<xs:import namespace="http://www.steuerkonferenz.ch/xmlns/ssk-common/1" schemaLocation="ssk-3001-000101.xsd"/>


or in the <xs:schema> element i added following attributes:

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.ech.ch/xmlns/eCH-0058/2/eCH-0058-2-0.xsd"

OR

xsi:schemaLocation="http://www.ech.ch/xmlns/eCH-0058/2 eCH-0058-2-0.xsd"


i would appreciate any hints. thanks
island
Posted: Monday, November 22, 2010 11:16:01 AM
Rank: Newbie

Joined: 10/28/2002
Posts: 1,283
Location: AT
Hi,

Code:


<xs:import namespace="http://www.ech.ch/xmlns/eCH-0058/2" schemaLocation="eCH-0058-2-0.xsd"/>
<xs:import namespace="http://www.steuerkonferenz.ch/xmlns/ssk-common/1" schemaLocation="ssk-3001-000101.xsd"/>



should work if "eCH-0058-2-0.xsd" and "ssk-3001-000101.xsd" are located in the same directory as the schema which imports these.

svensson
Posted: Monday, November 22, 2010 2:09:22 PM
Rank: Newbie

Joined: 11/22/2010
Posts: 6
thanks a lot for your post. your solution is working fine for me. but now, i have got another problem.
i would like to setup these schemas imports centrally. hence, i want to make use of the CustomCatalog.xml file.

following i have defined so far in the CustomCatalog.xml:

<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
<rewriteSystem systemIdStartString="http://www.ech.ch/xmlns/" rewritePrefix="file:///T:/SE/Projekte/A70 Nesko-A/Entwicklung/A70 CH-Meldewesen Steuern/Schemas/sedex/"/>
</catalog>


the path is correct, but XMLSpy is still complaining about being unable to load the schemas.


my basic xsd file import statement looks like that:

<xs:import namespace="http://www.ech.ch/xmlns/eCH-0058/2"/>

i have also tested with:

<xs:import namespace="http://www.ech.ch/xmlns/eCH-0058/2" schemaLocation="http://www.ech.ch/xmlns/eCH-0058/2"/>


hmmm, maybe you can once help me out? thanks.
vlad
Posted: Monday, November 22, 2010 2:44:00 PM
Rank: Advanced Member

Joined: 12/13/2005
Posts: 2,856
Location: Mauritius
Use rewriteURI instead of rewriteSystem, because you are changing a part of the path.
Make sure to always restart XMLSpy after changing catalog.
Make sure to use correct location for CustomCatalog.xml
See existing entries in CoreCatalog.xml for example
svensson
Posted: Monday, November 22, 2010 3:56:24 PM
Rank: Newbie

Joined: 11/22/2010
Posts: 6
that's quite nice. thanks. my CustomCatalog.xml looks as follows:

<?xml version="1.0" encoding="UTF-8"?>
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
<!--<rewriteURI uriStartString="http://www.ech.ch/xmlns/" rewritePrefix="T:/SE/Projekte/A70 Nesko-A/Entwicklung/A70 CH-Meldewesen Steuern/Schemas/sedex/"/>
<rewriteURI uriStartString="http://www.steuerkonferenz.ch/xmlns/" rewritePrefix="T:/SE/Projekte/A70 Nesko-A/Entwicklung/A70 CH-Meldewesen Steuern/Schemas/sedex/"/>-->

<uri name="http://www.steuerkonferenz.ch/xmlns/ssk-common/1" uri="T:/SE/Projekte/A70 Nesko-A/Entwicklung/A70 CH-Meldewesen Steuern/Schemas/sedex/ssk-common/1/ssk-common-1-0.xsd"/>
<uri name="http://www.ech.ch/xmlns/eCH-0007/3" uri="T:/SE/Projekte/A70 Nesko-A/Entwicklung/A70 CH-Meldewesen Steuern/Schemas/sedex/eCH-0007/3/eCH-0007-3-0f.xsd"/>
<uri name="http://www.ech.ch/xmlns/eCH-0010/3" uri="T:/SE/Projekte/A70 Nesko-A/Entwicklung/A70 CH-Meldewesen Steuern/Schemas/sedex/eCH-0010/3/eCH-0010-3-1f.xsd"/>
<uri name="http://www.ech.ch/xmlns/eCH-0011/3" uri="T:/SE/Projekte/A70 Nesko-A/Entwicklung/A70 CH-Meldewesen Steuern/Schemas/sedex/eCH-0011/3/eCH-0011-3-0f.xsd"/>
<uri name="http://www.ech.ch/xmlns/eCH-0006/2" uri="T:/SE/Projekte/A70 Nesko-A/Entwicklung/A70 CH-Meldewesen Steuern/Schemas/sedex/eCH-0006/2/eCH-0006-2-0.xsd"/>
<uri name="http://www.ech.ch/xmlns/eCH-0008/2" uri="T:/SE/Projekte/A70 Nesko-A/Entwicklung/A70 CH-Meldewesen Steuern/Schemas/sedex/eCH-0008/2/eCH-0008-2-0f.xsd"/>
<uri name="http://www.ech.ch/xmlns/eCH-0044/1" uri="T:/SE/Projekte/A70 Nesko-A/Entwicklung/A70 CH-Meldewesen Steuern/Schemas/sedex/eCH-0044/1/eCH-0044-1-0f.xsd"/>
<uri name="http://www.ech.ch/xmlns/eCH-0046/1" uri="T:/SE/Projekte/A70 Nesko-A/Entwicklung/A70 CH-Meldewesen Steuern/Schemas/sedex/eCH-0046/1/eCH-0046-1-0.xsd"/>
<uri name="http://www.ech.ch/xmlns/eCH-0058/2" uri="T:/SE/Projekte/A70 Nesko-A/Entwicklung/A70 CH-Meldewesen Steuern/Schemas/sedex/eCH-0058/2/eCH-0058-2-0.xsd"/>
</catalog>


and it works :-)

now, i'm just looking for a nice way to save a default path in an environment variable as

%DEFAULT_SCHEMAS_PATH%=T:/SE/Projekte/A70 Nesko-A/Entwicklung/A70 CH-Meldewesen Steuern/Schemas/sedex

and afterwards to define a mapping like that:

<uri name="http://www.ech.ch/xmlns/eCH-0058/2" uri="%DEFAULT_SCHEMAS_PATH%/eCH-0058/2/eCH-0058-2-0.xsd"/>


is that possible at all?
svensson
Posted: Thursday, November 25, 2010 1:09:27 AM
Rank: Newbie

Joined: 11/22/2010
Posts: 6
has anybody an idea how to get it run (see above)?
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.