hexBinary minLength Bug or Feature?

Discussion in 'XML' started by Don Adams, Mar 1, 2004.

  1. Don Adams

    Don Adams Guest

    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
     
    Don Adams, Mar 1, 2004
    #1
    1. Advertisements

  2. Don Adams

    Don Adams Guest

    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">
    <xsd:pattern value="[0123456789abcdefABCDEF]*"/>
    </xsd:restriction>
    </xsd:simpleType>

    --
    Don
     
    Don Adams, Mar 1, 2004
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    14
    Views:
    1,677
  2. Replies:
    6
    Views:
    2,137
  3. Meelis Lilbok

    Bug or Feature ;)

    Meelis Lilbok, Mar 30, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    548
    Juan T. Llibre
    Mar 30, 2006
  4. Luigi Donatello Asero

    Minlength and Maxlength

    Luigi Donatello Asero, Feb 13, 2005, in forum: HTML
    Replies:
    6
    Views:
    27,813
    Luigi Donatello Asero
    Feb 14, 2005
  5. Jeroen

    Bug or feature?

    Jeroen, Mar 20, 2005, in forum: HTML
    Replies:
    13
    Views:
    855
    Oli Filth
    Mar 21, 2005
  6. tom_usenet
    Replies:
    1
    Views:
    431
    Corno
    Jul 5, 2003
  7. xxyyzz
    Replies:
    3
    Views:
    2,049
  8. robic0
    Replies:
    7
    Views:
    224
    Samwyse
    Jan 24, 2006
Loading...