Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. Types in Schema

Types in Schema

Scheduled Pinned Locked Moved XML / XSL
csharpdatabasevisual-studioregexxml
4 Posts 2 Posters 14 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jamie Nordmeyer
    wrote on last edited by
    #1

    The FieldTypes type works fine in the Visual Studio.NET editor, but for some reason, I can't get the FileExtension type to work. Any ideas?

    <xs:simpleType name="FieldTypes">
    <xs:restriction base="xs:string">
    <xs:enumeration value="Number" />
    <xs:enumeration value="String" />
    <xs:enumeration value="SSN" />
    <xs:enumeration value="Money" />
    <xs:enumeration value="Date" />
    </xs:restriction>
    </xs:simpleType>
    <xs:simpleType name="FileExtension">
    <xs:restriction base="xs:string">
    <xs:pattern value="\d{2}"/>
    </xs:restriction>
    </xs:simpleType>

    Jamie Nordmeyer Portland, Oregon, USA

    M 1 Reply Last reply
    0
    • J Jamie Nordmeyer

      The FieldTypes type works fine in the Visual Studio.NET editor, but for some reason, I can't get the FileExtension type to work. Any ideas?

      <xs:simpleType name="FieldTypes">
      <xs:restriction base="xs:string">
      <xs:enumeration value="Number" />
      <xs:enumeration value="String" />
      <xs:enumeration value="SSN" />
      <xs:enumeration value="Money" />
      <xs:enumeration value="Date" />
      </xs:restriction>
      </xs:simpleType>
      <xs:simpleType name="FileExtension">
      <xs:restriction base="xs:string">
      <xs:pattern value="\d{2}"/>
      </xs:restriction>
      </xs:simpleType>

      Jamie Nordmeyer Portland, Oregon, USA

      M Offline
      M Offline
      Michael A Barnhart
      wrote on last edited by
      #2

      The following checks ok for me: How are you defining your namespace? and or can you describe what you mean by not getting it to work? To be conscious that you are ignorant of the facts is a great step towards Knowledge. Benjamin Disraeli

      J 1 Reply Last reply
      0
      • M Michael A Barnhart

        The following checks ok for me: How are you defining your namespace? and or can you describe what you mean by not getting it to work? To be conscious that you are ignorant of the facts is a great step towards Knowledge. Benjamin Disraeli

        J Offline
        J Offline
        Jamie Nordmeyer
        wrote on last edited by
        #3

        Sorry. I was in a hurry to post this yesterday, as I was on my way out the door. I'm trying to validate that a file extension was correct. The '\d{2}' was just a test; the string I had in there originally was '\.\W{1,4}', which, if I remember correctly, means "a dot, followed by 1 to 4 non-whitespace charectors". My namespace is declared as you have it. In the Visual Studio.NET editor, if I type anything other than an enumeration member for the 'Type' attribute (declared as FieldType), I get the red squiggly line underneath. But the same is not true for an invalid file extension. I don't know. Back to the drawing board, I guess. Jamie Nordmeyer Portland, Oregon, USA

        M 1 Reply Last reply
        0
        • J Jamie Nordmeyer

          Sorry. I was in a hurry to post this yesterday, as I was on my way out the door. I'm trying to validate that a file extension was correct. The '\d{2}' was just a test; the string I had in there originally was '\.\W{1,4}', which, if I remember correctly, means "a dot, followed by 1 to 4 non-whitespace charectors". My namespace is declared as you have it. In the Visual Studio.NET editor, if I type anything other than an enumeration member for the 'Type' attribute (declared as FieldType), I get the red squiggly line underneath. But the same is not true for an invalid file extension. I don't know. Back to the drawing board, I guess. Jamie Nordmeyer Portland, Oregon, USA

          M Offline
          M Offline
          Michael A Barnhart
          wrote on last edited by
          #4

          Jamie, I really have not done much with patterns. But if I am reading the spec right, you need a small 'w' not a capital 'W'. http://www.w3.org/TR/xmlschema-2/#rf-pattern You have to have a slightly different setup for Visual Studio as mine lets me type anything in with no error checking. To be conscious that you are ignorant of the facts is a great step towards Knowledge. Benjamin Disraeli

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups