Title: An Introduction to XML Technologies and Standards for Futures and Options Industry Professionals
1An Introduction to XML Technologies and Standards
for Futures and Options Industry Professionals
- Presented by
- The Futures Industry Association Standards
Working Group - in conjunction with The Fix Protocol Ltd. Global
Derivatives Committee
2Agenda - Morning
- Welcome 900am
- Angela Krug, Deutsche Bank AG
- XML The Crash Course, part 1 905am
- Why XML? Why Now?
- Ed Gogol, Chicago Mercantile Exchange
- What is XML? What is a well defined XML message?
- Jim Northey, The FIX Global Derivatives Committee
- Break 1015am
- XML The Crash Course Part 2 1030am
- How are XML messages defined and validated?
- Jim Northey, The FIX Global Derivatives Committee
- XML The Benefits 1115am
- How are XML Messages accessed from an application
program? - Oren Miller, ThoughtWorks, Inc.
- Accessing XML Messages 1145am
- How are XML messages accessed from application
programs? - Matt Simpson, Chicago Mercantile Exchange
3Agenda - Afternoon
- Lunch 1230pm
- Implementing XML Based Solutions 115pm
- David Li, Chief Architect, New York Mercantile
Exchange - Elliot Napakh, Technical Architect, New York
Mercantile Exchange - Question and answers
- The CME Pilot Project using FIXML 200pm
- Matt Simpson - Chicago Mercantile Exchange
- Questions and answers
- Break 300pm
- What Standards Exist for Derivatives Markets?
315pm - Jim Northey, The FIX Global Derivatives Committee
- Conclude 400pm
4Welcome
- Chicago John Munro
- Senior Vice President Product Development, Rolfe
Nolan - Chairman, FIA Standards Working Group
- New York Angela Krug
- Vice President, Deutsche Bank AG
- Vice Chairman, FIA Standards Working Group
- Thanks to our hosts
- Chicago - The Chicago Board of Trade - Tom McCabe
- New York - Salomon Smith Barney - Mike Mortkowitz
- Why are we here?
- Presenters
- Jim Northey - FIX Protocol Limited
- Matt Simpson - Chicago Mercantile Exchange
- Oren Miller - Thoughtworks, Inc.
- David Li - New York Mercantile Exchange
- Elliot Napakh - New York Mercantile Exchange
5XML The Crash Course
- Ed Gogol,
- Director, Systems Development, Clearing House,
Chicago Mercantile Exchange
Jim Northey Chair, FIX Protocol Ltd. Global
Derivatives Committee
6XML The Crash Course
- Introduction to XML by Ed Gogol
- Why XML? Why Now?
- XML Basics
- Well Formed XML Documents
- Describing XML Documents
- Document Type Definitions
- XML Schema
- Namespaces
- XML Path
7Why XML? Why Now? Advantages
- Technology is easily integrated
- Focus on integration
- Wide adoption across computer vendors
- Ability to interoperate across standards
8What is XML?
Its a Dessert Topping!!
XML
Its A Floor Wax!!
The BEST NEW thing since RDBMS and Objects!!!
9What is XML?
1980s
- History
- Move beyond the closed markup language HTML to
add semantic - eXtensible Markup Language
- Open ended mark up language
- XML is a Meta markup language
- Markup language used to create other markup
languages - Just like HTML uses Tags to organize data
- The tags describe the content of the message
- Self describing data
- Description of the message with the message
provides for considerable flexibility
SGML
1994
HTML
1998
XML
1999
XHTML
http//www.w3.org/XML/1999/XML-in-10-points
10Driving force behind XML
- W3C - World Wide Web Consortium
http//www.w3c.org - founded in October 1994 to lead the World Wide
Web to its full potential by developing common
protocols that promote its evolution and ensure
its interoperability. Today, W3C has over 450
Members and nearly 70 full-time staff around the
world who contribute to the development of W3C
specifications and software. - http//www.w3.org/Consortium/Points/
11HTML - A Closed Markup Language
ltHTMLgt ltHEADgt ltTITLEgtFutures Industry Association
- The FIA is the only association representative
of all organizations that have an interest in the
futures market.lt/TITLEgt lt/HEADgt ltBODY
BGCOLOR"333333" ALINK000000 VLINKE9E7A7
LINKE9E7A7 TOPMARGIN0 LEFTMARGIN0
RIGHTMARGIN0 BOTTOMMARGIN0 MARGINHEIGHT0
MARGINWIDTH0gt ltDIV ALIGN"center"gtltPgtnbspltPgtn
bspltPgt lt!-- START LOGO TABLE --gt ltTABLE
BORDER0 WIDTH770 CELLPADDING0
CELLSPACING0gt ltTR HEIGHT65gt ltTD
ALIGNcentergtltSTRONGgtltFONT SIZE3
COLORffff00gtwww.futuresindustry.orglt/FONTgtlt/STRO
NGgtltBRgtltFONT SIZE5 COLORwhitegtFUTURES INDUSTRY
ASSOCIATIONlt/EMgtlt/FONTgtlt/TDgt lt/TRgt lt/TABLEgt lt!--
END LOGO TABLE --gt ... ltFONT SIZE1
COLOR333333gtThe Futures Industry Association
and the Futures Industry Institute. Futures,
Markets, Volume, CFTC, SEC, Trade, Show, Boca,
Electronic, Trading, Expo, Exhibit, Education,
Optech, Market, Commission, Merchant, Finance,
FCM, Commodities, Commodity, Trading, Advisor,
CTA, Derivatives, Risk, Management, Options,
Hedge, Trading, y2k, FII, FIA, De-regulation,
Regulation, Contract, Specifications, Clearing,
Series, 31, 32, 33, Alternative, Investments,
Ethics, Factbook, Data, Investor,
Managedlt/FONTgt lt/DIVgt lt/BODYgt lt/HTMLgt
12A note on terminology
- In this presentation XML Message and XML
Document are used interchangeably
13Quick Overview on XML
- An XML Document or Message is made up of Elements
- Elements are composed of
- All tags contain a name
- An Opening Tag
- optional attributes
- optional content
- A Closing Tag
- Elements can be empty
- Meaning the Opening Tag can be terminated with a
backslash character - Elements are nested
- Elements can contain other elements containing
other elements . - Forms a tree of information
- White space is ignored with the exception of the
information between the element opening tag and
closing tag
- ltThisIsAn-ElementNamegt this is the data
- for this element
- lt/ThisIsAn-ElementNamegt
- ltAnEmpty_ElementLooksLikeThis/gt
- ltAnyOldElementgt
- ltAnyOldNestedElementHeregt
- ltAnotherElementgt
- lt/AnotherElementgt
- lt/AnyOldNestedElementHeregt
- lt/AnyOldElementgt
- ltRejectReasongtCustomer Unknownlt/RejectReasongt
- ltRejectReasongtCustomer Unknownlt/RejectReasongt
14Well Formed XML Messages
- There are only a handful of rules that need to be
followed to create XML messages - XML messages that follow the simple rules are
considered to be
Well Formed XML Messages
Well Formed Messages are good
A Well Formed XML document is not to be confused
with a Valid XML document
15Anatomy of an XML Message
XML Declaration
lt?xml version'1.0'?gt ltFIXMLgt ltFIXMLMessagegt
ltApplicationMessagegt ltOrdergt
ltClOrdIDgt12345lt/ClOrdIDgt ltHandlInst
Value"1"/gt ltInstrumentgt
ltSecuritygt ltSymbolgtEKlt/Symbolgt
lt/Securitygt lt/Instrumentgt
ltSide Value"1"/gt ltOrderQuantitygt
ltOrderQtygt10000lt/OrderQtygt
lt/OrderQuantitygt ltOrderTypegt
ltMarketOrder OrdType"1"/gt lt/OrderTypegt
ltCurrency Value"USD"/gt lt/Ordergt
lt/ApplicationMessagegt lt/FIXMLMessagegt lt/FIXMLgt
Root Element
Empty Tag
Opening Tag
Attribute Value
Value
Element
Attribute
Closing Tag
Nested Elements
Whats This?
16XML Declaration
- First line in XML document
- Delimited by lt? and ?gt
- Three properties that you can set
- version
- Always use this property
- There is only one version now 1.0
- encoding
- Use if you require support of an alternative
character set - Usually not needed
- Default character set is UTF-8, which is the
ASCII part of Unicode - standalone
- Use this property to tell an XML processor if
there are other files required to process this
XML document - Valid values yes or no
17XML Declaration Examples
Which of the following are well-formed?
_____ lt?xml version1.0 ?gt _____ lt?xml
version1.0 ?gt _____ lt?xml version1.0
?gt _____ lt?xml version 1.0 ?gt _____ lt?xml
version ?gt _____ lt?xml version1gt _____ lt?xml
version1.0 encodingUSASCII ?gt _____ lt?xml
version1.0 encodingUTF-8?gt _____ lt?xml
version1.0 standaloneyes ?gt _____ lt?xml
version1.0 encodingUTF-8 standaloneno
?gt _____ lt?xml version1.0 encodingUTF-8
standaloneNO ?gt
18XML Declaration Examples
Which of the following are well-formed?
_____ lt?xml version1.0 ?gt _____ lt?xml
version1.0 ?gt _____ lt?xml version1.0
?gt _____ lt?xml version 1.0 ?gt _____ lt?xml
version ?gt _____ lt?xml version1gt _____ lt?xml
version1.0 encodingUSASCII ?gt _____ lt?xml
version1.0 encodingUTF-8?gt _____ lt?xml
version1.0 standaloneyes ?gt _____ lt?xml
version1.0 encodingUTF-8 standaloneno
?gt _____ lt?xml version1.0 encodingUTF-8
standaloneNO ?gt
19Elements
- Have an Opening Tag and a Closing Tag
- XML Elements are nested - into a tree structure
- The outer most (top level) element is called the
Root Element - Content for the element is contained between the
Opening Tag and the Closing Tag - Tag names (element names)
- cannot have embedded spaces or punctuation
characters other than - and _ - are case sensitive
lt?xml version'1.0' encoding "UTF-8"
standalone 'no' ?gt ltour_root_elementgt
ltour_main_element/gt ltelement-names-can-be-very-l
ong-indeed-as-this-one-is-here_notice-that_hyphens
-and_underscores_workgt lt/element-names-can-be-very
-long-indeed-as-this-one-is-here_notice-that_hyphe
ns-and_underscores_workgt lt/our_root_elementgt
20Element Examples
Which of the following are well-formed?
_____ ltThis isAWellFormedElementgtltThis
isAWellFormedElementgt _____ ltIsThis-WellFormed__?
gtdata herelt/IsThis-WellFOrmed__? gt _____
ltPosnRpt/gt _____ ltThisIsAVeryLongElementNameIsItTo
oLongToBeUsed/gt _____ ltAutomobilegtChevroletlt/autom
obilegt _____ ltAmount100gtlt/Amountgt _____ ltMy
Car!gtChevroletlt/My Car!gt
21Element Examples
Which of the following are well-formed?
_____ ltThis isAWellFormedElementgtltThis
isAWellFormedElementgt _____ ltIsThis-WellFormed__?
gtdata herelt/IsThis-WellFOrmed__? gt _____
ltPosnRpt/gt _____ ltThisIsAVeryLongElementNameIsItTo
oLongToBeUsed/gt _____ ltAutomobilegtChevroletlt/autom
obilegt _____ ltAmount100gtlt/Amountgt _____ ltMy
Car!gtChevroletlt/My Car!gt
22Attributes
- Can be added to the Opening Tag of an Element
- namevalue or namevalue format
- White space ignored
- name value
- No embedded spaces or punctuation in an attribute
name - except - and _
- IMHO Think of elements as objects, think of
attributes as urrrr..., well attributes of the
objects (elements) - Sometimes objects contain other objects
(elements) - Sometimes they just have attributes (data
elements, member variables) - In fact the ISO 15022 Working Group 10 creating
ISO/XML uses object modeling (UML) to create
their XML definitions
23Attribute Examples
Which of the following are well-formed?
_____ ltInst CFI"FXXPSX" CVF"400" Ccy"USD"
Exch"CME" ID"48" MatDt"2002-12"
StlDt"2002-12-31"/gt _____ ltInst CFI"FXXPSX"
CVF400 Ccy"USD" Exch"CME" ID48
MatDt"2002-12" StlDt"2002-12-31"/gt _____
ltPartiesgt ltPty ID"CME" R"21"/gt ltPty
ID"560" R"4"/gt ltPty ID"560" R"27"
Typ"1"/gt lt/Partiesgt _____ ltInst Symbol
IBM" /gt _____ ltInst Symbol IBM" /gt
24Attribute Examples
Which of the following are well-formed?
_____ ltInst CFI"FXXPSX" CVF"400" Ccy"USD"
Exch"CME" ID"48" MatDt"2002-12"
StlDt"2002-12-31"/gt _____ ltInst CFI"FXXPSX"
CVF400 Ccy"USD" Exch"CME" ID48
MatDt"2002-12" StlDt"2002-12-31"/gt _____
ltPartiesgt ltPty ID"CME" R"21"/gt ltPty
ID"560" R"4"/gt ltPty ID"560" R"27"
Typ"1"/gt lt/Partiesgt _____ ltInst Symbol
IBM" /gt _____ ltInst Symbol IBM" /gt
25Comments
- Comments start with lt!-- and end with --gt
- Comments can appear anywhere in the XML message
Which of the following are well-formed?
_____ lt--! this is my comment--gt _____
lt!----------------------gt _____ lt!-- No this is a
good comment --gt _____ lt!-- this one is a lengthy
comment goes on for more than one line --gt
26Comments
- Comments start with lt!-- and end with --gt
- Comments can appear anywhere in the XML message
Which of the following are well-formed?
_____ lt--! this is my comment--gt _____
lt!----------------------gt _____ lt!-- No this is a
good comment --gt _____ lt!-- this one is a lengthy
comment goes on for more than one line --gt
27CDATA Sections
- Sometimes you just need to not parse something -
you have special characters - such as code
examples or even XML
lt!CDATA text gt
28What tools can be used to edit XML documents
- Low end - what ever you have on your PC
- Notepad
- Internet Browser
- Microsoft Internet Explorer
- Netscape Navigator
- Open Source
- Xerlin http//www.xerlin.org
- Commercial Editors
- XML Spy
- XML Pro Edit
- There are many, many products out there to choose
from
NEW
29Lets revisit our example...
lt?xml version'1.0'?gt lt!DOCTYPE FIXML SYSTEM
'fixmlmain.dtd'gt ltFIXMLgt ltFIXMLMessagegt
ltApplicationMessagegt ltOrdergt
ltClOrdIDgt12345lt/ClOrdIDgt ltHandlInst
Value"1"/gt ltInstrumentgt
ltSecuritygt ltSymbolgtEKlt/Symbolgt
lt/Securitygt lt/Instrumentgt
ltSide Value"1"/gt ltOrderQuantitygt
ltOrderQtygt10000lt/OrderQtygt
lt/OrderQuantitygt ltOrderTypegt
ltMarketOrder OrdType"1"/gt lt/OrderTypegt
ltCurrency Value"USD"/gt lt/Ordergt
lt/ApplicationMessagegt lt/FIXMLMessagegt lt/FIXMLgt
Document Type Declaration
30Document Type Declarations
- Delimited with lt!DOCTYPE and gt
- Follows the XML Declaration lt!XML version1.0 gt
lt!DOCTYPE root-element uri-of-dtd
internal-subset gt lt!DOCTYPE fixml SYSTEM
fixml4.3v20029020.dtdgt
31Entities
- XML also provides entities which act placeholders
- kind of like variables a little bit
- Kind of like C defines and includes
- Two types
- General Entities
- Place holders for any content that occurs at the
level of or inside the root element - Parameter Entities (ignore these for now)
32Entities
ENTITIES
name
name
General
Parameters
Character
Unparsed
Mixed Content
Internal
External
predefined
numbered
named
Internal
External
33Character Entities
- If / gt lt are all special characters in XML,
how can we get these to appear in our XML
documents? - By the use of predefined character entities
- amp
- apos
- gt gt
- lt lt
- quot
- What would the following produce as output from
an XML document - ltaposampaposgt
34The answer
- ltaposampaposgt
- becomes
- ltgt
35Numbered character entities
- 231
- xF9
- Represents the characters position within the
Unicode character set - Named Character Entities have nmeumonic name for
specific characters
36Using Entities
lt?xml version"1.0" encoding"UTF-8" ?gt lt!DOCTYPE
EntityExample lt!ENTITY CoAcr "SSB"gt lt!ENTITY
CoName "Salomon Smith Barney"gt gt ltEntityExamplegt
CoAcr CoName lt/EntityExamplegt
lt?xml version"1.0" encoding"UTF-8" ?gt
lt!DOCTYPE EntityExample (View Source for full
doctype...)gt ltEntityExamplegtSSB Salomon Smith
Barneylt/EntityExamplegt
NEW
37Mixed Content Entities
- Defined as part of the lt!DOCTYPE gt document type
declaration - From our example
- Internal
- think define
- Everywhere that exch appears - the text CBOT
would be replaced - Everywhere that exname appears - the text
Chicago Board of Trade would be replaced - External
- think include
- Everywhere that disclosure appears - the
contents of the file disclosure.txt would be read
and substituted
lt!DOCTYPE fixml SYSTEM fixml.dtd lt!ENTITY
CoAcr SSBgt lt!ENTITY CoName Salomon Smith
Barneygt lt!ENTITY disclosure SYSTEM
disclosure.txtgt gt
NEW
38An Example Mixed Content Entities
lt?xml version"1.0" encoding"UTF-8" ?gt lt!DOCTYPE
EntityExample lt!ENTITY CoAcr "SSB"gt lt!ENTITY
CoName "Salomon Smith Barney"gt lt!ENTITY
Disclosure SYSTEM "disclosure.txt"gt gt ltEntityExam
plegt CoAcr CoName quotDisclosurequot lt/
EntityExamplegt
lt?xml version"1.0" encoding"UTF-8" ?gt
lt!DOCTYPE EntityExample (View Source for full
doctype...)gt ltEntityExamplegtSSB Salomon Smith
Barney This is a standard disclosure file that
contains all of the legalize required on each and
every document as we have become a quite
litigious society and failure to include such
disclaimers in our documents will most certainly
lead to unwanted incursion of legal expenses.
Therefore, we must include these disclaimers,
even though they are seldom read and still will
not prevent litigation under the right
circumstance.lt/EntityExamplegt
NEW
39Defining our own XML Message
lt?xml version"1.0" encoding"UTF-8"?gt lt!-- Trade
information --gt ltTradegt ltInstrument symbol"IBM"
securityType"Stock"/gt ltQuantitygt100lt/Quantitygt
ltTradePricegt80.00lt/TradePricegt ltTradeDategt2002013
0lt/TradeDategt ltSidesgt ltSide type"buy"gt ltCus
tomergtJohn Doelt/Customergt ltAccountgt102435lt/Acco
untgt ltOrderIDgtABC-1453-20020130lt/OrderIDgt lt/S
idegt ltSide type"sell"gt ltFirmgtSSBlt/Firmgt lt/
Sidegt lt/Sidesgt lt/Tradegt
Is this Well Formed???
NEW
40Defining our own markup languages
- We said earlier that XML is a meta markup
language - XML is used to create domain specific markup
languages - How do we agree upon a dialect and then share
this with others? - How do we know if an XML message complies with
our XML dialect (a ML if you will) ? - There has to be
- some mechanism we can use to describe our
particular markup language (be it FIXML, FpML,
JimML, EdML, MathML, AgXML, ) - some way to share this description of our ML
- some way automate the process of making sure an
incoming XML message is a valid ML message
Good News There Is!!!!
41Describing XML Messages
- Document Type Definitions (DTDs)
- XML Schema
The Bad News is there is more than one way!
42XML The Crash Course, Part 2
- Defining and validating XML Messages
43XML Crash Course Part 2
- Describing XML Documents
- Validation
- Document Type Definitions
- Elements
- Attributes
- Internal
- External
- Using Internal and External together
- Namespaces
- XML Schema
- XML Documents as a tree
- XPath
- XLink
- XPointer
NEW
44Describing XML Messages
- Document Type Definitions (DTDs)
- Provided with the original definition of SGML as
defined by Goldfarb - Think of DTD statements as control statements for
defining XML documents - DTD statements are not really XML statements
- Cannot use XML tools to manipulate DTD statements
- Some consider the DTD statements as a separate
language - In practice it is a separate language though it
is a fundamental part of XML - XML Schema
- An XML based language for defining XML documents
- Permits manipulation of the schema using standard
XML tools - This is like defining the database schema in
tables in a relational database - A recursion if you will
Improved
45Why add rules to our Trade XML?
- Allows us
- to document and communicate what we consider as a
valid trade message - to validate our own trade messages
- to validate trade messages we receive from others
NEW
46Document Type Definitions
- DTDs are sets of rules that define the elements
and attributes in any XML document - Have their own syntax - kind of
- Why arent they required?
lt!ELEMENT name (PCDATA)gt lt!ATTLIST ElementName
Attrib-Name Datatype Defaultgt lt!ENTITY
EntityName textgt lt!NOTATION NameSystem
externalIDgt
47DTD Building Blocks
- We previously discussed the following
- Elements
- Tags
- Attributes
- Entities
- Types of data in XML Documents
- PCDATA
- Parsed Character Data
- An XML Processor looks for other XML building
blocks within the data - CDATA
- Character Data
- An XML Processor does not look for other XML
within the data
NEW
48Defining Elements
- Defining an element that can contain any kind of
data - lt!ELEMENT name ANYgt
- Defining an empty element
- lt!ELEMENT name EMPTYgt
- Defining an element that has mixed content
- Choice
- lt!ELEMENT name PCDATA childElement(s) gt
- Defining an element that has only child elements
- Sequential order
- lt!ELEMENT name ( childElem1, childElem2,
childElem3 )gt
49Defining Child Elements
- Declaring one and only one child element
- lt!ELEMENT name ( child-name ) gt
- Declaring at least one child element, permitting
multiple occurrences - lt!ELEMENT name ( child-name ) gt
- Declaring zero or to one occurrences of a child
element - lt!ELEMENT name ( child-name? ) gt
- Declaring zero or to one occurrences of the same
child element - lt!ELEMENT name ( child-name ) gt
- Declaring Options Elements
- lt!ELEMENT name ( childElem1 childElem2
childElem3 )gt
1..1
1..n
? 0..1
0..n
NEW
50Defining Child Elements
- Permitting different child elements (either/or)
- lt!ELEMENT name ( childElem1 childElem2
childElem3 )gt - Permitting a mix of child elements
-
- lt!ELEMENT name PCDATA ( childElem1
childElem2 childElem3 )gt - Defining an ordered sequence
- lt!ELEMENT name ( childElem1 , childElem2 ,
childElem3 )gt
or
, sequence
NEW
51Working with Groups of Elements
- You can apply the cardinality rules to groups of
elements - lt!ELEMENT name ( childElem1 , childElem2 ,
childElem3 )? gt
NEW
52Defining Attributes - Syntax
- Defining Attributes for Elements
- lt!ATTLIST element-name attribute-name
attribute-datatype default-value - element-name attribute-name attribute-datatype
default-value - ...
- gt
NEW
53Attribute Datatypes
- Attribute Datatypes (or just types)
- CDATA
- Character Data
- an enumerated list using the
- Values separated by the (vertical bars)
- lt!ATTLIST Instrument SecurityType
(StockBondFutureOption) Stockgt - Other types (we wont talk about today)
- ID
- IDREF
- IDREFS
- ENTITY
- ENTITIES
- NMTOKEN
- NMTOKENS
- NOTATION
NEW
54Attribute Default Values
- Attribute Default Values
- REQUIRED
- Attribute must be included in the Element
- IMPLIED
- The attribute is optional (does not have to be
supplied) - FIXED default-value
- The attribute is optional - if it is not supplied
use the default value provided - default-value
- For enumerated lists - the default if the
attribute is not specified
NEW
55Defining Attributes
- Defining an element that can contain any kind of
data - lt!ATTLIST element-name attribute-name
attribute-datatype default-value gt - ltPosQty Lng"635" Sht"1" Typ"SOD"/gt
NEW
56Defining Attributes
- Defining an element that can contain any kind of
data - lt!ATTLIST element-name attribute-name
attribute-datatype default-value gt - ltPosQty Lng"635" Sht"1" Typ"SOD"/gt
NEW
57Proposed FIX 4.4 Positions Report in TO-FIXML
lt?xml version"1.0" encoding"UTF-8"?gt ltFirmPortfo
liogt ltAppMsggt ltPosRpt
BusDt"2002-11-13" PrStlPx"72.925" ReqID"1RFP"
ReqTyp"T" RptID"1" StlPx"73.10"
StlPxTyp"FINAL"gt ltStlSes
ID"EOD"/gt ltPartiesgt ltPty ID"CME"
R"21"/gt ltPty ID"560" R"4"/gt ltPty ID"560"
R"27" Typ"1"/gt lt/Partiesgt ltInst CFI"FXXPSX"
CVF"400" Ccy"USD" Exch"CME" ID"48"
MatDt"2002-12" StlDt"2002-12-31"/gt ltPositionsgt
ltPosQty Lng"635" Sht"1" Typ"SOD"/gt
ltPosQty Lng"601" Sht"1" Typ"EOD"/gt
ltPosQty Lng"3" Sht"37" Typ"ALC"/gt
ltPosQty Lng"68" Sht"0" Typ"IAS"/gt
ltPosQty Lng"1" Sht"1" Typ"IES"/gt
lt/Positionsgt ltAmountsgt ltPosAmt
Amt"45770.00" Typ"FMTM"/gt ltPosAmt
Amt"44380.00" Typ"SMTM"/gt lt/Amountsgt
lt/PosRptgt lt/AppMsggt
lt/FirmPortfoliogt
NEW
58Defining DTD statements for TO-FIXML
- lt?xml version"1.0" encoding"UTF-8"?gt
- ltFirmPortfoliogt
- ltAppMsggt
- ltPosRpt BusDt"2002-11-13"
PrStlPx"72.925" ReqID"1RFP" ReqTyp"T"
RptID"1" StlPx"73.10" StlPxTyp"FINAL"gt - ltStlSes ID"EOD"/gt
- ltPartiesgt
- ltPty ID"CME" R"21"/gt
- ltPty ID"560" R"4"/gt
- ltPty ID"560" R"27" Typ"1"/gt
- lt/Partiesgt
- ltInst CFI"FXXPSX" CVF"400" Ccy"USD"
Exch"CME" ID"48" MatDt"2002-12"
StlDt"2002-12-31"/gt - ltPositionsgt
- ltPosQty Lng"635" Sht"1" Typ"SOD"/gt
- ltPosQty Lng"601" Sht"1" Typ"EOD"/gt
- ltPosQty Lng"3" Sht"37" Typ"ALC"/gt
- ltPosQty Lng"68" Sht"0" Typ"IAS"/gt
- ltPosQty Lng"1" Sht"1" Typ"IES"/gt
- lt/Positionsgt
- ltAmountsgt
NEW
59Adding an internal definition to our XML
lt?xml version"1.0" encoding"UTF-8"?gt lt!-- Trade
information --gt lt!DOCTYPE Trade lt!ELEMENT
Account (PCDATA)gt lt!ELEMENT Customer
(PCDATA)gt lt!ELEMENT Firm (PCDATA)gt lt!ELEMENT
Instrument EMPTYgt lt!ATTLIST Instrument symbol
CDATA REQUIRED securityType CDATA
REQUIRED gt lt!ELEMENT OrderID (PCDATA)gt lt!ELEMENT
Quantity (PCDATA)gt lt!ELEMENT Side ( (Customer
Account OrderID) Firm)gt lt!ATTLIST
Side type (buy sell) REQUIRED gt lt!ELEMENT
Sides (Side)gt lt!ELEMENT Trade (PCDATA
Instrument Quantity Sides TradeDate
TradePrice)gt lt!ELEMENT TradeDate
(PCDATA)gt lt!ELEMENT TradePrice
(PCDATA)gt gt ltTradegt rest of TRADE xml
omitted on this slide lt /Tradegt
NEW
60Using an External DTD
lt?xml version"1.0" encoding"UTF-8"?gt lt!-- Trade
information --gt lt!DOCTYPE Trade SYSTEM
"D\home\jim\FIX\FIA_XML_Workshop\FIXML_43\trade.d
td"gt ltTradegt ltInstrument symbol"IBM"
securityType"Stock"/gt ltQuantitygt100lt/Quantitygt
ltTradePricegt80.00lt/TradePricegt ltTradeDategt2002013
0lt/TradeDategt ltSidesgt ltSide type"buy"gt ltCus
tomergtJohn Doelt/Customergt ltAccountgt102435lt/Acco
untgt ltOrderIDgtABC-1453-20020130lt/OrderIDgt lt/S
idegt ltSide type"sell"gt ltFirmgtSSBlt/Firmgt lt/
Sidegt lt/Sidesgt lt/Tradegt
NEW
61Our External Trade DTD File
lt?xml version"1.0" encoding"UTF-8"?gt lt!--
edited with XMLSPY v5 rel. 2 U (http//www.xmlspy.
com) by James Northey --gt lt!--DTD generated by
XMLSPY v5 rel. 2 U (http//www.xmlspy.com)--gt lt!EL
EMENT Account (PCDATA)gt lt!ELEMENT Customer
(PCDATA)gt lt!ELEMENT Firm (PCDATA)gt lt!ELEMENT
Instrument EMPTYgt lt!ATTLIST Instrument symbol
CDATA REQUIRED securityType CDATA
REQUIRED gt lt!ELEMENT OrderID (PCDATA)gt lt!ELEMENT
Quantity (PCDATA)gt lt!ELEMENT Side ((Customer
Account OrderID) Firm)gt lt!ATTLIST Side type
(buy sell) REQUIRED gt lt!ELEMENT Sides
(Side)gt lt!ELEMENT Trade (PCDATA Instrument
Quantity Sides TradeDate TradePrice)gt lt!ELE
MENT TradeDate (PCDATA)gt lt!ELEMENT TradePrice
(PCDATA)gt
62XML Namespaces
- Sometimes you need to reuse other definitions
- Sometimes you have naming conflicts between
different syntax
NEW
63XML Schema
- Using XML to define XML messages
NEW
64Think of an XML Document as a Tree of Information
65XML document as a tree of information
- Operating System File Systems
- File Systems are organized in a tree like
structure - Files Systems contain directories that contain
files and other directories (sub directories) - The main directory is called the root directory
- You can traverse the file system directory tree
using commands, such as cd (change directory) - There is the concept of the current working
directory - where you are in the file system tree
structure
- XML Documents
- XML documents are organized into a tree like
structure - XML documents contain elements that contain
attributes and other elements (nested elements) - The main element is called the root element
- You can traverse the XML document element tree
using your own programs or XPATH commands - There is a concept of the current node - the
point where you are in the XML document tree
structure
66There is a name for this XML tree inside a program
- The Document Object Model (DOM) is a way to
represent an XML message within a program - The Document Object Model is organized as a tree
of XML elements starting at the root element - You can walk the tree using the DOM application
programming interface
67XPath
- Trees can be climbed (traversed)
- Syntax for searching and traversing an XML
document tree - Sort of like wild cards or regular expressions
- Instead of applying to a text file - applied to a
tree - Thinking about Paths
- There is a path to take
- Here is the path taken
68Internet Resources
- W3Schools.com
- http//www.w3schools.com
- World Wide Web Consortium
- Definitions of everything we have talked about
- http//www.w3c.org
- The Cover Pages by Robin Cover
- http//xml.coverpages.org/
- Open OASIS - Supporting XML based industry
standards - http//www.oasis-open.org/
Improved
69XML The Benefits
- Oren Miller
- Senior Director of Software Development,
Thoughtworks, Inc.
70Extensible Stylesheet Language Transformations
(XSLT)
- Used to transform XML Content (And IS XML)
- Rule Based Language (Not Sequential)
- Declarative Query Syntax (Xpath), like SQL
- Templates
- ltxsltemplate match/gt
- ltxsltemplate name/gt
- Data Retrieval
- ltxslvalue-of select/gt
- Iteration
- ltxslfor-each select/gt
- Decisions
- ltxslif test/gt
- ltxslchoosegt, ltxslwhengt
- Variables
- ltxslvariablegt, ltxslparamgt
71Position Report to be Transform to an SQL Update
lt?xml version"1.0" encoding"UTF-8"?gt ltFirmPortfo
liogt ltAppMsggt ltPosRpt
BusDt"2002-11-13" PrStlPx"72.925" ReqID"1RFP"
ReqTyp"T" RptID"1" StlPx"73.10"
StlPxTyp"FINAL"gt ltStlSes
ID"EOD"/gt ltPartiesgt ltPty ID"CME"
R"21"/gt ltPty ID"560" R"4"/gt ltPty ID"560"
R"27" Typ"1"/gt lt/Partiesgt ltInst CFI"FXXPSX"
CVF"400" Ccy"USD" Exch"CME" ID"48"
MatDt"2002-12" StlDt"2002-12-31"/gt ltPositionsgt
ltPosQty Lng"635" Sht"1" Typ"SOD"/gt
ltPosQty Lng"601" Sht"1" Typ"EOD"/gt
ltPosQty Lng"3" Sht"37" Typ"ALC"/gt
ltPosQty Lng"68" Sht"0" Typ"IAS"/gt
ltPosQty Lng"1" Sht"1" Typ"IES"/gt
lt/Positionsgt ltAmountsgt ltPosAmt
Amt"45770.00" Typ"FMTM"/gt ltPosAmt
Amt"44380.00" Typ"SMTM"/gt lt/Amountsgt
lt/PosRptgt lt/AppMsggt
lt/FirmPortfoliogt
72Creating an extract of positions only
Contains position and trade record XML messages
Position Report Trade Capture FIXML File
Selects Position Reports from the file with
position reports and trade detail
extposrepts.xsl
Positions XML File
Improved
73Selecting only Position Reports
- The following XSLT statement is used to select
only the Position reports from the file
containing Position Report and Trade Capture
messages
lt!-- only process application messages that are
position reports --gt ltxsltemplate
match"AppMsg/node()name()'PosRpt'"gt
Improved
74Creating a text file
Contains position and trade record XML messages
Position Report Trade Capture FIXML File
Selects the position reports and and creates a
comma delimited text file
fixml2text.xsl
Text file containing the position information
Positions text file
Improved
75Creating a database insert script
Contains position and trade record XML messages
Position Report Trade Capture FIXML File
Selects the position reports and creates an SQL
script to insert positions into a database
fixmltosql.xsl
SQL script created by the XSLT
SQL Script
Positions Database
Improved
76Position Report Database Schema
Position Report
Parties
Positions
Amounts
77Accessing the parties, positions, and amounts
- The following XSLT fragment writes the Parties,
positions, and amounts into separate tables - Notice that a subroutine or template is used,
sql-insert-collection
ltxslfor-each select"node()"gt lt!-- insert
collections (eg. Parties, Positions, Amounts)
--gt ltxslif test"count(node())gt0 and
name()!'Inst'"gt ltxslcall-template
name"sql-insert-collection"/gt lt/xslifgt
lt/xslfor-eachgt lt/xsltemplategt
78The sql-insert-collection Template
- This template is used to iterate through multiple
elements (such as parties or positions) and
create insert statements - Notice that it calls two other templates,
sql-insert-fields and sql-insert-values
lt!-- insert statement for a position report
collection --gt ltxsltemplate name"sql-insert-coll
ection"gt ltxslfor-each select"node()"gt
INSERT INTO ltxslvalue-of select"name(..)"/gt
( RptID, ltxslcall-template
name"sql-insert-fields"/gt ) VALUES
( quotltxslvalue-of select"../../_at_RptID"/
gtquot, ltxslcall-template
name"sql-insert-values"/gt )
lt/xslfor-eachgt lt/xsltemplategt
79Templates that are used in this example
- Templates created to iterate and create the
fields and the values for the table insert
lt!-- field names for insert --gt ltxsltemplate
name"sql-insert-fields"gt ltxslfor-each
select"_at_"gt ltxslvalue-of select"name()"/gt
ltxslcall-template name"comma"/gt
lt/xslfor-eachgt lt/xsltemplategt
Notice each of the templates on the left use the
comma template...
lt!-- will not insert comma after last element
--gt ltxsltemplate name"comma"gt ltxslif
test"not(position()last())"gt,lt/xslifgt lt/xsltem
plategt
lt!-- values for insert --gt ltxsltemplate
name"sql-insert-values"gt ltxslfor-each
select"_at_"gt ltxslvalue-of select"."/gt
ltxslcall-template name"comma"/gt
lt/xslfor-eachgt lt/xsltemplategt
80Accessing XML Messages from an application program
- Matt Simpson
- Associate Director, Clearing IT, Chicago
Mercantile Exchange, Inc.
81XML Integration Assumptions
- Java is your base development language
- You can run a Java Virtual Machine (JVM) on your
platform - Your Operating System can be Sun/Solaris,
HP-Unix, OS390-based Unix, Microsoft OSs
including NT, XP, and Windows, and various
flavors of Linux - Your development is J2EE-oriented and can
leverage XML APIs - App Servers are not necessary, but a number can
be used including Weblogic, Websphere, Apache
Tomcat, and others - There are others products and implementations
which will not be addressed in this overview.
82Principles of the Java XML APIs
- J2EE XML APIs - engineered by Sun and accepted
as a standard by much of the industry are a
good starting point for any XML-oriented
application - Adhere to industry standards regarding XML and
thus ensure interoperability - Broad functionality allows choice of application
architectures - Flexibility within a well-defined framework
ensures that all implementations will deliver
standard functionality.
83What makes XML an Attractive Technology
- Extensibility tags can be added as needed
- Portability given a DTD, a parser will know the
structure and type of content for any xml
document - Loosely coupled to Business Processes
- Human readable allows business users to
interpret data - System independent way of representing data
- New Java APIs making XML easier to use
- Validation of documents can be enforced or not,
depending on the need
84JAXB Java API for XML Binding
- Overview
- JAXB is a new standard being developed via Suns
Java Community which provides a way to map XML
documents to Java objects. - Suns implementation generates Java classes
representing elements in a DTD. These classes
contain XML parsing logic. - JAXB is essentially a bridge between XML and
Java. It allows creation of Java objects at the
same level as the XML. - Maps XML to Java data objects
- Acts as a code-generator using a DTD (not a
schema) - Uses a DTD to bind to a set of generated
classes - The binding schema is an XML-based binding
language - Classes are generated which maps your XML to
internal data objects
85JAXB Java API for XML Binding
86JAXB Java API for XML Binding
- Disadvantages of JAXB
- The evolving FIXML standard may require
generating new Java classes each time the DTD
changes. - In order to avoid coding changes to the business
logic an additional abstraction is required which
complicates the overall architecture. - Youre Stuck with the object that is generated.
- Classes containing business logic are more likely
to change as XML-mapping classes and the DTD
change. - May not address some of the mapping issues needed
for complex xml-object mappings. - Causes domain/data objects to contain XML parsing
logic. In order to avoid coding changes to the
business logic an additional abstraction is
required which complicates the overall
architecture. - May introduce additional OO complexity.
- Evaluated, but not used by CME. Would have
caused the CMEs switch to attributes to be more
cumbersome.
87JAXP Java API for XML Processing
- Overview
- A J2EE API that provides access to the XML
parsing techniques SAX and DOM. - Has a Pluggabability-Player feature allows any
XML-compliant parser to be used. - Implementation Independent meaning any API
compliant parser can be used with JAXP - The prominent implementations are provided by
Crimson and Apache Xerces
88JAXP Java API for XML Processing
- Both implementations provide SAX, DOM, XSLT APIs
- SAX and DOM being parsers - Adds methods that allows generated code to be
parser-independent - Xerces has its own implementation of SAX and DOM
used by JAXP - For reconstruction, we ended up bypassing the
JAXP interfaces and using the Xerces interfaces
directly. - Disadvantages
- JAXP provides a way to reconstruct an XML
document using DOM - but serialization to a string requires using an
XSL transformation which is very slow.
89JAXP Java API for XML Processing
90The SAX Parser
- Overview
- SAX (Simple API for XML) is an event-based parser
which reads XML in a stream and each time it
recognizes a tag, extracts the data. - SAX is most effective when only a part of a
document needs to be parsed. - As SAX parses, the data is extracted from the XML
string and made available for mapping. - Code is required to map SAX object to internal
Java data object. - Disadvantages
- More complex requires creating your own
tree-like structure. - Does not provide support for Reconstruction of
documents.
91SAX Sample
- The sample code belows show the SAX
startElement method and its implementation
which prints out the tag name - public void startElement (String _uri, String
_localName, String _prefix, Attributes attrs) - throws SAXException
-
- if (_localName.equalsIgnoreCase("AppMsg"))
- System.out.println("ltAppMsggt tag found!")
- else if (_localName.equalsIgnoreCase("PosReq"))
- System.out.println("ltPosReqgt tag found!")
- ...
- This method is called by SAX when it sees the
body of the tag. - public void characters (char buf , int offset,
int len) - throws SAXException
-
- String str new String(buf, offset,
len) - System.out.println(str)
92DOM Parsing
- DOM (Document Object Model) is a parser which
allows random access to particular pieces of data
AFTER the entire document has been loaded into
memory - Once in memory, the document can be modified,
something which SAX does not support. - DOM provides a simple way to construct a new XML
document in memory and add elements to it while
traversing the Java domain objects. - Disadvantages (vs. SAX)
- In general, DOM is less efficient since it takes
more time to load and search memory - Does not provide a parser independent way to
serialize an XML document into a String meaning
XSL must be used
93DOM Sample
The sample code below shows how DOM references an
XML document in memory. In this example, an
element called PosReq is located and the
corresponding data is subsequently extracted and
printed. DocumentBuilderFactory factory
DocumentBuilderFactory.newInstance()
DocumentBuilder builder factory.newDocumentBuild
er() Document document
builder.parse(new ByteArrayInputStream(xml.getByte
s())) NodeList list document.getElement
sByTagName("PosReq") for(int i0
iltlist.getLength()i)
System.out.println(list.item(i))
94The Apache Digester Model
- Overview
- Provides an easily configurable framework for
mapping XML messages to Java objects using an XML
parser - Conforms to the SAX 2.0 specification
- The Digester component leverages the strengths of
the SAX event model for parsing XML which include
speed and efficient memory usage - Used to load configuration data
- Does not build mapping classes like JAXB
- Uses a pattern to perform mapping which can be
expressed in a java class or in a .properties or
config file - The Digester hides its complexity behind an easy
to use interface - Disadvantages
- Significantly slower than a custom solution due
to complexity
95The Apache Digester Model
96A Customized Approach
- Overview
- The custom solution uses the Apache Xerces parser
which provides support for JAXP, DOM, and SAX
APIs. - the JAXP interfaces were bypassed for
serialization and the Xerces interface was called
directly. - Why???
- the SAX API provides fast and memory efficient
event driven parsing of XML documents. It is the
most rapid way to put XML string into a Java
object. - The incoming messages are first mapped to a tree
of lightweight objects representing the elements
in the document. - This representation uses fewer objects and
therefore less memory than a DOM representation.
- The tree is then traversed and custom code is
used to map each of the elements in the tree to a
corresponding Java domain object. - Apache Xerces SAX parser implementation is used
under the covers and is masked from the
developer.
97A Customized Approach
98A Customized Approach
- Advantages
- The FIXML Translator implementation encapsulates
all the XML document parsing and construction
logic behind a simple interface. - It isolates the rest of the Position Services
application from changes to the evolving FIXML
standard. - The custom code used for the implementation
leverages standard APIs familiar to Java
developers and can be quickly and easily updated
when changes to the FIXML standard are required.
99XML Reconstruction
- DOM is used to map Java domain objects to
outgoing FIXML messages - The DOM API is used because the SAX API does not
provide a way to construct an XML document - The DOM API provides a simple way to construct a
new XML document in memory and add elements - After the XML document is constructed, it is
serialized into a String using a Xerces parser
specific API. - DOM does not provide a parser independent way to
serialize an XML document into a String, so JAXP
provides a way to do this via XSLT. - XSL Transformation API is slow
- Reconstruction a customized approach
- DOM used to build doc in memory
- Xerces specific API used to construct outbound
string - XMLSerializer class used to for this purpose
- JAXP is bypassed for serialization
- Sun is aware of this shortcoming and will provide
better support for message reconstruction in the
next release
100Conclusion
- JAXB DTD code generation solution for XML to
Object mapping. - Digester Pattern-based solution for XML to
Object mapping - JAXP Complete standard API for XML handling
includes SAX and DOM - SAX Event-based parsing. Fast and efficient.
Does not support Reconstruction - DOM Loads entire XML document to memory tree.
Supports Reconstruction
101Implementing XML Notes from the field
- David Li
- Chief Architect, New York Mercantile Exchange
102XML Practice in Nymex
- Universal Trading Message - UTM
103Goal
- Create internal messaging protocol for loosely
coupled applications. - Messaging (SmartSocket) pub/sub queue
- Legacy, J2EE, stand alone, Java, C
104Resolve Task
- Define comprehensive messaging schema for
application data exchange. - Started using Fix superset
- Originally used tag definitions based on Fix
protocol in the form of lttaggt value lttaggt - Used blocks similar to Fix to group relevant
data elements - Schema in one file
105Issues
- This is problematic for the following reasons
- Not user readable
- Large file size for even small sets of data
creates difficulty (12k) - Schema management
- Schema elements are not reusable
- Unable to successfully use it with data binding
tools
106How we resolved the issues
- Changed tags to user readable tags
- Changed data to lttag elementgt ltsubtaggt format so
that only repeated data gets its own tag.
Reduced the size and simplified data binding
process. (15k) - Broke schema down to block level, which allowed
for reusability and easy management
107Data Binding Tools
- Based on the schema, classes get generated
- To maintain object library held to maintain only
schema, without any programming - Excellent performance castor uses JAX parser to
set data fields
108Instant validation
- by setting fields to XML on UML generated object
libraries, perform instant validation - Used in common code repository for different
application, enforces versioning and data
consistency throughout the enterprise - Link to JAXB, Castor, Talarian, Clearcase
109Conclusion
- Recommendations and highlights
- Make sure schema is extendable
- Data binding is in use by all applications in
enterprise - Effective use of code repository to distribute
latest data objects and schema throughout the
enterprise
110Putting XML to Work Today
- Matt Simpson
- Associate Director, Clearing IT, Chicago
Mercantile Exchange, Inc.
111Objectives of Post-Trade APIs
- Extend Clearing beyond the traditional screen and
browser based offering by providing a
message-based interface into a core set of
Clearing Services. - Actively support and advance a standard that will
achieve a Build once, interface many times
approach for the firms. - Allow firms to connect back-office systems to CME
Clearing in order to seamlessly integrate
transaction processing between CME Clearing and
firms. - Eliminate/reduce redundant maintenance. Firms
will no longer need to perform maintenance in
their systems and again in CME Clearing Systems. - Promote Straight-thru-processing to reduce the
risk of exposure of the CME and firms, and to
allow greater financial transparency. - Provide an open systems architecture that will
host firm access to CME Clearing and allow firms
to interface with the APIs via MQSeries
112XML for STP
113The Post-Trade APIs
- 1st Quarter 2003 Deliverable
- Exercise Notice
- Abandonment Notice
- Position Adjustment
- Final Position Instruction (PCS)
- Margin Disposition
- Request for Position
- This intent of this service is to replace and
supercede the Machine Readable Trade Register
which is a limited-format batch file. - The Position Request will return varying levels
of detail based on the nature of the request. - And More are on the way!
114Architectural Goals
- The Post-trade Architecture adheres to the
following design goals - Decouple FIX-specific dependencies from the
underlying business logic of the Post-Trade API
System. - Decouple Message Delivery dependencies from the
underlying business logic of the Post-Trade API
System and from the FIXML format itself. - Ensure that the Post-Trade API System has a
well-defined transaction context for each
request/response. - Support additional FIXML messages with
close-to-zero integration effort. - Enforce controlled exception handling.
- Support processing of messages that may be
initiated via non-message-based requests, eg User
Interface Requests
115High-level Architecture
116Internal Architecture
117Architectural Components
- There are three high-level control layers for the
iCPS architecture. - RD Mediator (for communication)
- FIX Command Session (translation, delegated
execution) - Command Session (execution)
118XML Class Structure
119Principals of Optimizing FIXML
- Use meaningful abbreviations for element and
attribute names wherever possible. Use standard
abbreviations for common words (ie. Price Px,
Currency Ccy). - Identify the messages used in the application and
create top level elements to represent them. For
position services, these elements are the
position maintenance request (PosMaintReq),
position maintenance report (PosMaintRpt),
position request (PosReq), position request
acknowledgement (PosReqAck), position report
(PosRpt), and trade capture report (TrdCapRpt). - Identify data items that can be grouped together
to describe a logical object and create an
element to represent the object. For example, an
account ID and account type can be grouped
together as an account element with supporting
attributes. - Reuse elements to represent common logical
objects which are parts of other objects rather
than creating new elements. For example, a party
is an object that is part of a position
maintenance request, position request, and trade
capture report side and can also be nested within
a position quantity. - Reuse attributes across multiple objects
- Identify elements that can be repeated and create
a collection element to contain the repeated
elements. For example, multiple parties are
needed on a message and a collection element
called Parties was created to contain multiple
Pty elements.
120FIXML Message Components
- Parties Block
- 1. The purpose of the Parties Block is to provide
an efficient, standard way of expressing Firm and
Account information in API Messages. The Parties
Block consists of the following elements - Party Role, Party ID, Party Sub ID, and Party ID
Source. - Party Role is a static number used to express the
type of party, for example Clearing Organization,
Clearing Firm, etc. - Party