Posted 11 years ago by Luciano Furlan
Version: 4.0.0277
Avatar
If I have a type restricted by enumeration intellisense correctly suggests the possible choices in a dropdown.
Now I have a type in my XML schema which is restricted by an enumeration and also by a pattern (union).
It means that mostly I use the enumeration values, but sometimes I have to write something different.
In the second case intellisense does not open a dropdown.
I think it would be usefull to have the enumeration choices in a dropdown also in this case.
Is it possible?

<xs:simpleType name="TypeForExistsEnumeration">
<xs:restriction base="xs:string" >
<xs:enumeration value="T"/>
<xs:enumeration value="F"/>
<xs:enumeration value="[r_Show]"/>
<xs:enumeration value="[r_Edit]"/>
<xs:enumeration value="[r_New]"/>
<xs:enumeration value="[r_Edit,r_New]"/>
<xs:enumeration value="[r_Auth]"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="TypeForExistsOther">
<xs:restriction base="xs:string" >
<xs:pattern value="[A-Za-z0-9_/\.,]+"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="TypeForExists">
<xs:union memberTypes="TypeForExistsEnumeration TypeForExistsOther"/>
</xs:simpleType>
<xs:attribute name="Exists" default="T" type="TypeForExists" />

Comments (5)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Luciano,

Could you put together a complete very simple XSD file and a sample XML file we could load into our XML Reflection QuickStart and see exactly what you are looking for? That would help a lot. Just email it over to our support address. Thanks!


Actipro Software Support

Posted 11 years ago by Luciano Furlan
Avatar

<?xml version="1.0" encoding="utf-8"?>
<xs:schema  attributeFormDefault="unqualified"
            elementFormDefault="qualified"
            xmlns:xs="http://www.w3.org/2001/XMLSchema"
            >

    <xs:simpleType name="TypeForExistsEnumeration">
        <xs:restriction base="xs:string" >
            <xs:enumeration value="YES"/>
            <xs:enumeration value="NO"/>                                    
        </xs:restriction>
    </xs:simpleType>
    
    <xs:simpleType name="TypeForExistsOther">
        <xs:restriction base="xs:string" >
            <xs:pattern value="[A-Z]+">            
            </xs:pattern>
        </xs:restriction>
    </xs:simpleType>
    <!--The attribute validates using a union of known values (YES, NO) and unknown values following a pattern ([A-Z]+).-->
    <xs:simpleType name="TypeForExists">
        <xs:union memberTypes="TypeForExistsEnumeration TypeForExistsOther"/>
    </xs:simpleType>
    
    <xs:attribute name="Exists" type="TypeForExists" >        
    </xs:attribute>

    <xs:element name="Button">
        <xs:complexType>
            <xs:attribute ref="Exists" />
        </xs:complexType>
    </xs:element>
    
</xs:schema>
[Modified at 11/07/2008 02:50 AM]
Posted 11 years ago by Luciano Furlan
Avatar

<?xml version="1.0" encoding="utf-8" ?>
<!--Intellisense should open a dropdown for the attribute value with the enumeration values (YES,NO).
We are not limited to enter only this two values, we can also follow the pattern([A-Z]+). -->
<Button Exists="YES"/>
[Modified at 11/07/2008 02:50 AM]
Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Luciano,

Thanks for the sample. Support for this has now been added for the next maintenance release.


Actipro Software Support

Posted 11 years ago by Luciano Furlan
Avatar
You are great.
Thank you.
The latest build of this product (v2020.1 build 0400) was released 28 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.