facebook

XML regular expression pattern problem

  1. MyEclipse Archived
  2.  > 
  3. Web Development (HTML, CSS, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #263506 Reply

    greenbird
    Member

    I’m creating XSD files in which various elements have regular expression (RE) pattern restrictions (examples below).
    I created the REs using the “Regular Expressions Wizard” that pops up when adding “Specific constraints values” on the constraints tab of
    the element properties. The wizard shows the REs as valid but when validating XML document using the XSD I get “InvalidRegex:
    Pattern value ‘\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b’ is not a valid regular expression.
    The reported error was: ‘This expression is not supported in the current option setting’.'” on one and “InvalidRegex: Pattern value:
    ‘(\p{Alpha}([\p{Alnum}\-]{0,61}\p{Alnum})?\.)+\p{Alpha}{2,6}’ is not a valid regular expression. The reported error was: ‘Uknown property.’.”
    Any ideas on where to look for resolving this would be appreciated.
    (MyEclipse install info after examples)

    Examples:

    <xs:complexType name=”ipAddressType”>
    <xs:annotation>
    <xs:documentation>
    The IP adress of a computer. IPv6 not supported yet.
    </xs:documentation>
    </xs:annotation>
    <xs:sequence>
    <xs:element name=”ip4Address”>
    <xs:simpleType>
    <xs:restriction base=”xs:string”>
    <xs:pattern
    value=”\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b”>
    </xs:pattern>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name=”simpleComputerNameType”>
    <xs:annotation>
    <xs:documentation>Validation not perfect.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
    <xs:element name=”simpleComputerName”>
    <xs:simpleType>
    <xs:restriction base=”xs:string”>
    <xs:pattern
    value=”\p{Alpha}{1}(([\p{Alnum}\-]{1})*\p{Alnum})?”>
    </xs:pattern>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name=”fullyQualifiedDomainNameType”>
    <xs:sequence>
    <xs:element name=”fullyQualifiedDomainName”>
    <xs:simpleType>
    <xs:restriction base=”xs:string”>
    <xs:pattern
    value=”^(\p{Alpha}([\p{Alnum}\-]{0,61}\p{Alnum})?\.)+\p{Alpha}{2,6}$”>
    </xs:pattern>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name=”computerAddressType”>
    <xs:annotation>
    <xs:documentation>
    The adress of a computer either as simple name, fully
    qualified domain name or an IPv4 address. IPv6 not
    supported yet.
    </xs:documentation>
    </xs:annotation>
    <xs:choice>
    <xs:element name=”ipAddress” type=”ipAddressType” />
    <xs:element name=”simpleName” type=”simpleComputerNameType” />
    <xs:element name=”fullDomainName”
    type=”fullyQualifiedDomainNameType” />
    </xs:choice>
    </xs:complexType>

    *** Date:
    Friday, December 15, 2006 10:34:39 PM CST

    ** System properties:
    OS=Linux
    OS version=2.6.16.21-0.25-smp
    Java version=1.5.0_07

    *** MyEclipse details:
    MyEclipse Enterprise Workbench
    Version: 5.1.0 GA
    Build id: 20061111-5.1.0-GA

    *** Eclipse details:
    Eclipse SDK

    Version: 3.2.1
    Build id: M20060921-0945

    Eclipse Platform

    Version: 3.2.1.r321_v20060921-b_XVA-INSQSyMtx
    Build id: M20060629-1905

    Eclipse Java Development Tools

    Version: 3.2.1.r321_v20060905-R4CM1Znkvre9wC-
    Build id: M20060921-0945

    Eclipse Plug-in Development Environment

    Version: 3.2.1.r321_v20060823-6vYLLdQ3Nk8DrFG
    Build id: M20060921-0945

    Eclipse Project SDK

    Version: 3.2.1.r321_v20060801-tQ1w49KnTArT0FZ
    Build id: M20060921-0945

    Eclipse RCP

    Version: 3.2.1.r321_v20060801-2ekW2BxmcpPUOoq
    Build id: M20060629-1905

    Eclipse Graphical Editing Framework

    Version: 3.2.1.v20060921
    Build id: 20060921-1617

    Eclipse startup command=-os
    linux
    -ws
    gtk
    -arch
    x86_64
    -launcher
    /home/albright/apps/devl/ide/eclipse-3.2_x86_64/eclipse
    -name
    Eclipse
    -showsplash
    600
    -exitdata
    5228025
    -vm
    /usr/bin/java

    #263756 Reply

    Riyad Kalla
    Member

    Greenbird, can you copy and paste the entire file here for me, or PM it to me with a link to this thread so I know why I’m getting it and I’ll have a look?

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: XML regular expression pattern problem

You must be logged in to post in the forum log in