I'm currently working on a project to automate the creation of wix
files. I ran xsd on the wix.xsd to create a wix.cs file. Most of it
seems to be working as expected except for the use of  enums. In
particular the YesNoType:

 

 

In the wix.xsd file:

<xs:simpleType name="YesNoType">

        <xs:annotation><xs:documentation>Values of this type will either
be "yes" or "no".</xs:documentation></xs:annotation>

        <xs:restriction base='xs:NMTOKEN'>

            <xs:enumeration value="no"/>

            <xs:enumeration value="yes"/>

        </xs:restriction>

    </xs:simpleType>

 

In the cs file:

/// <remarks/>

[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42")]

[System.SerializableAttribute()]

[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://schemas.mic
rosoft.com/wix/2006/wi")]

public enum YesNoType {

    

    /// <remarks/>

    no,

    

    /// <remarks/>

    yes,

}

 

I'm able to create the type and set the value though when serializing
the enum never shows. For example IncludeMinimium="yes" would be
omitted, when writing out UpgradeVersion. Someone suggested adding
use="required" to your xs:attribute or xs:element definition 

 

<xs:simpleType name="YesNoType" use="required">

        <xs:annotation><xs:documentation>Values of this type will either
be "yes" or "no".</xs:documentation></xs:annotation>

        <xs:restriction base='xs:NMTOKEN'>

            <xs:enumeration value="no"/>

            <xs:enumeration value="yes"/>

        </xs:restriction>

    </xs:simpleType>

 

 

though if I try this I get:

 

Schema validation warning: The
'http://schemas.microsoft.com/wix/2006/wi:attribu

te' element is not supported in this context. Line 9628, position 2.

Error: Schema c:\program files\microsoft visual studio 8\vc\wix.xsd
could not be validated

 

I've also seen examples like the following:

 

   <attribute name='required' use='optional' default='true'>
    <simpleType>
     <restriction base='string'>
      <enumeration value='true'/>
      <enumeration value='false'/>
     </restriction>
    </simpleType>
   </attribute>

 

Where the use= would be presumably be changed to required. This format
also failed.

 

Any ideas?

 

Norman Lough

Developer

Tel: +44 (0)191 213 5555

DDI: +44 (0)191 2028360

Email: norman.lo...@imass.co.uk

Imass Ltd, Northumbria House, Regent Centre, Gosforth, Newcastle upon
Tyne, NE3 3PX. http://www.imass.co.uk <http://www.imass.co.uk/> 

 

Imass Limited is an Infoterra company, part of EADS Astrium

 

 

Registered in England and Wales No. 2379476

 

- Disclaimer -
The information contained in this e-mail and its attachments is
confidential and intended only for the use of the individual or entity
named above.  If you are not the intended recipient, please do not read,
copy, use or disclose this message or its attachments.  If you have
received this message in error, please notify the sender immediately and
delete or destroy all copies of this message and attachments in all
media.  Any views expressed in this e-mail that do not relate to Imass'
official business may not reflect the views of the company.

 

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to