[xsd-users] simple tree project
Moreira Andre
Andre.Moreira at helvar.com
Wed May 8 10:03:52 EDT 2013
Hello,
I'm in need of some help processing a simple xml file I want to use.
I've used the hello example as a source and my project is compiling, but... when I run the executable I get an exception thrown in the constructor and the following error:
":0:0 error: unable to open primary document entity 'C:\...\xCurrUser\Debug'"
The xsd I used to generate the source files is this one:
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="CurrentUser">
<xs:complexType>
<xs:sequence>
<xs:element name="Workgroup">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="value"/>
<xs:element type="xs:string" name="default"/>
<xs:element type="xs:string" name="documentation"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DaliDiscoveryType">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="value"/>
<xs:element type="xs:string" name="default"/>
<xs:element type="xs:string" name="documentation"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DaliEnhancedIR">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="value"/>
<xs:element type="xs:string" name="default"/>
<xs:element type="xs:string" name="documentation"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
I'm using visual studio 2008 and in the C++/Tree Mapping Rules I have enabled t6he following properties
-Generate serialization
-Generate Default constructors
My sample xml file looks like this
<?xml version="1.0"?>
<CurrentUser>
<Workgroup>
<value>MyWorkgroup</value>
<default>WORKGROUP</default>
<documentation>some short description</documentation>
</Workgroup>
<DaliDiscoveryType>
<value></value>
<default></default>
<documentation>some short description</documentation>
</DaliDiscoveryType>
<DaliEnhancedIR>
<value></value>
<default></default>
<documentation>some short description</documentation>
</DaliEnhancedIR>
<DaliEnhancedIR>
<value></value>
<default></default>
<documentation>some short description</documentation>
</DaliEnhancedIR>
</CurrentUser>
In my main function, as soon as I call
auto_ptr<CurrentUser> curr_user_profile(CurrentUser_(my_xml_file, xml_schema::flags::dont_validate));
my app breaks.
Both xml and xsd files are on the same directory as the executable.
I need some help here because I have to say I am quite lost on what the problem might be.
Andre Moreira
Software Engineer
www.helvar.com<http://www.helvar.com/>
[Description: helvarFooter]
Lighting Control Systems Hawley Mill, Hawley Road, Dartford, Kent, UK, DA2 7SY
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 13351 bytes
Desc: image001.jpg
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20130508/5aa31c39/image001.jpg
More information about the xsd-users
mailing list