09-29-2010 04:52 PM - edited 09-29-2010 05:00 PM
In my XSD file, I have:
<xs:attribute name="bufferSize">
<xs:simpleType>
<xs:restriction base="xs:unsignedInt">
<xs:pattern value="1|2|4|8|16|32|64|128|256"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
In my XML file, I have:
<myElement bufferSize="256"/>
However, when I invoke VI "Load XML File", I find the following parse errors:
Message: Datatype error: Type:InvalidDatatypeValueException, Message:Value '256' does not match regular expression facet '1|2|4|8|16|32|64|128|256'.
I have also tried:
<xs:pattern value="(1)|(2)|(4)|(8)|(16)|(32)|(64)|(128)|(256)"/>
09-29-2010 05:10 PM
I think instead of quotes you should use square braces:
[1|2|4|8|16|32|64|128|256]
Though I'm not too familiar with XML, that is how you would do it with LabVIEW
09-30-2010 04:38 AM
I'm not hip to XML, but I know that your expression will match the 2 in 256 before it matches what you're looking for. You'll need to reverse the order of your regular expression.
09-30-2010 06:24 AM
@jcarmody wrote:
I'm not hip to XML, but I know that your expression will match the 2 in 256 before it matches what you're looking for. You'll need to reverse the order of your regular expression.
Thats a good catch.
Of course Jim would jump all over a regex question ![]()