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. Advertising

  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. Advertising

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. Shel Blauman [MSFT]

    Re: feature or bug?

    Shel Blauman [MSFT], Aug 11, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    394
    Shel Blauman [MSFT]
    Aug 11, 2003
  2. Replies:
    14
    Views:
    1,473
  3. Luigi Donatello Asero

    Minlength and Maxlength

    Luigi Donatello Asero, Feb 13, 2005, in forum: HTML
    Replies:
    6
    Views:
    26,499
    Luigi Donatello Asero
    Feb 14, 2005
  4. xxyyzz
    Replies:
    3
    Views:
    1,843
  5. robic0
    Replies:
    7
    Views:
    104
    Samwyse
    Jan 24, 2006
Loading...

Share This Page