XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Doug McCallSubject: Schema not found while attempting to validate XML
Author: Doug McCall
Date: 17 Jun 2003 04:20 PM
Hi,

I've got an XML file that I'm attempting to validate against a schema I generated, however, any time I attempt to attach the schema and validate the XML file, it give me an error stating that no schema could be found to validate against. I know that it's seeing the schema 'cause I can load up the schema tab fine, and I've tried lots of different variations of this.

Here's my attributes:

xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:schemaLocation="http://www.mimosa.org/TechXMLV2-2 c:\CRIS%20v2.2%20SQL\Schemas\CRIS%20v2-2\Create%20Reference%20Data%20Schema\CRIS%20Complete%20V2.2%20Data%20Insertion.xsd"

I have no problem at all validating the document with XML Spy, and I can't imagine why SS should be any different.

Any help would be appreciated.

Postnext
Alberto MassariSubject: Schema not found while attempting to validate XML
Author: Alberto Massari
Date: 18 Jun 2003 11:10 AM
Hi Doug,
I tried looking at the MIMOSA web site to retrieve the XML Schema you refer to in your message, but I couldn't find it.
Can you please send it to me?

Without looking at the schema, I can only guess that it only contains type definitions, with no top-level xsd:element declarations. In this case, Stylus would report the message "The XML file doesn't have a schema to validate against" even if it was found and loaded.

Alberto

Postnext
Doug McCallSubject: Schema not found while attempting to validate XML
Author: Doug McCall
Date: 19 Jun 2003 10:33 AM
The link to the schema itself is here:

http://www.mimosa.org/osa-eai/documents/CRIS%20Complete%20V2-2.xsd

This file, however, is not valid by itself and I've been using a modified version that is valid.

I guess my question here would be - why can XML Spy successfully validate my reference data and Stylus Studio can't? This is an important factor that severely affects our decision to purchase your product. Up to this point I've been nothing but pleased :)

Let me know if you come up with anything. Thanks for your help!

Postnext
Alberto MassariSubject: Schema not found while attempting to validate XML
Author: Alberto Massari
Date: 19 Jun 2003 11:35 AM
Hi Doug,
the reason why I asked for the files you are using is precisely that: the schema and the sample files I found on that web site are badly broken, and I cannot guess the path you followed in order to fix them.

For instance, I changed the schema by:
a) changing all the xsd:selector that had an xpath expression starting with "//" so that they start with ".//", as the XMLSchema specs require
b) changing two references to the type varchar254 (inside the complex type definition "work_req_blob_dataTYPE") to remove the "xsd" prefix, as it is defined in the TechXMLV2-2 namespace, not in XML Schema
c) removed the last (duplicate) xsd:field entry in the definition for the xsd:keyref named "model_rec_hyp_ev_FK521"

The problem reported as the item a) is the one that causes the display of the message "there is no schema to validate against", because that error causes the only element definition in the schema to be invalid, and a schema that has no global elements is not usable to perform validation.

You can find the fixed schema attached to this message: let me know if you are able to work with this version.

Alberto


DocumentCRIS Complete V2-2.xsd
The fixed schema

Postnext
Doug McCallSubject: Schema not found while attempting to validate XML
Author: Doug McCall
Date: 23 Jun 2003 09:29 AM
I apologize for you having to go through and clean up that schema. I had already fixed all of the errors you outlined before-hand. I'm attaching the actual schema that I'm using to validate our reference data. This schema is actually being generated off the fixed schema you saw above, so that it can validate our reference data (in which the data is stored in elements, not attributes like the original schema).

If you look at the attached schema, it does validate. I am still getting the same problem, however, when I attempt to validate our reference data against this schema. It still appears as though it cannot load the schema, as all of the errors indicate that it doesn't even look at the schema to validate against. I didn't want to attach our reference data because it's a 13 meg file, and I wasn't sure if there were size limits on these forums.

If you have any more suggestions I would greatly appreciate them, because we're stuck with having to use XML Spy to validate the data when we'd much rather use SS to do it ;)


DocumentCRIS Complete V3b Data Insertion.xsd
Reference Data Schema

Postnext
Alberto MassariSubject: Schema not found while attempting to validate XML
Author: Alberto Massari
Date: 24 Jun 2003 06:11 AM
Hi Doug,
I need to see your reference data, as I am unable to reproduce the behavior you see (schema not loaded).
Can you zip the file and send to my e-mail (amassari@progress.com)?

Thanks,
Alberto

Posttop
Alberto MassariSubject: RE: Validating XML with Schema in Stylus Studio Problem
Author: Alberto Massari
Date: 24 Jun 2003 09:16 AM
Hi Doug,

At 08.24 24/06/2003 -0400, Doug McCall wrote:
>Alberto,
>
>Attached is the zipped XML reference data I was referring to. This is the
>same reference data the MIMOSA organization offers on their site, however
>I used SQL Server XML Web services in order to extract this reference data
>in an XML format that conformed to my Schema.
>
>Again, this does validate using XML Spy, so everything should be
>valid. For some reason, though, this won't validate within Stylus Studio
>(our preferred tool so far).
>
>Let me know what you come up with. Thanks again!

The reference data you sent me has several problems:
1) its xsi:schemaLocation attribute is (as you already wrote in the
original message)
"http://www.mimosa.org/TechXMLV2-2
c:\CRIS%20v2.2%20SQL\Schemas\CRIS%20v2-2\Create%20Reference%20Data%20Schema\CRIS%20Complete%20V2.2%20Data%20Insertion.xsd",
that instructs the parser to look for the file "c:\CRIS v2.2
SQL\Schemas\CRIS v2-2\Create Reference Data Schema\CRIS Complete V2.2 Data
Insertion.xsd". Now, assuming the directory is correct, the schema file you
attached in a previous message is named "CRIS Complete V3b Data
Insertion.xsd" (the version number changes from 2.2 to 3b).
By changing this value to reflect the actual name of the schema file, the
schema is found and Stylus finds one validation error ("Unknown element
mim_cris_v22").

2) the validation error is due to the fact that the reference XML file is
written as there was a default namespace, but it is not declared; this is
fixed by adding a xmlns="http://www.mimosa.org/TechXMLV2-2" attribute to
the root element

3) after fixing the previous error, another validation error occurs,
complaining that the "row" element at line 30 is missing several required
child nodes (reg_auth_user_tag_id, user_tag_id, mobile_yn, site_type_code,
is_template), that must be fixed by either entering the missing data or by
making the tags optional.

Hope this helps,
Alberto


 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.