[xsd-users] Re: Loading URLs

Boris Kolpackov boris at codesynthesis.com
Wed Nov 1 12:37:39 EST 2006


Hi Patrick,

Thanks for resending this to xsd-users.

Patrick Shinpaugh <pshinpaugh at adelphia.net> writes:

> I was actually wrong about the root element but the site was useful. I
> have it working now except for one possible issue. I was expecting to be
> able to pass a url to the root instantiation loader:
>
> auto_ptr<x3d::X3D> inst (x3d::X3D_ (argv[1], xml_schema::flags::keep_dom
> | xml_schema::flags::dont_initialize, props ));
>
> However, it prepends the current working directory:
>
> ./x3d https://someserver/file.x3d
> :0:0 error: An exception occurred! Type:RuntimeException, Message:The
> primary document entity could not be opened.
> Id=/home/patrick/projects/x3dosg/sample_implementation/code_synthesis_xsd/cxx-tree/https://someserver/file.x3d
>
> Any ideas what I may be doing wrong?

XSD does not support HTTPS protocol in URLs (HTTP and FTP are supported if
you build Xerces-C++ with network enabled). You will need to use a third-
party library for HTTPS. Libcurl[1] seems like a good candidate.

You can read the data using the third-party library and then present it
to XSD as either std::istream or xercesc::InputSource. If the file is
not very big you can also read it in as a string and then parse it using
std::istringstream.


[1] http://curl.haxx.se/libcurl/


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/20061101/d6607f6b/attachment.pgp


More information about the xsd-users mailing list