[xsd-users] Need help for a Newbie...

Jitendra.Sakhamuri jitendra.sakhamuri at c-mci.com
Fri Mar 2 12:57:37 EST 2007


Hi, 
I am working on a poc for my client.  I have found the xsd library very
useful.  I am trying to do something very trivial here and am running into
issues.  
I have two XSDs. Query.xsd and Universal.xsd.  
Query.xsd imports the Universal.xsd.
Query .xsd is compiled with xsd like xsd cxx-tree query.xsd everything is
great.  
I go to the next step to compile and generate the code for Universal.xsd
which is where I ran into issues.
Here is how my Query.xsd and Universal.xsd looks like.
Any help in this regard is greatly appreciated.

Query.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           elementFormDefault="qualified"
           targetNamespace="http://cbp.com/mfpq"
           xmlns:mpq="http://cbp.com/mfpq"
           xmlns:u="http://niem.gov/niem/universal/0.2">
  <xs:import namespace="http://niem.gov/niem/universal/0.2"
             schemaLocation="universal.xsd"/>
<xs:element name="universalRequest">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="QueryID" type="xs:integer"/>
        <xs:element name="SourceSystemID" type="xs:string"/>
        <xs:element name="User" type="xs:string"/>
        <xs:element name="QueryDate" type="xs:integer"/>
        <xs:element name="QueryTime" type="xs:integer"/>
        <xs:element name="QueryTargets" type="xs:string"/>
        <xs:element name="TimeOut" type="xs:integer"/>
        <xs:element name="RecordLimit" type="xs:integer"/>
        <xs:element ref="u:Person"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

<xs:element name="universalResponse">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="QueryID" type="xs:integer"/>
        <xs:element name="SourceSystemID" type="xs:string"/>
        <xs:element name="User" type="xs:string"/>
        <xs:element name="ResponseDate" type="xs:integer"/>
        <xs:element name="ResponseTime" type="xs:integer"/>
        <xs:element name="QueryTargets" type="xs:string"/>
        <xs:element name="Result" type="mpq:personDoc" minOccurs="0"
maxOccurs="unbounded"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

          <xs:complexType name="personDoc">
            <xs:sequence>
              <xs:element name="ResultStatus" type="xs:string"/>
              <xs:element ref="u:Document"/>
              <xs:element ref="u:Person"/>
            </xs:sequence>
          </xs:complexType>
</xs:schema>






Universal.xsd
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
elementFormDefault="qualified" 
targetNamespace="http://niem.gov/niem/universal/0.2" 
xmlns:u="http://niem.gov/niem/universal/0.2">
  <!--<xs:import namespace="http://niem.gov/niem/universal/0.2"
schemaLocation="u."/> -->
  <xs:element name="Document">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="u:DocumentID"/>
		<xs:element ref="u:DocumentLocation"/>
        <xs:element ref="u:DocumentSummaryText"/>
        <xs:element ref="u:DocumentTypeText"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="DocumentID">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="u:IDIssuingAuthorityText"/>
        <xs:element ref="u:ID"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="IDIssuingAuthorityText" type="xs:string"/>
  <xs:element name="ID" type="xs:integer"/>
  <xs:element name="DocumentLocation" type="xs:string"/>
  <xs:element name="DocumentSummaryText" type="xs:string"/>
  <xs:element name="DocumentTypeText" type="xs:string"/>
  <xs:element name="Person">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="u:PersonName"/>
        <xs:element ref="u:PersonBirthDate"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="PersonName">
    <xs:complexType>
      <xs:sequence>
        <xs:element ref="u:PersonGivenName"/>
        <xs:element ref="u:PersonSurName"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="PersonGivenName" type="xs:string"/>
  <xs:element name="PersonSurName" type="xs:string"/>
  <xs:element name="PersonBirthDate" type="xs:integer"/>
</xs:schema>

The error I am running into is 
Universal.xsd:5:46: error: unable to map XML Schema namespace
'http:/niem.gov/niem/universal/0.2' to C++ namespace
Thanks

Jitendra.Sakhamuri,
Cell: (202)-297-3057.
EMail: jitendra at c-mci.com
Please visit http://www.c-mci.com
Note:  We respect your online privacy.  This is not an unsolicited mail.
Under Bill s.1618 Title III passed by the 105th US Congress this mail
can not be considered Spam as long as we include contact information and a
method to be removed from our mailing list. If you are not interested in
receiving our e-mails then please reply and write 'REMOVE' 


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.5/707 - Release Date: 3/1/2007
2:43 PM
 




More information about the xsd-users mailing list