Using of XML for object store S. Linev, GSI. 9.03.2004Using of XML for object store. S.Linev2 Content XML and existing packages XML and existing packages.

Slides:



Advertisements
Similar presentations
EIONET Training Zope Page Templates Miruna Bădescu Finsiel Romania Copenhagen, 28 October 2003.
Advertisements

XML Schema Heewon Lee. Contents 1. Introduction 2. Concepts 3. Example 4. Conclusion.
W3C XML Schema: what you might not know (and might or might not like!) Noah Mendelsohn Distinguished Engineer IBM Corp. October 10, 2002.
An Introduction to XML Based on the W3C XML Recommendations.
1 COS 425: Database and Information Management Systems XML and information exchange.
XML Introduction What is XML –XML is the eXtensible Markup Language –Became a W3C Recommendation in 1998 –Tag-based syntax, like HTML –You get to make.
XML October 24, Unit 6. What is XML? Stands for eXtensible Markup Language It is a markup language, like HTML But, –XML is designed to markup data –HTML.
XML Verification Well-formed XML document  conforms to basic XML syntax  contains only built-in character entities Validated XML document  conforms.
Introduction to XML This material is based heavily on the tutorial by the same name at
1 Advanced Topics XML and Databases. 2 XML u Overview u Structure of XML Data –XML Document Type Definition DTD –Namespaces –XML Schema u Query and Transformation.
Technical University of Valencia Computer Science Department SOFSEM’07 (22/01/2007) A Program Slicing Based Method to Filter XML/DTD documents.
XML I/O in ROOT S. Linev, R. Brun, H.G. Essel CHEP 2004.
Status of SQL and XML I/O Sergey Linev, GSI, Darmstadt, Germany.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
Why XML ? Problems with HTML HTML design - HTML is intended for presentation of information as Web pages. - HTML contains a fixed set of markup tags. This.
CREATED BY ChanoknanChinnanon PanissaraUsanachote
Maziar Sanaii Ashtiani – SCT – EMU, Fall 2011/12.
An Introduction to XML Presented by Scott Nemec at the UniForum Chicago meeting on 7/25/2006.
CISC 3140 (CIS 20.2) Design & Implementation of Software Application II Instructor : M. Meyer Address: Course Page:
WMO BUFR &CREX Gil Ross, UK Met Office
What is XML?  XML stands for EXtensible Markup Language  XML is a markup language much like HTML  XML was designed to carry data, not to display data.
THttpServer class Sergey Linev (GSI). Some history Development was inspired by JSRootIO why not achieve similar functionality with online ROOT application?
PCWG Analysis Tool Peter Stuart September 15, 2015.
Processing of structured documents Spring 2002, Part 2 Helena Ahonen-Myka.
XML Parsers Overview  Types of parsers  Using XML parsers  SAX  DOM  DOM versus SAX  Products  Conclusion.
XML TUTORIAL Portions from w3 schools By Dr. John Abraham.
Java Root IO Part of the FreeHEP Java Library Tony Johnson Mark Dönszelmann
© ITEDO Software 2004 S1000D and CGM Dieter Weidenbrueck Paris July 21, 2004.
Softsmith Infotech XML. Softsmith Infotech XML EXtensible Markup Language XML is a markup language much like HTML Designed to carry data, not to display.
© GMV S.A., 2004 Property of GMV S.A. All rights reserved 2004/05/13 XML in CCSDS CCSDS Spring Meeting - Montreal Fran Martínez GMVSA 4081/04.
Ernest Micklei, PhilemonWorks.com UMLX: a pragmatic solution to documenting design Ernest Micklei
The european ITM Task Force data structure F. Imbeaux.
Accessing Data Using XML CHAPTER NINE Matakuliah: T0063 – Pemrograman Visual Tahun: 2009.
ROOT I/O for SQL databases Sergey Linev, GSI, Germany.
An Introduction to XML Sandeep Bhattaram
XML Introduction. What is XML? XML stands for eXtensible Markup Language XML stands for eXtensible Markup Language XML is a markup language much like.
The eXtensible Markup Language (XML). Presentation Outline Part 1: The basics of creating an XML document Part 2: Developing constraints for a well formed.
Sheet 1XML Technology in E-Commerce 2001Lecture 2 XML Technology in E-Commerce Lecture 2 Logical and Physical Structure, Validity, DTD, XML Schema.
CHEP /21/03 Detector Description Framework in LHCb Sébastien Ponce CERN.
The Semistructured-Data Model Programming Languages for XML Spring 2011 Instructor: Hassan Khosravi.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2.
1 “Universal Data-Speak”: The eXtensible Markup Language Zack Ives CSE 590DB, Winter 2000 University of Washington 3 January 2000.
ROOT Tutorials - Session 51 ROOT Tutorials – Session 5 Dictionary Generation, rootcint, Simple I/O, Hands-on Fons Rademakers.
STAR Schema Evolution Implementation in ROOT I/O V. Perevoztchikov Brookhaven National Laboratory,USA.
Representing data with XML SE-2030 Dr. Mark L. Hornick 1.
XML Schemas Experiences Rogue Wave Software Allen Brookes.
CHEP /21/03 Detector Description Framework in LHCb Sébastien Ponce CERN.
XML CSC1310 Fall HTML (TIM BERNERS-LEE) HyperText Markup Language  HTML (HyperText Markup Language): December  Markup  Markup is a symbol.
Martin Kruliš by Martin Kruliš (v1.1)1.
ISA 95 Working Group Process Centric Exchanges Gavan W Hood July 23, 2015 GWH 2.1.
Introduction to XML Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
SEMI-STRUCTURED DATA (XML) 1. SEMI-STRUCTURED DATA ER, Relational, ODL data models are all based on schema Structure of data is rigid and known is advance.
Go4 Workshop J.Adamczewski-Musch, S.Linev Go4 advanced features.
CHAPTER NINE Accessing Data Using XML. McGraw Hill/Irwin ©2002 by The McGraw-Hill Companies, Inc. All rights reserved Introduction The eXtensible.
XML Extensible Markup Language
XML Notes taken from w3schools. What is XML? XML stands for EXtensible Markup Language. XML was designed to store and transport data. XML was designed.
XML Databases Presented By: Pardeep MT15042 Anurag Goel MT15006.
1 Introduction to XML Babak Esfandiari. 2 What is XML? introduced by W3C in 98 Stands for eXtensible Markup Language it is more general than HTML, but.
XML intro. What is XML? XML stands for EXtensible Markup Language XML is a markup language much like HTML XML was designed to carry data, not to display.
XML BASICS and more…. What is XML? In common:  XML is a standard, simple, self-describing way of encoding both text and data so that content can be processed.
Product Training Program
XML Parsers Overview Types of parsers Using XML parsers SAX DOM
Possibility of XML I/O support in ROOT
XML QUESTIONS AND ANSWERS
XML in Web Technologies
Eugenia Fernandez IUPUI
XML Parsers Overview Types of parsers Using XML parsers SAX DOM
XML Data Introduction, Well-formed XML.
Presented by: Jacky Ma Date: 11 Dec 2001
Presentation transcript:

