Tutorial Addendum On XML Technologies - XSD Syntax

 31 December 18:00   

    



    



    

Simple XML Elements with Pre-defined Data Types

    



    

Simple XML Element: An XML aspect that has no adolescent elements and attributes.

    

Simple XML elements can be authentic in XSD with the afterward statement:

    

 

    

<xsd:element name ="element_ name " type="xsd:type_ name "/>

    



    



    

where "element_ name " is the name of the XML element, and "type_name" is

    

one of the data blazon names pre-defined in XSD.

    



    

XSD pre-defined data types are disconnected into 7 groups:

    



        

  • Numeric data types


  •     

  • Date and time data types


  •     

  • String data types


  •     

  • Binary data types


  •     

  • Boolean data type


  •     



    



    

Numeric data types: All frequently acclimated accumulation and absolute amount types:

    



        

  • xsd:float


  •     

  • xsd:double


  •     

  • xsd:decimal


  •     

  • xsd:integer


  •     

  • xsd:nonPositiveInteger


  •     

  • xsd:nonNegativeInteger


  •     

  • xsd:negativeInteger


  •     

  • xsd:positiveinteger


  •     

  • xsd:long


  •     

  • xsd:int


  •     

  • xsd:short


  •     

  • xsd:byte


  •     

  • xsd:unsignedLong


  •     

  • xsd:unsignedInt


  •     

  • xsd:unsignedShort


  •     

  • xsd:unsignedByte


  •     



    



    

Date and time data types: Date and time accompanying data types. Constants of date and time

    

types are accounting in the architecture authentic by ISO 8601. For example:

    

"2002-12-23T14:19:00.000-05:00" represents an instance of time at 14:19:00.000 on

    

December 23, 2003, with 5:00 time area adjustment.

    



        

  • xsd:dateTime - Date and time, like "2002-12-23T14:19:00.000-05:00".


  •     

  • xsd:date - Date only, like "2002-12-23".


  •     

  • xsd:time - Time only, like "14:19:00.000-05:00".


  •     

  • xsd:gDay - Day only, like "--23" (the 23rd day of any ages of any year).


  •     

  • xsd:gMonth - Ages only, like "-12" (December of any year).


  •     

  • xsd:gYear - Year only, like "2002".


  •     

  • xsd:gYearMonth - Year and ages only, like "2002-12".


  •     

  • xsd:gMonthDay - Ages and day only, like "-12-23".


  •     

  • xsd:duration - Aeon of time, like "P0001Y02M03DT04H05M06.000S".


  •     



    



    

String data types: Cord accompanying data types.

    



        

  • xsd:string - A arrangement of any Unicode characters


  •     

  • xsd:normalizedString - A cord with no tabs, carrying returns, or band feeds


  •     

  • xsd:token - A normalized cord with no any arch and abaft spaces,

        

    and no assorted after spaces.



  •     



    



    

Binary data types:

    



        

  • xsd:hexBinary - A arrangement of hex digits to represent any bifold data.


  •     

  • xsd:base64Binary - Bifold data accounting in Base64 encoding


  •     



    



    

Boolean data type:

    



        

  • xsd:boolean - With 4 accessible values: 0, 1, true, false.


  •     



    



    

One archetype of using pre-defined XSD data types is in our hello_xsd.xml:

    

 

    

<?xml version="1.0"?>

    

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

    

<xsd:element name="p" type="xsd:string"/>

    

</xsd:schema>

    



    



    

where aspect "p" is authentic to be a simple aspect blazon acceptance adolescent argument node

    

containing data of "xsd:string" type.

    



    

 


Tags: simple, types, month, elements, related, defined, string

 types, element, defined, string, month, binary, elements, simple, , data types, pre defined, element name, < xsd, xsd string, binary data, date and, type xsd, xml element, types xsd, month only like, day only like, related data types, xsd element name, pre defined data,

Share Tutorial Addendum On XML Technologies - XSD Syntax:
Digg it!   Google Bookmarks   Del.icio.us   Yahoo! MyWeb   Furl  Binklist   Reddit!   Stumble Upon   Technorati   Windows Live   Bookmark

Text link code :
Hyper link code:

Also see ...

Permalink
Article In : Computers & Technology  -  xml