IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Help with XSD field pattern.

  • 1.  Help with XSD field pattern.

    Posted Tue October 04, 2011 11:25 PM

    Hello everyone,

    I need to define a pattern for a field in XSD where it is a string datatype. The total length is 11. It must allow any data which starts with “S” or “s” followed by 10 digits. S and s are optional.

    If they are not sending S or s infront of the number. It must allow the number. Here is what I got but I dont know whether its true or not. Can someone help.

    <xs:element name=“Sample”>
    xs:simpleType
    <xs:restriction base=“xs:string”>
    <xs:pattern value=“[1]?(\d{10})+$”/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>

    Regards,
    David.


    1. Ss ↩︎


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 2.  RE: Help with XSD field pattern.

    Posted Fri October 07, 2011 07:25 PM

    Hello David,
    I never tried doing the field validations in xsd itself(never heard if it can be done that way) but instead if you do it in a branch/sequence step you can use /[1]{1}[1-9]{10}$/ pattern.In your case try using [2]{1}[1-9]{10}$ (with out slashes)

    Thank you,
    Anil


    1. S|s ↩︎

    2. S|s ↩︎


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 3.  RE: Help with XSD field pattern.

    Posted Fri October 07, 2011 09:29 PM

    Thanks Anil for your response.

    I have found a link on google,where we can test the pattern and it is correct.

    Thanks,


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB