0

I have a question with an XSD that I am working with.

I have the following block:

          <xs:element name="Artist">
            <xs:simpleType>
              <xs:restriction base="xs:string">
                <xs:length value="0" />
              </xs:restriction>
            </xs:simpleType>
          </xs:element>

I would expect that the string would be limited to 0. However when I use an online sample generator, the string can be of any length.

Could anyone give me some insight as to what is really happening? Does 0 have a special action for xml generation?

Dijkgraaf
  • 11,049
  • 17
  • 42
  • 54
Sean P
  • 949
  • 4
  • 22
  • 41
  • 1
    I would say the sample generator you are using is in error. Using Visual Studio and setting either length or maxLength to 0 has it generating an empty field. – Dijkgraaf Aug 18 '14 at 21:29
  • Odd using XSD2Code it works along with www.xsd2xml.com the following block works: – Sean P Aug 18 '14 at 21:37
  • Is there a reason to believe that the online sample generator you are using is error-free and pays attention to all facets in the declarations of simple types? – C. M. Sperberg-McQueen Aug 19 '14 at 01:18
  • I am not sure what is going on with the samplers I use. I do no that MOST seem to not care. I have made the change regardless. Interesting though. – Sean P Aug 27 '14 at 05:02

0 Answers0