[
Lists Home |
Date Index |
Thread Index
]
Hi all,
I'm having a quick problem here. I've created a schema document based on an
xml format I'm going to be using. When I try to validate the xml document in
XMLSpy Home, I get a "This file is not valid: The element declaration was
not found for root element 'standaloneArticle'." error.
It seems to me that the path to the xsd file in my xml document is not
correct. I'm doing my document editing on my local file system. On my
desktop I've created a folder called 'xml' and I've put both the xsd and the
xml document in that folder at the same level.
Why can't XMLSpy validate my xml? I don't see what I'm doing wrong here.
Thanks,
Darren
(--relevant code follows--)
[from article.xml]
<?xml version="1.0" encoding="utf-8"?>
<standaloneArticle xmlns="http://globals.namespace.org"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://globals.namespace.org/content/xml/xsd/v10/article
/single/ standaloneArticle.xsd">
<article>
...
</article>
</standaloneArticle>
[from standaloneArticle.xsd]
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema
targetNamespace="http://globals.namespace.org/content/xml/xsd/v10/article/si
ngle/"
xmlns:sar="http://globals.
namespace.org/content/xml/xsd/v10/article/single/"
xmlns:art="http://globals. namespace.org/content/xml/xsd/v10/article/"
xmlns:ref="http://globals. namespace.org/content/xml/xsd/v10/reference/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified"
attributeFormDefault="qualified">
<!-- import of external definitions -->
<xs:import namespace="http://globals.
namespace.org/content/xml/xsd/v10/article/"
schemaLocation="article.xsd"/>
<xs:import namespace="http://globals.
namespace.org/content/xml/xsd/v10/reference/"
schemaLocation="reference.xsd"/>
<!-- definition of complex type elements -->
<xs:element name="standaloneArticle">
...
</xs:element>
</xs:schema>
|