BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
Schemas, xsd, xdr
General XSD Limitations
Extracting Schemas for Nested Classes
Creating Schemas from Assemblies
Strongly Typed .NET DataSet
XSD schemaLocation
Selecting Elements in Schemas
Specifying Namespaces
XSD targetNamespace
XSD Schemas
Convert XDR to XSD
Learn XSD Schemas .NET Tutorial
Conversion of genealogical files to XML with a DTD
AccessXML
Sorting by date without using a schema
Validating and enforcing a list of attribute values
Entity name support without DTDs
The Loss of Formatting When Adding a Schema
simple xml notepad
Schemas using DBMS_XMLQuery Package
Tips for Designing a DTD - Part 1 of 4
<< reBlogger
SEO >>

By :Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :03/24/2008
Times viewed :191

 

XSD Schema Mappings

This section shows how we can map specific XML schema constructs to .NET classes with XML serialization attributes. All these mappings are automatically created by the XSD schema definition tool.

Attributes

<xs:element name="foo">

  <xs:complexType>

    <xs:attribute name=”bar” type="xs:string" />

  </xs:complexType>

</xs:element>  

public class foo {

    [XmlAttribute]

    public string bar;

}

Lists

<xs:simpleType name="intlist">

  <xs:list itemType="xs:int" />

</xs:simpleType>

<xs:element name="numbers">

  <xs:complexType>

    <xs:attribute name="numlist"

      type="intlist" />

  </xs:complexType>

</xs:element>    

public class numbers {

  public int[] numlist;

}

Elements

<xs:element name="foo">

  <xs:complexType>

    <xs:sequence>

      <xs:element name=”bar” type="xs:string" />

    </xs:sequence>

  </xs:complexType>

</xs:element>  

public class foo {

    [XmlElement]

    public string bar;

}

Enumerations

<xs:element name="wheels"  

  type="wheels" />

  <xs:simpleType name="wheels">

    <xs:restriction base="xs:string">

      <xs:enumeration

        value="leftfront" />

      <xs:enumeration

        value="rightfront" />

      <xs:enumeration

        value="leftback" />

      <xs:enumeration

       value="rightback" />

    </xs:restriction>

  </xs:simpleType>

</xs:element>

public enum wheels

{

  leftfront,

  rightfront,

  leftback,

  rightback,

}


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

An immediate job opportunity as a B
Software Developers Needed in Charl
Sr. Software Engineer - Analytics
Immediate Mainframe openings for Ch
Immediate TANDEM-TAL openings for C

View all Jobs (Add yours)
View all CV (Add yours)



answering service
help desk support
swimming pool contractor
halloween masks
water softener
Teleconference
Host Department NOLIMIT Web Hosting
MSN
sunglasses


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP