Types in Schema
-
The FieldTypes type works fine in the Visual Studio.NET editor, but for some reason, I can't get the FileExtension type to work. Any ideas?
<xs:simpleType name="FieldTypes">
<xs:restriction base="xs:string">
<xs:enumeration value="Number" />
<xs:enumeration value="String" />
<xs:enumeration value="SSN" />
<xs:enumeration value="Money" />
<xs:enumeration value="Date" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="FileExtension">
<xs:restriction base="xs:string">
<xs:pattern value="\d{2}"/>
</xs:restriction>
</xs:simpleType>Jamie Nordmeyer Portland, Oregon, USA
-
The FieldTypes type works fine in the Visual Studio.NET editor, but for some reason, I can't get the FileExtension type to work. Any ideas?
<xs:simpleType name="FieldTypes">
<xs:restriction base="xs:string">
<xs:enumeration value="Number" />
<xs:enumeration value="String" />
<xs:enumeration value="SSN" />
<xs:enumeration value="Money" />
<xs:enumeration value="Date" />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="FileExtension">
<xs:restriction base="xs:string">
<xs:pattern value="\d{2}"/>
</xs:restriction>
</xs:simpleType>Jamie Nordmeyer Portland, Oregon, USA
The following checks ok for me: How are you defining your namespace? and or can you describe what you mean by not getting it to work? To be conscious that you are ignorant of the facts is a great step towards Knowledge. Benjamin Disraeli
-
The following checks ok for me: How are you defining your namespace? and or can you describe what you mean by not getting it to work? To be conscious that you are ignorant of the facts is a great step towards Knowledge. Benjamin Disraeli
Sorry. I was in a hurry to post this yesterday, as I was on my way out the door. I'm trying to validate that a file extension was correct. The '\d{2}' was just a test; the string I had in there originally was '\.\W{1,4}', which, if I remember correctly, means "a dot, followed by 1 to 4 non-whitespace charectors". My namespace is declared as you have it. In the Visual Studio.NET editor, if I type anything other than an enumeration member for the 'Type' attribute (declared as FieldType), I get the red squiggly line underneath. But the same is not true for an invalid file extension. I don't know. Back to the drawing board, I guess. Jamie Nordmeyer Portland, Oregon, USA
-
Sorry. I was in a hurry to post this yesterday, as I was on my way out the door. I'm trying to validate that a file extension was correct. The '\d{2}' was just a test; the string I had in there originally was '\.\W{1,4}', which, if I remember correctly, means "a dot, followed by 1 to 4 non-whitespace charectors". My namespace is declared as you have it. In the Visual Studio.NET editor, if I type anything other than an enumeration member for the 'Type' attribute (declared as FieldType), I get the red squiggly line underneath. But the same is not true for an invalid file extension. I don't know. Back to the drawing board, I guess. Jamie Nordmeyer Portland, Oregon, USA
Jamie, I really have not done much with patterns. But if I am reading the spec right, you need a small 'w' not a capital 'W'. http://www.w3.org/TR/xmlschema-2/#rf-pattern You have to have a slightly different setup for Visual Studio as mine lets me type anything in with no error checking. To be conscious that you are ignorant of the facts is a great step towards Knowledge. Benjamin Disraeli