[xsd-users] reading and writing non root elements

Boris Kolpackov boris at codesynthesis.com
Tue Nov 28 12:12:14 EST 2006


Hi Greg,

Greg Carter <greg at permedia.ca> writes:

> OK I got it to work by setting the validate variable to false in the
> parse function.  To get validation back working I've added a call to
> DOMBuilder::setProperty(XMLUni::fgXercesSchemaExternalNoNameSpaceSchemaLocation,
> location), but I can't seem to make Xerces happy with my schema location...
> oh well I should get it eventually.


I am glad you've figured it out. I think your problem with setProperty
comes from the fact that Xerces-C++ treats the location as a relative
path unless it is in the form "file:///absolute/path/to/your/schema.xsd".
You can read more about this in Q 2.4 of the "official" C++/Tree Mapping
FAQ:

http://codesynthesis.com/projects/xsd/documentation/cxx/tree/faq/#2.4


Also note that in order for your XML fragment to be successfully
validated against the schema you will need to declare the fragment's
root element as global in the schema. Only global elements are allowed
to be document roots in XML Schema.


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/20061128/ee816b6e/attachment.pgp


More information about the xsd-users mailing list