Sample Fragments Samples are the small bits of examples showing the implementation of MDDL-specific XML. The W3C XML website may be useful (specifically the section on datatypes here: W3C XML datatypes). See also Examples.
Examples showing the use of base types:
Boolean:
true
0
mdBoolean may contain any legal value as defined by the W3C Schema type xsd:boolean.
DateTime:
2001-11-02T16:20:21Z
T16:20:21+02:00
mdDateTime may contain any legal value as defined by the W3C Schema types xsd:date, xsd:dateTime, or xsd:time.
Decimal:
123
-2.46
1.37e2
mdDecimal may contain any legal value as defined by the W3C Schema type xsd:decimal.
Duration:
P1Y3DT6H
mdDuration may contain any legal value as defined by the W3C Schema type xsd:duration. This example specifies a period of 1 year, 3 days, and 6 hours.
Enumeration:
USD
USD
An Enumeration is implemented as an mdString where the values are restricted by the defined scheme. The first example shows the normal shorthand for representing items from controlled vocabularies (in this case one where a default scheme is defined). The second shows the equivalent fully expanded.
NonNegativeDecimal:
839
mdNonNegativeDecimal is an mdDecimal that may only contain values that are 0 or greater.
String:
house
casa
mdString is the container for all text or string based content and is governed by xsd:string. Multiple xml:lang augmented mdString elements can be provided assuming no two mdString elements has the same value for xml:lang. If no language is specified, U.S. English is assumed.
URI:
../../name
Any valid URI (as defined by xsd:anyURI) may be placed inside the element mdURI including XLink or XPointer configurations.
Examples showing the use of Controlled Vocabularies:
<amountOutstanding> <mdDecimal>23.04</mdDecimal> <amountOutstandingType>float<amountOutstandingType> </amountOutstanding>Float is of the value belonging to the controlled vocabulary amountOutstandingType.
<marketIdentifier>
<code scheme="http://mddl.org/ext/scheme/iso10383.xml">
<mdString>XNSE</mdString>
</code>
</marketIdentifier>
The scheme represents a controlled vocabulary for Exchange Names, the value XNSE is obtained from this CV.
Example MDDL Instance documents
This example shows the snapshot of a stock traded during a day on NSE.
= "1.0" = "UTF-8"?="2.5-beta" ="http://www.mddl.org/mddl/2.5-beta"
="http://www.w3.org/2001/XMLSchema-instance" ="http://www.mddl.org/mddl/2.5-beta mddl-2.5-beta.xsd"
2006-09-04
NSEIndia
="http://www.mddl.org/ext/scheme/iso4217-alpha-3.xml"
INR
="http://www.mddl.org/ext/scheme/iso6166.xml"
ACC
= "http://mddl.org/ext/scheme/iso10383.xml"
XNSE
915
925
915920.6trade9196.75
previousClose436994items
This example shows two sequential events reporting the last trade.
="1.0-final"
="http://www.mddl.org/mddl/2001/1.0-final"
2001-11-02T16:47:04Z
Your Data Provider
<
Some Hong Kong Company
="http://www.ypd.net/XML/scheme/ydpSymbols.xml"
HKSE-XC2
../../name
="http://www.ypd.net/XML/scheme/ydpExchanges.xml" >HKSE
HKD
2001-11-01
188.50
2001-11-01T16:20:12Z
188.322001-11-01T16:20:18Z









