XML Schema Quesions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike Logan

    #1

    XML Schema Quesions

    I am defining an XSD file that will be used for a WSDL import. In my XSD I
    am defining the objects and WS Operation messages. I have a few questions:

    - For interoperabilit y sake, how should objects be named, not including
    messages? Should they be like this "appUser" or "appuser". Is there any
    standards anywhere?

    - Our database has the object defined with underscores and eveything is
    uppercase, i.e. APP_USER. Should we define objects with an underscore?

    - Built-In Types versus SimpleTypes. Let's say I have an object that
    represent a table/object. That field has APP_USER_DESC, that is 50
    characters long. If the type is represented in the XSD like this.

    <xs:complexTy pe name="app_user" >
    <xs:sequence>
    <xs:element name="app_user_ id" type="xs:int" />
    <xs:element name="app_user_ desc" type="xs:string " />
    </xs:sequence>
    </xs:complexType>

    I cannot set the length of the string like this:

    <xs:simpleTyp e name="maxlength 50">
    <xs:restricti on base="xs:string ">
    <xs:maxLength value="50" />
    </xs:restriction>
    </xs:simpleType>
    <xs:complexTy pe name="app_user" >
    <xs:sequence>
    <xs:element name="app_user_ id" type="xs:int" />
    <xs:element name="app_user_ desc" type="maxlength 50" />
    </xs:sequence>
    </xs:complexType>

    My question is this too limiting? I can't stick anything over 50 characters
    in the database but thought I would ask?

    Is there is a guide for this kind of XSD development?

    Thanks,
    --
    Mike Logan
  • Zafar Abbas

    #2
    Re: XML Schema Quesions

    - Naming of elements and types is something that is domain and application
    specific. You will not be able to find a XSD schema guide for that. Just go
    with the convension your database or applications follow, or whatever is
    easier to understand.

    -Your usage of maxLength is correct.

    Zafar

    "Mike Logan" <MikeLogan@comm unity.nospam> wrote in message
    news:995E00D5-5207-4BA6-81AA-40BD802C8307@mi crosoft.com...[color=blue]
    > I am defining an XSD file that will be used for a WSDL import. In my XSD[/color]
    I[color=blue]
    > am defining the objects and WS Operation messages. I have a few[/color]
    questions:[color=blue]
    >
    > - For interoperabilit y sake, how should objects be named, not including
    > messages? Should they be like this "appUser" or "appuser". Is there any
    > standards anywhere?
    >
    > - Our database has the object defined with underscores and eveything is
    > uppercase, i.e. APP_USER. Should we define objects with an underscore?
    >
    > - Built-In Types versus SimpleTypes. Let's say I have an object that
    > represent a table/object. That field has APP_USER_DESC, that is 50
    > characters long. If the type is represented in the XSD like this.
    >
    > <xs:complexTy pe name="app_user" >
    > <xs:sequence>
    > <xs:element name="app_user_ id" type="xs:int" />
    > <xs:element name="app_user_ desc" type="xs:string " />
    > </xs:sequence>
    > </xs:complexType>
    >
    > I cannot set the length of the string like this:
    >
    > <xs:simpleTyp e name="maxlength 50">
    > <xs:restricti on base="xs:string ">
    > <xs:maxLength value="50" />
    > </xs:restriction>
    > </xs:simpleType>
    > <xs:complexTy pe name="app_user" >
    > <xs:sequence>
    > <xs:element name="app_user_ id" type="xs:int" />
    > <xs:element name="app_user_ desc" type="maxlength 50" />
    > </xs:sequence>
    > </xs:complexType>
    >
    > My question is this too limiting? I can't stick anything over 50[/color]
    characters[color=blue]
    > in the database but thought I would ask?
    >
    > Is there is a guide for this kind of XSD development?
    >
    > Thanks,
    > --
    > Mike Logan[/color]


    Comment

    Working...