[xsd-users] constructor

Schmilinsky, Remsy Remsy.Schmilinsky at ccra-adrc.gc.ca
Tue Oct 31 11:51:59 EST 2006


Hi. I have the following schema:

<?xml version="1.0" encoding="UTF-8"?>

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:xse="http://www.domain.org/xmlns/xml-schema-extension"
            xmlns:query="http://www.domain.org/query"
            xmlns:cts="http://www.domain.org/contacts"
            targetNamespace="http://www.domain.org/query">
        
    <xsd:import namespace="http://www.domain.org/contacts" schemaLocation="contacts.xsd"/>
       
    <!-- Response, if success, show list of contacts -->
    <!-- matching the query criteria -->
    <xsd:complexType name="queryResponse">
        <xsd:sequence>
            <xsd:element name="message" type="xsd:string"/>
            <xsd:element maxOccurs="1" minOccurs="0" name="catalog" type="cts:catalog"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <!-- root element to hold a queryResponse -->
    <xsd:element name="queryResponse" type="query:queryResponse"/>    
</xsd:schema>

...and I don't understand the generated constructors:

    queryResponse (const message::type&);

    queryResponse (const ::xercesc::DOMElement&,
                   ::xml_schema::flags = 0,
                   ::xml_schema::type* = 0);

    queryResponse (const queryResponse&,
                   ::xml_schema::flags = 0,
                   ::xml_schema::type* = 0);

My test code is this:

        contacts::catalog _catalog;       
        contacts::contact _contact("123456", "name", "email", "888-888-888");
        _catalog.contact().push_back(_contact);

        // ERROR: inappropiate constructor
        query::queryResponse myQueryResponse = query::queryResponse(std::string("message"), _catalog);

can you help me understand how to properly build queryResponse with the available constructors?

thanks,

remsy
        





More information about the xsd-users mailing list