Using of XML for object store S. Linev, GSI

Using of XML for object store. S.Linev2 Content XML and existing packages XML and existing packages Concept of XML I/O for ROOT Concept of XML I/O for ROOT Possible implementations Possible implementations Problems and questions Problems and questions Conclusion Conclusion

Using of XML for object store. S.Linev3 eXtensible Markup Language (XML) item text subitem text Example values: item1 “item text“ item2 id="001" subitem “subitem text“ item3 ref="001" Tree like structure (not ROOT tree) of text tags Each tag opened should be closed Tag can include other tags, contain text, has attributes In addition: DTD, XSLT, XML schema, namespaces, …

Using of XML for object store. S.Linev4 Document Type Definition (DTD) item text subitem text Used to validate structure of XML document Defines legal building blocks of an XML document like valid elements names list of element subitems list of element attributes allowed values for attributes

Using of XML for object store. S.Linev5 XML packages C/C++ based XML packages: libxml (Gnome) libxml (Gnome) Xerces-C++ (Apache) Xerces-C++ (Apache) expat (Mozilla) expat (Mozilla) Benchmarks of XML packages (less is better)

Using of XML for object store. S.Linev6 Usage of libxml2 library Example of code to create XML file: xmlDocPtr fDoc = xmlNewDoc(0); xmlNodePtr fNode = xmlNewDocNode(fDoc, 0, (const xmlChar*) "Example", 0); xmlDocSetRootElement(fDoc, fNode); xmlNewTextChild(fNode, 0, (const xmlChar*) "item1",(const xmlChar*) "item text"); xmlNodePtr sub2 = xmlAddChild(fNode, xmlNewNode(0, (const xmlChar*) "item2")); xmlNewTextChild(sub2, 0, (const xmlChar*) "subitem", (const xmlChar*) "subitem text"); xmlNewProp(sub2, (const xmlChar*) "id", (const xmlChar*) "001"); xmlNodePtr sub3 = xmlAddChild(fNode, xmlNewNode(0, (const xmlChar*) "item3")); xmlNewProp(sub3, (const xmlChar*) "ref", (const xmlChar*) "001"); xmlSaveFormatFile("Example.xml", fDoc, 1); xmlFreeDoc(fDoc);

Using of XML for object store. S.Linev7 XML and ROOT XML and ROOT XML as metadata storage place: configuration, parameters and geometry objects XML as metadata storage place: configuration, parameters and geometry objects XML files can be viewed and edited (with some restriction) with standard XML tools XML files can be viewed and edited (with some restriction) with standard XML tools Data exchange between different packages Data exchange between different packages But currently: There is no XML support in ROOT (yet) There is no XML support in ROOT (yet) Each new class requires its own XML streamer Each new class requires its own XML streamer

