Share via

ContactSelector Causes Error when using XSD.EXE

Anonymous
2010-09-13T19:14:13+00:00

I have an InfoPath 2010 form with a ContactSelector.   When I run XSD.EXE on the myschema.xsd file, I get the following error.

>xsd.exe myschema.xsd /c /l:cs

 Microsoft (R) Xml Schemas/DataTypes support utility

 [Microsoft (R) .NET Framework, Version 2.0.50727.42]

 Copyright (C) Microsoft Corporation. All rights reserved.

 Schema validation warning:

 The 'http://schemas.microsoft.com/office/infopath/2007/PartnerControls:Person' element is not declared. Line 15, position 6.

 Warning: Schema could not be validated. Class generation may fail or may produce incorrect results.

 Error: Error generating classes for schema 'myschema'.

   - The element 'http://schemas.microsoft.com/office/infopath/2007/PartnerControls:Person' is missing.

Can anyone help with this. 

There is an BuiltInActiveXControls.xsd file in the same folder, and referenced from mySchema.xsd that looks like it has the correct schema according to this link.

http://msdn.microsoft.com/en-us/library/dd908221(office.12).aspx


James McDowell

Microsoft 365 and Office | Install, redeem, activate | For home | Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Anonymous
    2010-10-01T09:53:14+00:00

    The solution is very simple. Pass the other XSD also as an argument!!

    XSD /c /l:cs  myschema.xsd  BuiltInActiveXControls.xsd

    This works for me without any errors (It generates classes for the pc: elements too)

    Hope this helps!

    Was this answer helpful?

    3 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2012-01-17T21:32:19+00:00

    Yes, it looks like the right way.  When you use the xsd.exe utility, you need to direct it to all the files it needs in order to process the schema.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2010-10-12T08:32:59+00:00

    Thanks vijaynats! It works.

    But is this the right way to tackle this problem?

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2010-09-24T06:22:54+00:00

    Hi James

    I solved by deleting this section 'http://schemas.microsoft.com/office/infopath/2007/PartnerControls:Person' from xsd header, then i merge the content of BuiltInActiveXControls.xsd in this section below into myschema.xsd :

    <xsd:element name="Person">

      <xsd:complexType>

       <xsd:sequence>

        <xsd:element ref="my:DisplayName" minOccurs="0"/>

        <xsd:element ref="my:AccountId" minOccurs="0"/>

        <xsd:element ref="my:AccountType" minOccurs="0"/>

       </xsd:sequence>

      </xsd:complexType>

     </xsd:element>

     <xsd:element name="DisplayName" type="xsd:string"/>

     <xsd:element name="AccountId" type="xsd:string"/>

     <xsd:element name="AccountType" type="xsd:string"/>

    But change tag "<xs>" into "<xsd>" and also change tag "pc:" into "my:", like above.

    Then I put above code below the section :

    <xsd:element name="group_1">

      <xsd:complexType>

       <xsd:sequence>

        <xsd:element ref="my:Person" minOccurs="0" maxOccurs="unbounded"/>

       </xsd:sequence>

      </xsd:complexType>

     </xsd:element>

    So it will becoming like this :

    <xsd:element name="group_1">

      <xsd:complexType>

       <xsd:sequence>

        <xsd:element ref="my:Person" minOccurs="0" maxOccurs="unbounded"/>

       </xsd:sequence>

      </xsd:complexType>

     </xsd:element>

     <xsd:element name="Person">

      <xsd:complexType>

       <xsd:sequence>

        <xsd:element ref="my:DisplayName" minOccurs="0"/>

        <xsd:element ref="my:AccountId" minOccurs="0"/>

        <xsd:element ref="my:AccountType" minOccurs="0"/>

       </xsd:sequence>

      </xsd:complexType>

     </xsd:element>

     <xsd:element name="DisplayName" type="xsd:string"/>

     <xsd:element name="AccountId" type="xsd:string"/>

     <xsd:element name="AccountType" type="xsd:string"/>

    then run xsd myschema.xsd /c. It works for me.

    Thanks

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2010-09-13T20:58:44+00:00

    Same error using newest xsd version 4.0.30319.1


    James McDowell

    Was this answer helpful?

    0 comments No comments