[xsd-users] Re: Loading URLs

Patrick Shinpaugh pshinpaugh at adelphia.net
Tue Oct 31 22:24:07 EST 2006


Hi Boris,
Sorry to have sent the first email directly to you - I replied to a
previous email without looking.

I was able to find the answer to the second question about printing
XMLCh* so please ignore that part. If you could just look at the first
part concerning loading a file file from a url.

Thanks

On Tue, 2006-10-31 at 16:25 -0500, Patrick Shinpaugh wrote:
> Hi,
> 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?
> 
> Also, a non-XSD question if you don't mind. I'm using DOMNodes to access
> my tree and some of the functions I am using have a XMLCh* type
> (getNodeName) - are these wide chars? If so, do you know how I might
> print them?
> 
> Thanks for all of your help,
> Pat
> 
> 
> On Mon, 2006-10-30 at 09:12 +0200, Boris Kolpackov wrote:
> > Hi Patrick,
> > 
> > Patrick Shinpaugh <shpatric at vt.edu> writes:
> > 
> > > Is it possible to directly load an entire xml document using the
> > > generted cxx-tree? It appears as though I would need something similar
> > > to:
> > >
> > >     auto_ptr<text> t (
> > >       text_ (argv[1],
> > >              xml_schema::flags::keep_dom |
> > >              xml_schema::flags::dont_initialize));
> > >
> > > but it is using a specific type whereas my xml (X3D) documents contain a
> > > multitude of different types and there isn't a single base type for
> > > which all others are derived - in the schema at least.
> > 
> > Normally an XML document will have a distinct root element. Some vocabularies
> > have a set of possible root elements. I assume that your case is the latter:
> > you have an X3D document but its root element can be any element from a
> > set of predefined root elements. This is a fairly common scenario and the
> > way to handle this is described in the C++/Tree Mapping Wiki FAQ #2.2[1]
> > 
> > 
> > [1] http://wiki.codesynthesis.com/Tree/FAQ
> > 
> > 
> > hth,
> > -boris




More information about the xsd-users mailing list