Attributes in XSD

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • markmcgookin
    Recognized Expert Contributor
    • Dec 2006
    • 648

    Attributes in XSD

    Hi Folks,

    I am having a problem here, I use a piece of software to create xml based interfaces for an application, and I can bind these interfaces datasource to a dataset that I am currently creating using an xsd schema.

    Not being an xml expert I can not for the life of me figure out a way to create an xsd schema file that has elements of a type (i.e. xs:string) but that also have attributes...

    Ideally I want

    Code:
    <xs:element name="A1203513053788" type="xs:string">
    					<xs:complexType>
    						<xs:attribute name="Section" type="xs:string" />
    						<xs:attribute name="Title" type="xs:string" />
    						<xs:attribute name="IType" type="xs:string" />
    						<xs:attribute name="Ident" type="xs:string" />
    					</xs:complexType>
    				</xs:element>
    Type stuff.. however I know you can not have a type declaration where there is a child node complexType that will declare the type. How can I make this a String or an Int element, but also include attributes in it?

    I can not create nodes using ref="myNodeType " stuff, as the software we are using can't seem to create this join and link up the datatables...

    Any help would be brilliant here...

    Cheers,

    Mark (Moderator/Expert - Mobile Development Forum)
  • markmcgookin
    Recognized Expert Contributor
    • Dec 2006
    • 648

    #2
    Originally posted by markmcgookin
    Hi Folks,

    I am having a problem here, I use a piece of software to create xml based interfaces for an application, and I can bind these interfaces datasource to a dataset that I am currently creating using an xsd schema.

    Not being an xml expert I can not for the life of me figure out a way to create an xsd schema file that has elements of a type (i.e. xs:string) but that also have attributes...

    Ideally I want

    Code:
    <xs:element name="A1203513053788" type="xs:string">
    					<xs:complexType>
    						<xs:attribute name="Section" type="xs:string" />
    						<xs:attribute name="Title" type="xs:string" />
    						<xs:attribute name="IType" type="xs:string" />
    						<xs:attribute name="Ident" type="xs:string" />
    					</xs:complexType>
    				</xs:element>
    Type stuff.. however I know you can not have a type declaration where there is a child node complexType that will declare the type. How can I make this a String or an Int element, but also include attributes in it?

    I can not create nodes using ref="myNodeType " stuff, as the software we are using can't seem to create this join and link up the datatables...

    Any help would be brilliant here...

    Cheers,

    Mark (Moderator/Expert - Mobile Development Forum)
    Also this:

    Code:
    <xs:attribute name="type" type="xs:string" fixed="xs:int" />
    didnt work, I got an error binding an item on the interface to it.. I dont think it can see it's an int

    Comment

    Working...