restriction support?

Jun 1, 2011 at 10:44 AM

Does Xsd2Code support generating code for XSD restrictions?  Specifically, I need support for maxLength and pattern restrictions. 

I have tried generating a couple of classes using the tool but didn't see any way to enable support for these restriction types.

Oct 2, 2012 at 8:30 PM

Hi Craig

i have a similar problem, i have a pattern

  <xsd:simpleType name="FinancialAmt">
    <xsd:restriction base="xsd:string">
      <xsd:pattern value="[0-9.\-]{0,18}" />
    </xsd:restriction>
  </xsd:simpleType>

When i have an XSD element of this type, it simply converted the variable to string without any restrictions

Have you or anyone else been able to fix this?

Oct 3, 2012 at 8:40 AM

Hi Nico,

It works ok for me now.  I wonder if maybe there is an issue with your prefix of 'xsd'?  I have a prefix of 'xs' and pattern restrictions work well.  Just a thought.

Craig