90 likes | 109 Views
This article explores the use of XML as a standard, text-based representation for network data, including integrating tools and enhancing interfaces. It also discusses the concept of a grid standard for network data.
E N D
Using XML as the Foundation for a NetworkResource Description Language Peter A. Dinda
Motivation • Network Resource Interface for external tools • A standard, text-based representation for network data • Integrating our own tools such as RPS • Integrating other tools such as NWS • Enhancing existing text-based interfaces • Potentially proposing a Grid standard Network data is structured data
XML in a Nutshell #1 • Standard for presenting structured information via tag-based markup • Like HTML, except user gets to define the tags and their grammar • “DTD” or “Schema” (can be part of doc) • Unlike HTML, “well-formed” XML is always a tree, so it’s easy to parse • Tags can be anything but must nest • Unlike HTML, no styles or links are defined • They are DTDs! XSL, Xlink, Xpointer, blah blah • Self-defining text-based structured data format
XML in a Nutshell #2 • “Well-formed” XML • It can be produced by the XML grammar • “Valid” XML • Well-formed and the document can be produced by your grammar (ie, the DTD) • Free XML parsers usually don’t “validate” • Probably not much of an issue for resource data • http://www.xml.com http://www.w3.org/XML/
XML Tools • Free parsers available for C, Java, Perl, Python • Lots of commercial stuff • Microsoft (IE4, IE5, XML Notepad, lots of others) • Most parsers/tools don’t support the DOM interface and so are not interchangeable
DTD/Schema Standardization • XSL (styles), Xlink/Xpointer (links), ... • DTDs being developed for very specific kinds of information • News stories • http://www.xmlnews.org/dtds/xmlnews-story.dtd • We could propose DTDs to the Grid Forum so that tools could exchange information
Proof of Concept • Wrote XML serialization for RPS’s LoadMeasurement objects • Used Expat, a free (non-validating) XML parser written in C
An XML Serialized LoadMeasurement <?xml version="1.0"?> <!DOCTYPE HostLoadList [ <!ELEMENT HostLoadList (HostLoadInfo)+> <!ELEMENT HostLoadInfo (Hostname, Period, SmoothingType, TimeStamp, Averages)> <!ELEMENT Period (#PCDATA)> <!ELEMENT SmoothingType (unix|mach)> <!ELEMENT TimeStamp (#PCDATA)> <!ELEMENT Averages (Average+)> <!ELEMENT Average (#PCDATA)> <!ATTLIST Average Number CDATA "0"> ]> <HostLoadList> <HostLoadInfo> <Hostname>pyramid.cmcl.cs.cmu.edu</Hostname> <Period>1000000</Period> <SmoothingType>1</SmoothingType> <TimeStamp>935508266.313773</TimeStamp> <Averages> <Average Number="-1">0.300000</Average> <Average Number="0">0.200000</Average> <Average Number="1">0.100000</Average> <Average Number="2">0.050000</Average> </Averages> </HostLoadInfo> </HostLoadList> DTD - the grammar for the HostLoadList document that follows Document - the serialized LoadMeasurement object