Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > hexBinary minLength Bug or Feature?

Reply
Thread Tools

hexBinary minLength Bug or Feature?

 
 
Don Adams
Guest
Posts: n/a
 
      03-01-2004

I have this defined in my schema:
<xsd:simpleType name="addressType">
<xsd:restriction base="xsd:hexBinary">
<xsd:minLength value="1"/>
<xsd:maxLength value="8"/>
</xsd:restriction>
</xsd:simpleType>

I was hoping this would allow values to be entered
like "00" and "FFFFFFFFFFFFFFFF"; however,
what I'm finding with oXygen and Xerces is that
only values like "0000000000000000" and "FFFFFFFFFFFFFFFF"
are being allowed. In other words, I'm required to type all 16 digits of the
maxLength-sized hex number in order to be valid.

Is this correct behavior for minLength and maxLength of a hexBinary value?
Maybe I'm trying to use hexBinary incorrectly.

--
Don Adams


 
Reply With Quote
 
 
 
 
Don Adams
Guest
Posts: n/a
 
      03-01-2004

I found the problem. I was testing values against minLength
and maxLength that had an odd number of digits. For example, "0"
instead of "00" and "123" instead of "1234". It does work correctly
when the test value has an even number of digits.

I was thinking that hexBinary was a way to enter integers in hex format,
but that isn't quite right. I think I will use this instead:

<xsd:simpleType name="hexstringType">
<xsd:restriction base="xsd:string">
<xsdattern value="[0123456789abcdefABCDEF]*"/>
</xsd:restriction>
</xsd:simpleType>

--
Don


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Encoding IPv4 Address to HexBinary xxyyzz XML 3 06-21-2007 03:36 PM
*bug* *bug* *bug* David Raleigh Arnold Firefox 12 04-02-2007 03:13 AM
ASP.NET Login control bug or SQL 2005 bug? RedEye ASP .Net 2 12-13-2005 10:57 AM
Re: BUG? OR NOT A BUG? John ASP .Net 2 09-21-2005 10:31 AM
Minlength and Maxlength Luigi Donatello Asero HTML 6 02-14-2005 09:32 PM



Advertisments