Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Apr 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question JavaScript RegExp and XML schema patterns

    Hi all!

    I've a little-big question:

    can I use Javascript regexp to validate an XML schema pattern?

    do they have the same syntax? (If I remember they have the PERL regex syntax)...


    In conclusion:
    Can I "copy" a XML schema pattern to a javascript, and use it as regexp?


    I need some experts to answer this question!
    Thank you in advance!

  • #2
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by dakkar
    do they have the same syntax?
    Schema & JS expressions are apparently not identical.
    *this message will self destruct in n-seconds*

  • #3
    New to the CF scene
    Join Date
    Apr 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    uhm... ouch!

    Any idea on how to do this job? :_(

  • #4
    New to the CF scene
    Join Date
    Apr 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well... but... this:

    <?xml version="1.0"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >
    <xs:element name="zips">
    <xs:complexType>
    <xs:sequence maxOccurs="unbounded">
    <xs:element name="zip" type="better-us-zipcode"></xs:element>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:simpleType name="better-us-zipcode">
    <xs:restriction base="xs:string">
    <xsattern value="[0-9]{5}(-[0-9]{4})?"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:schema>

    If I use the above pattern... it works... no?

  • #5
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by dakkar
    Any idea on how to do this job?
    My idea would be to use JS only to run the SOM automation object neeeded to handle the regular expression, and return something... (if that's possible).
    *this message will self destruct in n-seconds*


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •