[xsd-users] Re: problem during validation

Boris Kolpackov boris at codesynthesis.com
Mon Nov 7 04:07:30 EST 2005


Frederic,

frederic heem <frederic.heem at telsey.it> writes:

> Actually, the W3C schema file was missing from the current directory but
> the error message was something different: <LidConf> is not a valid element.

No, the error message is the right one. According to the spec,
schemaLocation attribute is only a hint to the schema processor;
there could be other, ad-hoc, ways to specify schemas. In your
case, schema processor didn't find any schemas for your instance
document and, because by default validation is turned on, told your
that LidConf is not a valid element since it couldn't find a schema
for it.

> Is there a way to specify the location of the schema file ? Something
> different from the current directory of course.

Since you are using a pre-release of 1.6.0 there is a way to specify
schemas programmatically. Check the last argument to parsing functions.
The code snippet that does this looks will look something like this:

  xml_schema::properties prop;

  char cwd[1024];
  if (getcwd (cwd, 1024) == 0)
  {
    std::cerr << "CWD is longer than 1024 bytes" << std::endl;
    return 1;
  }

  prop.no_namespace_schema_location (
    "file://" + std::string (cwd) + "/rss-2_0_1-rev10.xsd");

    std::cout << *rss (argv[1], 0, prop) << std::endl;


This information will also appear in the upcoming FAQ.

hth,
-boris
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20051107/bf61f641/attachment.pgp


More information about the xsd-users mailing list