Lifecycle Metadata for Digital ObjectsWhat is the XML environment?Review of “orders” of dataRemember, XML “does” nothingXML can enable action: RSSXML in two wrapper modesWhy mark up the object itself?Why not mark up the object?Best of both worldsXML Syntax rules for well-formed XML*Structure of the XML Document*XML DeclarationDocument type declarationXML document elementsAttributes of XML elementsGeneral entities in the XML documentMiscellaneous markupNamespaces in the XML documentThe DTDElement declarations in the DTDAttribute declarations in the DTDEntity declarations in the DTDXML Tools for home useAmaya screenshotXML Cooktop editor screenshotHow does all this relate to databases?Exercise 1: Assemble toolsExercise 2: Mark something upLifecycle Metadata for Digital ObjectsOctober 2, 2006Implementing Metadata in XMLWhat is the XML environment?XML editor (XML editors can’t do anything automatic until you load a DTD or schema; but you can edit XML in any plain-text editor)XML parser (at a minimum; while XML must be well-formed, it does not have to be validated; available in some browsers)Display program (e.g. browser)DTD or schema to define elementsStyle sheet for display of elementsXSLT engine to convert to other formats (e.g. database, webpage)Review of “orders” of dataFirst-order: language (segmentation)Second-order: encodingThird-order: meaningFourth order: groups of 3 and/or 4Fifth order: functionNote that each order is “meta” with respect to the one below and “data” with respect to the one above (cf. Goedel)Hence you “mark up” the order you wish to objectivize and access (examples: TEI, EAD)Remember, XML “does” nothingXML is not proceduralXML structures informationXML can store information (but is not random-access)XML can be a package for sending informationXML can be part of a solution for formatting informationXML can enable action: RSSTo add an RSS feed:First create the information you want to feed in XMLThen get yourself harvested!Further information and other examples of XML in action from Libby PeterekXML in two wrapper modesThe XML document as metadata repositoryXML document contains all the metadata Objects themselves are in separate files pointed to by the document (XLinks)The XML document as the whole enchiladaObject is marked up in XML tooMetadata is added as additional elements to the original objectIs this always a good idea?Why mark up the object itself?The object is a textThe text is well-formed as a hierarchical structure (problem of overlaps not solved in XML)Advantage is that the object carries its own metadataWhy not mark up the object?The object is not a text!The object is a text, but the text is too complex to mark up in XML (hierarchical model doesn’t suit everything; “overlap” problem)Best of both worldsXML metadata tags for human-readable packagingXML metadata loaded into database for random-access processing(Text) object version marked up in XML as relevantOriginal (text) object and derivative(s) pointed to in separate file(s) for preservationXML Syntax rules for well-formed XMLAn element containing text or elements must have start and end tagsAn empty element’s single tag must have a slash (/) before the end bracketAll attribute values must be in quotesElements may not overlapIsolated markup characters may not appear in parsed contentElement names may not use all characters (some are forbidden), and case is significant*Structure of the XML Document*Document prologueXML declarationDocument type declarationPoints to root elementPoints to external standards (DTDs, namespaces)Lists special internally-defined elements and general entitiesDocument itselfBracketed by root element tags at beginning and endContains elements, attributes, entitiesNested, hierarchical structureXML DeclarationGives version of XML<?xml version=“1.0”?>Defines character encoding (optional)<?xml version=“1.0” encoding=“UTF-8”?>Indicates presence of other needed files (optional)<?xml version=“1.0” encoding=“UTF-8” standalone=“no”?>Document type declarationPoints first to root element<!DOCTYPE example>Then points to any extern a l source for definition of document structure (that is, a DTD or schema), either a local separate file pathname (SYSTEM) or the URL for a file on the network (PUBLIC)<!DOCTYPE example SYSTEM “c:\My Documents\classes\metadata\example.dtd”…>Then adds any overriding local elements or entities (internal subset) in square bracketsXML document elementsElements don’t need to be declared except to overrride DTDElements contain information (element tags simply bracket information)<name attribute=value>chardata</name>Empty elements (no data is contained, begin and end element tags are collapsed to one)<name attribute=value />Attributes of XML elementsElements don’t require attributes; some functions can be achieved by nesting subelements within elementsUsed to provide more details about an element; used to split off groups of elements for particular purposes (e.g., layout, search) <elementname attname=“value”>General entities in the XML documentExternal entities (e.g., imported text or other object) must be declared in document prologueThe “entity” behaves something like a “variable”; once defined, value can be referencedWithin the document, the entity name is used preceded by an ampersand:<greeting> Dear &name, </greeting>When the document is displayed or used, the entity value at the time will be substituted for the nameMiscellaneous markup<!--Comments--><![CDATA[Contains#$*^%*&%otherwise forbidden]]><?processinginstruction data?>Namespaces in the XML documentNamespaces must be declared before use: xmlns:name=“URI” then elements from namespace can be used in document as: <name:element>….</name:element>Scope is the element within which namespace is declared, plus descendant nodesNamespaces cannot be validated with a DTDThe DTDDocument Type Definition; not actually expressed in XMLProvides a lexicon of allowed elements and attributes for the XML document that refers to itDefines a content model for each elementLike declaration of data types in a programming language; allows you to define your own types (a private, or
View Full Document