150 likes | 346 Views
Annex C XML and XMI. 1999-03-01 David Skogan SINTEF Telecom and Informatics Email: David.Skogan@informatics.sintef.no. Contents. Extensible Markup Language (XML) XML Metadata Interchange (XMI). XML Concepts. XML document well-formed vs. valid XML processor XML element
E N D
Annex CXML and XMI 1999-03-01 David Skogan SINTEF Telecom and Informatics Email: David.Skogan@informatics.sintef.no
Contents • Extensible Markup Language (XML) • XML Metadata Interchange (XMI)
XML Concepts • XML document • well-formed vs. valid • XML processor • XML element • Start tag with attributes • Content • End tag • XML entity • Text: XML-document, text, character • Binary: Any thing that is not XML-encoded • Document Type Declaration (DTD)
XML document • <?xml version=“1.0” ?> • <!DOCTYPE catalogue SYSTEM “catalogue.dtd” > • <catalogue> • <book ID=“b123” title=“ISO 15046”> • <author>Olaf Østensen</author> • <publisher>ISO Central Secretariat</publisher> • <web HREF=“http://www.statkart.no/isotc211”>Home page</web> • </book> • </catalogue>
DTD catalogue.dtd • <!ELEMENT catalogue ( book+ ) > • <!ELEMENT book ( author?, publisher, web* ) > • <!ATTLIST book • ID ID #REQUIRED • title CDATA #REQUIRED > • <!ELEMENT author ( #PCDATA ) > • <!ELEMENT publisher ( #PCDATA ) > • <!ELEMENT web ( #PCDATA ) > • <!ATTLIST web • xml:link CDATA #FIXED “simple” • href CDATA #REQUIRED • show (embed | replace | new) “replace” • actuate (auto | user ) “user” >
XML Attributes • Attribute data types • ID • IDREF, IDREFS • CDATA • ENTITY, ENTITIES • NMTOKEN, NMTOKENS • Enumeration • Special attributes • href CDATA • xml:link CDATA • xml:lang NMTOKEN • ...
XML Element content • Content • Alternatives • <!ELEMENT alt ( one | two | three ) > • Sequence • <!ELEMENT seq ( one, two+, three ) > • Empty • <!ELEMENT null EMPTY> • Any • <!ELMENT div ANY> • Mixed • <!ELEMENT ( #PCDATA | seq )* > • Operators • ?, +, *
XML Character coding • Character coding • Document entity • <?xml version=“1.0” encoding=“ISO-10646-UCS-2” ?> • Default: “UTF-8” or “UTF-16” • Others • “ISO-10646-UCS-2”, “ISO-10646-UCS-4”, “ISO-8859-1”, ... , “ISO-8859-10” • “ISO-2022-JP”, “Shift_JIS”, “EUC-JP” • Character reference, entities • Language specifications • <p xml:lang=“en-US”>What color is it?</p> • <p xml:lang=“en-GB”>What colour is it?</p>
XMI Introduction • In November 1997, the MOF and UML were adopted as OMG standards. • The specifications included metamodel and set of CORBA interfaces for manipulating MOF based meta objects and UML based models • However a file/stream based interchange format was not specified (time constraints…) • In December 1997, the SMIF RFP was issued • The three initial submissions XMI, CDIF and UOL have now been integrated into one - XMI
XMI Simplified XML Syntax and Encoding UML DTD and XML streams X MI MOF Metamodel Definitions Warehouse DTD and XML streams
OMG Metamodeling Architecture and XMI • DTDs defined for MOF, UML • MOF metamodel DTD generation • Models are XML documents with a DTD • Document and DTD interchange
XML technology • Open standard by the W3C. • Markup language based on SGML. • Combines data & metadata for information interchange. • Simple, flexible, eXtensible. • Tags form a tree information structure. • DTD provides the tag rules. SGML XML HTML
XML and the Industry • Standards • W3C open standard on Feb 10, 1998. • International ISO character sets • Additional standards in progress: • XLink/XPointer, Namespaces, XSL, RDF, DOM, SAX, Web-DAV • Support is exploding • 27 books on Amazon.com in < 1 year • XML supported by Adobe, ArborText, DSTC, HP, IBM, Microsoft, Netscape, Oracle, Platinum, Unisys, Select, Sun, Xerox • Web, publishing, repositories, modeling, databases/warehouses, services, financial, health care, semiconductors, ...
XML benefits • XML is system-independent, vendor independent, proven with HTML on the web. • Metadata delivery via the web • Validation, tool support, low cost of entry • Advanced linking • Stylesheets for views, transforms