Using of XML for object store. S.Linev8 Motivation ROOT has all class information in TStreamerInfo class with methods to serialize/deserialize objects ROOT has all class information in TStreamerInfo class with methods to serialize/deserialize objects Why not implement similar mechanism for XML, not only for binary ROOT format? Why not implement similar mechanism for XML, not only for binary ROOT format? Aim – introduce XML I/O in ROOT, where user should not write I/O code himself Aim – introduce XML I/O in ROOT, where user should not write I/O code himself

Using of XML for object store. S.Linev9 Object representation in XML class TXmlExample { public: public: Int_tfValue; Int_tfValue; Double_tfArray[5]; Double_tfArray[5]; TStringfStr; TStringfStr; TXmlExample*fSelfPtr; TXmlExample*fSelfPtr; ClassDef(TXmlExample, 1); ClassDef(TXmlExample, 1);}; class name object id basic type string (special case) pointer array

Using of XML for object store. S.Linev10 First implementation New class with two functions similar to TStreamerInfo::WriteBuffer() and TStreamerInfo::ReadBuffer() were implemented to serialize/deserialize objects to/from XML structures New class with two functions similar to TStreamerInfo::WriteBuffer() and TStreamerInfo::ReadBuffer() were implemented to serialize/deserialize objects to/from XML structures Libxml2 library was used Libxml2 library was used Requires no any ROOT modifications Requires no any ROOT modifications

Using of XML for object store. S.Linev11 Problems Only relatively “simple” objects can be stored Only relatively “simple” objects can be stored Custom streamers are not supported Custom streamers are not supported As a result, ROOT classes like histograms (TH1), containers (TObjArray) and many other can not be supported As a result, ROOT classes like histograms (TH1), containers (TObjArray) and many other can not be supported

Using of XML for object store. S.Linev12 TBuffer class modification Make six methods of TBuffer virtual: Make six methods of TBuffer virtual: voidWriteObject(const void *actualObjStart, TClass *actualClass); void*ReadObjectAny(const TClass* cast); Int_tCheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss); voidSetByteCount(UInt_t cntpos, Bool_t packInVersion = kFALSE); Version_t ReadVersion(UInt_t *start = 0, UInt_t *bcnt = 0); UInt_tWriteVersion(const TClass *cl, Bool_t useBcnt = kFALSE); Redefine these methods in new TXmlBuffer class to perform XML specific actions Redefine these methods in new TXmlBuffer class to perform XML specific actions To support “TFile-like” key organization, new TXmlFile and TXmlKey classes have been created To support “TFile-like” key organization, new TXmlFile and TXmlKey classes have been created

Using of XML for object store. S.Linev13 Example with TObjArray TObjArray arr; arr.Add(new TNamed("name1", "title1")); arr.Add(new TNamed("name2", "title2")); arr.Add(new TNamed("name3", "title3")); TXmlFile file("test.xml","1xxox"); file.Write(&arr, "array"); Part of TObjArray streamer (writing): … fName.Streamer(b); nobjects = GetAbsLast()+1; b << nobjects; b << fLowerBound; … Now only version, later full class info XmlKey with name and setup infoTObjArray tag with version

Using of XML for object store. S.Linev14 Consequence of TBuffer modification Most of ROOT classes can be stored Most of ROOT classes can be stored Users classes with custom streamers can be supported Users classes with custom streamers can be supported Works, if reading and writing parts of custom streamer have similar sequence of I/O actions (normal situation) Works, if reading and writing parts of custom streamer have similar sequence of I/O actions (normal situation) Some classes like TTree & TClonesArray are not tested and may be not required to be stored in XML format Some classes like TTree & TClonesArray are not tested and may be not required to be stored in XML format At worse case 10% lost of I/O performance At worse case 10% lost of I/O performance Still not fully acceptable because: this is just “hacking” of ROOT code this is just “hacking” of ROOT code TXmlFile and TXmlKey repeats a lot of functionality of similar TFile and TKey classes TXmlFile and TXmlKey repeats a lot of functionality of similar TFile and TKey classes

Using of XML for object store. S.Linev15 Further investigations Producing of DTD files for validation purposes Producing of DTD files for validation purposes Using of XML namespaces to avoid names intersection Using of XML namespaces to avoid names intersection Extension of TFile and TKey logic on XML files (via abstract interfaces) Extension of TFile and TKey logic on XML files (via abstract interfaces) C++ code generator for XML I/O to access ROOT objects outside a ROOT environment C++ code generator for XML I/O to access ROOT objects outside a ROOT environment Support of different XML packages Support of different XML packages

Using of XML for object store. S.Linev16 Conclusion There is no general XML I/O in ROOT There is no general XML I/O in ROOT Very limited solution possible without ROOT changing Very limited solution possible without ROOT changing With slight TBuffer modifications acceptable XML support in ROOT is possible With slight TBuffer modifications acceptable XML support in ROOT is possible Further investigations required Further investigations required