[xsd-users] Errors obtained when parsing from istringstream

Balasubramanyam, Shivakumar sbalasub at qualcomm.com
Fri Aug 10 04:13:49 EDT 2007


Hi,

 

I have a case where the parsing works fine when I use the file URI but
fails with a lot of error messages specifying the following,

 

 

An runtime exception occurred for all the schemas that was included
using the relative path. 

 

The error is (The primary document entity could not be opened
../<filename>)

 

Any ideas?

 

I read the following from the user manual but could not understand what
and how to specify the resource id as?

 

3.5 Reading from std::istream

When using an std::istream instance, you may also pass an optional
resource id. This id is used to identify the resource (for example in
error messages) as well as to resolve relative paths. For instance:

using std::auto_ptr;

 

{

  std::ifstream ifs ("test.xml");

  auto_ptr<type> r (name (ifs, "test.xml"));

}

 

{

  std::string str ("..."); // Some XML fragment.

  std::istringstream iss (str);

  auto_ptr<type> r (name (iss));

}

 

 

Thanks,

Shiva

 

 

 




More information about the xsd-users mailing list