OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] xsd : root element not found

[ Lists Home | Date Index | Thread Index ]

Hi Daren,

Your XML file has a root element standaloneArticle from the 
"http://globals.namespace.org"; namespace while your schema defines a 
standaloneArticle element in the 
http://globals.namespace.org/content/xml/xsd/v10/article/single/ (schema 
target namespace) namespace so there is no definition for your root 
element in that schema.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Darren Hall wrote:
> 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>
> 
> 
> 
> -----------------------------------------------------------------
> The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> 
> The list archives are at http://lists.xml.org/archives/xml-dev/
> 
> To subscribe or unsubscribe from this list use the subscription
> manager: <http://www.oasis-open.org/mlmanage/index.php>
> 




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS