Getting Started with XML: a Manual and Workshop

Total Page:16

File Type:pdf, Size:1020Kb

Getting Started with XML: a Manual and Workshop Getting Started with XML: A Manual and Workshop Eric Lease Morgan Getting Started with XML: A Manual and Workshop by Eric Lease Morgan This manual is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as pub- lished by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This manual is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied war- ranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this manual if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Special thanks go to David Cherry, a long-time friend, who provided the drawings. Lori Bowen Ayre deserves a round of applause for providing editorial support. Infopeople are the folks who sponsored the whole thing. Roy Tennant helped with proofreading. Thank you! --ELM For possibly more up-to-date information see the Getting Started With XML home page [http://infomotions.com/musings/getting-started/] . Editions: 1. The first public release of this document was dated Saturday, February 22, 2003. 2. The second edition was dated Monday, April 21, 2003 (Dingus Day). 3. This is the third edition of this document, Sunday, October 26, 2003 (getting ready for MCN). 4. This is the fourth edition of this document, Tuesday, 27, 2004 (Shining a LAMP on XML 'n Monterey). Table of Contents Preface ....................................................................................................................vii About the book ................................................................................................. vii About the author .............................................................................................. viii Disclaimer ...................................................................................................... viii I. General introduction to XML ...................................................................................... 1 1. Introduction .................................................................................................... 3 What is XML and why should I care? ............................................................. 3 2. A gentle introduction to XML markup ................................................................. 6 XML syntax ...............................................................................................6 XML documents always have one and only one root element .............................. 6 Element names are case-sensitive ................................................................... 7 Elements are always closed ........................................................................... 7 Elements must be correctly nested .................................................................. 7 Elements' attributes must always be quoted ...................................................... 8 There are only five entities defined by default ................................................... 8 Namespaces ...............................................................................................8 XML semantics .......................................................................................... 9 Exercise - Checking XML syntax ................................................................. 10 3. Creating your own markup .............................................................................. 11 Purpose and components ............................................................................ 11 Exercise - Creating your own XML mark up .................................................. 13 4. Document type definitions ............................................................................... 15 Defining XML vocabularies with DTDs ........................................................ 15 Names and numbers of elements .................................................................. 16 PCDATA ................................................................................................ 17 Sequences ................................................................................................ 17 Putting it all together ................................................................................. 17 Exercise - Writing a simple DTD ................................................................. 19 Exercise - Validating against a system DTD ................................................... 20 Exercise - Fixing an XML document by hand ................................................. 20 II. Stylesheets with CSS & XSLT ................................................................................. 22 5. Rendering XML with cascading style sheets ....................................................... 24 Introduction ............................................................................................. 24 display .................................................................................................... 25 margin .................................................................................................... 26 text-indent ............................................................................................... 26 text-align ................................................................................................. 26 list-style .................................................................................................. 26 font-family .............................................................................................. 27 font-size .................................................................................................. 27 font-style ................................................................................................. 27 font-weight .............................................................................................. 27 Putting it together ...................................................................................... 28 Tables ..................................................................................................... 29 Exercise - Displaying XML Using CSS ......................................................... 30 6. Transforming XML with XSLT ........................................................................ 32 Introduction ............................................................................................. 32 A few XSLT elements ................................................................................ 32 Exercise - Hello, World .............................................................................. 33 Exercise - XML to text ............................................................................... 34 Exercise - XML to text, redux ..................................................................... 36 Exercise - Transform an XML document into XHTML .................................... 37 Yet another example .................................................................................. 40 iv Getting Started with XML: A Manual and Workshop Exercise - Transform an XML document with an XSLT stylesheet ..................... 42 Displaying tabular data ............................................................................... 42 Manipulating XML data ............................................................................. 44 Using XSLT to create other types of text files ................................................. 46 Exercise - XML to XHTML ........................................................................ 47 Exercise - Displaying TEI files in your browser .............................................. 47 Exercise - Transform MODS into XHTML .................................................... 48 III. Specific XML vocabularies .................................................................................... 49 7. XHTML ...................................................................................................... 51 Introduction ............................................................................................. 51 Exercise - Writing an XHTML document ...................................................... 54 Exercise - Convert MARC to XHTML .......................................................... 55 Exercise - Tranform MARCXML-like (SFX) to XHTML ................................. 55 8. MARCXML ................................................................................................. 56 About MARCXML ................................................................................... 56 Exercise - Convert MARC to MARCXML ..................................................... 58 Exercise - Validating schema ....................................................................... 58 9. MODS ......................................................................................................... 59 About MODS ........................................................................................... 59 Exercise - Transform MARCXML to MODS ................................................. 60 Exercise - Transform MARCXML to MODS, redux ........................................ 60 10. EAD .......................................................................................................... 62 Introduction ............................................................................................
Recommended publications
  • OWL 2 Web Ontology Language Quick Reference Guide
    OWL 2 Web Ontology Language Quick Reference W3C Proposed Recommendation 22 September Guide 2009 OWL 2 Web Ontology Language Quick Reference Guide W3C Proposed Recommendation 22 September 2009 This version: http://www.w3.org/TR/2009/PR-owl2-quick-reference-20090922/ Latest version: http://www.w3.org/TR/owl2-quick-reference/ Previous version: http://www.w3.org/TR/2009/WD-owl2-quick-reference-20090611/ (color-coded diff) Editors: Jie Bao, Rensselaer Polytechnic Institute Elisa F. Kendall, Sandpiper Software, Inc. Deborah L. McGuinness, Rensselaer Polytechnic Institute Peter F. Patel-Schneider, Bell Labs Research, Alcatel-Lucent Contributors: Li Ding, Rensselaer Polytechnic Institute Ankesh Khandelwal, Rensselaer Polytechnic Institute This document is also available in these non-normative formats: PDF version, Reference Card. Copyright © 2009 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply. Abstract The OWL 2 Web Ontology Language, informally OWL 2, is an ontology language for the Semantic Web with formally defined meaning. OWL 2 ontologies provide classes, properties, individuals, and data values and are stored as Semantic Web documents. OWL 2 ontologies can be used along with information written in RDF, and OWL 2 ontologies themselves are primarily exchanged as RDF documents. The OWL 2 Document Overview describes the overall state of OWL 2, and should be read before other OWL 2 documents. Page 1 of 15 http://www.w3.org/TR/2009/PR-owl2-quick-reference-20090922/ OWL 2 Web Ontology Language Quick Reference W3C Proposed Recommendation 22 September Guide 2009 This document provides a non-normative quick reference guide to the OWL 2 language.
    [Show full text]
  • Markup Languages & HTML
    INTERNET & WEB APPLICATION DEVELOPMENT SWE 444 Fall Semester 2008-2009 (081) Module 2: Markup Languages & HTML (()II) Dr. El-Sayed El-Alfy Computer Science Department King Fahd University of Petroleum and Minerals [email protected] Objectives/Outline y Objectives y Outline ◦ … ◦ … ◦ Create pages that have ◦ HTML Elements frames x Frames ◦ Create pages that have x Forms forms to collect user inputs x Head Element ◦ Use meta data to improve x Meta data search engine results and to x <!DOCTYPE> tag redirect a user ◦ Use the <!DOCTYPE> to declare the DTD KFUPM-081© Dr. El-Alfy 1 Frames ¾ Allow the browser window to be divided into an independent set of frames ¾ More than one HTML document can be displayed in the same browser window ¾ Frequently used to add a menu bar to a web site where the constant back and forth clicking would become tedious in a single page. ¾ Allow easier navigation under some circumstances ¾ The designer can divide the window horizontally and vertically in various ways, e.g. ¾ The disadvantages of using frames are: ◦ The web developer must keep track of many HTML documents ◦ It is difficult to print/bookmark the entire page KFUPM-081© Dr. El-Alfy SWE 444 Internet & Web Application Development 2.3 Frames (cont.) ¾ The <frameset> tag ◦ Defines how to divide the window into frames ◦ Each frameset defines a set of rows or columns ◦ The values of the rows/col umns iidindicate the amount of screen area each row/column will occupy ¾ The <frame> tag ◦ Defines what HTML document to put into each frame ¾ Useful tips ◦ If a frame has visible borders, the user can resize it by dragging the border ◦ To prevent a user from resizing a frame, add noresize="noresize" to the <frame> tag ◦ Add the <noframes> tag for browsers that do not support frames KFUPM-081© Dr.
    [Show full text]
  • SLA Information Technology Division Metadata for Video: Too Much
    3/1/2019 Metadata for Video: Too Much Content, Not Enough Information | SLA Information Technology Division Home About Us » Events » Sections » Enter search keyword SLA Information Technology Division Awards » Making Edgier Easier. We're IT! Current b/ITe (v31n5) » b/ITe Archives Virtual Events What’s New Categorized | Uncategorized Metadata for Video: Too Much Content, Not Enough Information Posted on 31 August 2012. by Wayne Pender, McGill University, 2012 Joe Ann Clifton Student Award Winner (Published September 1, 2012) Abstract Television news libraries have struggled with cataloguing, organizing and storing visual materials for efficient search and retrieval for years. This task has been complicated by the emergence of digital video and the exponential growth in the holdings of television news libraries. In parallel, the ability for non-professionals to shoot, edit and publish videos of increasing production value and complexity on the web has flooded the Internet with videos that appeal to a wide audience and subject interest. The present survey looks at the metadata protocols and practices in place for an internal audience in professional operations and on display for the general public on the Internet. The study finds that the lack of a common metadata schema can make much of the material inaccessible. Literature pertaining to this area is reviewed and future direction is discussed. http://it.sla1.org/2012/08/metadata/ 1/10 3/1/2019 Metadata for Video: Too Much Content, Not Enough Information | SLA Information Technology Division Keywords: metadata, video, XML, RDF, MXF, television, news, YouTube Paper Searching and retrieving visual content is problematic. The search for specific moving images on film and video has long been a task for television news professionals, but now with wide spread availability of video resources on the Internet it has become a task for anyone.
    [Show full text]
  • Instruction for Using XML Notepad
    Using XML Notepad to Read, Edit, and Parse FGDC-CSDGM XML Metadata. Currently many tools exist that allow a user to work with XML metadata files. However, most of the main metadata creation/editing tools do not provide a means of validating a metadata record for compliance with the FGDC-CSDGM standard or its variants, such as the Biological Data Profile (BDP) standard. One of the most reliable ways to validate metadata files (that is, check files for completion and/or errors) is with the USGS Metadata Parser (MP) utilities. The MP tool and the other tools distributed in the package were developed by Peter Schweitzer and are freely available online (http://geology.usgs.gov/tools/metadata/tools/doc/mp.html). Once configured properly, MP can process metadata files and be used to produce a text file with a list of all errors found. A user can then use this list of errors to find and correct the problems using a text editor or the metadata editor of their choice. The challenge with this method is that finding and correcting the error within a metadata editor based solely on the error message from MP can be confusing and frustrating. Additionally, if there are many errors or complex problems to correct, the process will require multiple iterations of running MP and subsequently correcting errors in a metadata editor. All in all, the process can be fairly time consuming and onerous, especially for those without a detailed understanding of the FGDC-CSDGM standard. The methodology for metadata editing and validation described in this document tries to address some of these problems with an alternative approach.
    [Show full text]
  • Cisco XML Schemas
    CHAPTER 14 Cisco XML Schemas This chapter contains information about common XML schemas. The structure and allowable content of the XML request and response instances supported by the Cisco IOS XR XML application programming interface (API) are documented by means of XML schemas (.xsd files). The XML schemas are documented using the standard World Wide Web Consortium (W3C) XML schema language, which provides a much more powerful and flexible mechanism for describing schemas than can be achieved using Document Type Definitions (DTDs). The set of XML schemas consists of a small set of common high-level schemas and a larger number of component-specific schemas as described in this chapter. For more information on the W3C XML Schema standard, see this URL: http://www.w3.org/XML/Schema This chapter contains these sections: • XML Schema Retrieval, page 14-135 • Common XML Schemas, page 14-136 • Component XML Schemas, page 14-136 XML Schema Retrieval The XML schemas that belong to the features in a particular package are obtained as a .tar file from cisco.com. To retrieve the XML schemas, you must: 1. Click this URL to display the Downloads page: http://tools.cisco.com/support/downloads/go/Redirect.x?mdfid=268437899 Note Select Downloads. Only customer or partner viewers can access the Download Software page. Guest users will get an error. 2. Select Cisco IOS XR Software. 3. Select IOS XR XML Schemas. 4. Select the XML schema for your platform. Once untarred, all the XML schema files appear as a flat directory of .xsd files and can be opened with any XML schema viewing application, such as XMLSpy.
    [Show full text]
  • Modularization of XHTML in XML Schema Modularization of XHTML™ in XML Schema
    Modularization of XHTML in XML Schema Modularization of XHTML™ in XML Schema Modularization of XHTML™ in XML Schema W3C Working Draft - 22 March 2001 This version: http://www.w3.org/TR/2001/WD-xhtml-m12n-schema-20010322 (Single HTML file [p.1] , PostScript version, PDF version, ZIP archive, or Gzip’d TAR archive) Latest version: http://www.w3.org/TR/xhtml-m12n-schema Editors: Daniel Austin, Mozquito Technologies AG Shane McCarron, Applied Testing and Technology Copyright ©2001 W3C® (MIT, INRIA, Keio), All Rights Reserved. W3C liability, trademark, document use and software licensing rules apply. Abstract This document describes a methodology for the modularization of XHTML using XML Schema. Modularization of XHTML allows document authors to modify and extend XHTML in a conformant way. Status of This Document This section describes the status of this document at the time of its publication. Other documents may supersede this document. The latest status of this document series is maintained at the W3C. This is the first public "Working Draft" of "Modularization of XHTML in XML Schema" for review by members of the W3C and other interested parties in the general public. It is a stand-alone document to ease its review. Once the methodology described in this document become mature, it will be integrated into a future document forthcoming from the HTML Working Group. This document is still in its early stage, and may be updated, replaced, or obsoleted by other documents at any time. Publication of this Working Draft does not imply endorsement by the W3C, and it is inappropriate to use W3C Working Drafts as reference material or to cite them as other than "work in progress".
    [Show full text]
  • The Development of Algorithms for On-Demand Map Editing for Internet and Mobile Users with Gml and Svg
    THE DEVELOPMENT OF ALGORITHMS FOR ON-DEMAND MAP EDITING FOR INTERNET AND MOBILE USERS WITH GML AND SVG Miss. Ida K.L CHEUNG a, , Mr. Geoffrey Y.K. SHEA b a Department of Land Surveying & Geo-Informatics, The Hong Kong Polytechnic University, Hung Hom, Kowloon, Hong Kong, email: [email protected] b Department of Land Surveying & Geo-Informatics, The Hong Kong Polytechnic University, Hung Hom, Kowloon, Hong Kong, email: [email protected] Commission VI, PS WG IV/2 KEY WORDS: Spatial Information Sciences, GIS, Research, Internet, Interoperability ABSTRACT: The widespread availability of the World Wide Web has led to a rapid increase in the amount of data accessing, sharing and disseminating that gives the opportunities for delivering maps over the Internet as well as small mobile devices. In GIS industry, many vendors or companies have produced their own web map products which have their own version, data model and proprietary data formats without standardization. Such problem has long been an issue. Therefore, Geographic Markup Language (GML) was designed to provide solutions. GML is an XML grammar written in XML Schema for the modelling, transport, and storage of geographic information including both spatial and non-spatial properties of geographic features. GML is developed by Open GIS Consortium in order to promote spatial data interoperability and open standard. Since GML is still a newly developed standard, this promising research field provides a standardized method to integrate web-based mapping information in terms of data modelling, spatial data representation mechanism and graphic presentation. As GML is not for data display, SVG is an ideal vector graphic for displaying geographic data.
    [Show full text]
  • Determining the Output Schema of an XSLT Stylesheet
    Determining the Output Schema of an XSLT Stylesheet Sven Groppe and Jinghua Groppe University of Innsbruck, Technikerstrasse 21a, A-6020 Innsbruck, Austria {Sven.Groppe, Jinghua Groppe}@uibk.ac.at Abstract. The XSLT language is used to describe transformations of XML documents into other formats. The transformed XML documents conform to output schemas of the used XSLT stylesheet. Output schemas of XSLT stylesheets can be used for a static analysis of the used XSLT stylesheet, to automatically detect the XSLT stylesheet, which has been used for the trans- formation, of target XML documents or to reason on the output schema without access to the target XML documents. In this paper, we describe how to auto- matically determine such an output schema of a given XSLT stylesheet, where we only consider XML to XML transformations. The input of our proposed output schema generator is the XSLT stylesheet and the schema of the input XML documents. The experimental evaluation shows that our prototype can de- termine the output schemas of nearly all typical XSLT stylesheets. 1 Introduction Among other usages of XML, XML is the most widely used data model for exchang- ing data on the web and elsewhere. For the exchange of data, we have to transform the data from one format into another format whenever the two exchange partners use different formats. The exchange partners can use different formats, which might be a proprietary company standard, a proprietary application format or other standard for- mats, for historical, political or other reasons. We focus on XSLT [23] as transforma- tion language for the XML data.
    [Show full text]
  • XHTML+Rdfa 1.1 - Third Edition Table of Contents
    XHTML+RDFa 1.1 - Third Edition Table of Contents XHTML+RDFa 1.1 - Third Edition Support for RDFa via XHTML Modularization W3C Recommendation 17 March 2015 This version: http://www.w3.org/TR/2015/REC-xhtml-rdfa-20150317/ Latest published version: http://www.w3.org/TR/xhtml-rdfa/ Implementation report: http://www.w3.org/2010/02/rdfa/wiki/CR-ImplementationReport Previous version: http://www.w3.org/TR/2014/PER-xhtml-rdfa-20141216/ Previous Recommendation: http://www.w3.org/TR/2013/REC-xhtml-rdfa-20130822/ Editor: Shane McCarron, Applied Testing and Technology, Inc., [email protected] Please check the errata for any errors or issues reported since publication. This document is also available in these non-normative formats: XHTML+RDFa, Diff from Previous Recommendation, Postscript version, and PDF version The English version of this specification is the only normative version. Non-normative translations may also be available. Copyright © 2007-2015 W3C® (MIT, ERCIM, Keio, Beihang). W3C liability, trademark and document use rules apply. Abstract RDFa Core 1.1 [RDFA-CORE [p.61] ] defines attributes and syntax for embedding semantic markup in Host Languages. This document defines one such Host Language. This language is a superset of XHTML 1.1 [XHTML11-2e [p.61] ], integrating the attributes as defined in RDFa Core 1.1. This document is intended for authors who want to create XHTML Family documents that embed rich semantic markup. - 1 - Status of This Document XHTML+RDFa 1.1 - Third Edition Status of This Document This section describes the status of this document at the time of its publication.
    [Show full text]
  • 101 Ways to Promote Your
    Increase Your Real Estate Sales Online! 101 Ways to Promote Your Real Estate Web Site Web Real Estate Your to Promote Ways 101 An increasing number of real estate buyers and sellers are making This Book and Web Site 101 Ways to Promote Your the Web their first destination. So now is the time to stake your Will Help You: claim in the Internet land rush with an effective and well-promoted • Draw more buyers and sellers to your Web site. Getting potential customers to visit Web site rather your Web site than those of your competitors can mean thousands of additional • Optimize your site for real estate-specific search engines commission dollars in your pocket every month. • Learn what techniques work best in the “Great stuff! online real estate arena Real Esta t e Practical, powerful • Make effective marketing use of In 101 Ways to Promote Your Real Estate Web Site, widely tips on growing newsgroups, mail lists, meta indexes, sales from your Web recognized expert Susan Sweeney provides proven promotion e-zines, Web rings, cybermalls, site. Get it!” techniques that help you draw buyers and sellers to your real estate podcasting, blogs, wikis, mobile, autoresponders, banner exchange Web site. If you deal in either residential or commercial real estate programs, and more — Randy Gage, author of as an agent, broker, or firm, this book (and it’s companion Web site) • Leverage the power of e-mail in real Prosperity Mind estate sales Web Site is exactly what you need. Bottom line, it will help you draw more • Use offline promotion to increase buyers and sellers to your Web site and increase your earnings.
    [Show full text]
  • Extending Expression Web with Add-Ons
    APPENDIX Extending Expression Web with Add-Ons Any good web editor must be extensible, because the Web is constantly changing. This capability is one of the strongest assets of Expression Web; it means that third parties can add new features that are easy to use inside of Expression Web. You don’t have to wait for Microsoft to release a new version to get more features. I am talking not about code snippets, like the one we created in Chapter 2, but about fea- tures that make it easy to add e-commerce capabilities using PayPal buttons or a shopping cart, improve your search engine ranking using Google Sitemaps, or add Flash banners and interactivity without becoming a programmer or a search engine specialist. Some of these add-ons are commercial applications that charge a fee, and others are created by someone who sees a need and creates a free add-on. At the time of this writing, there were over a dozen add-ons available for download and more actively under develop- ment. A current list is available at http://foundationsofexpressionweb.com/exercises/ appendix. Add-ons are usually easy to install and use. Once you have found an extension for Expression Web that offers you the ability to extend what you can do, download the add-on, and follow the extension maker’s instructions on how to install it. Most add-ons will have an installer that creates either a toolbar or an entry in one of the menus. Adding PayPal Buttons The first add-on I will show you creates a menu item.
    [Show full text]
  • Check Seo of Article
    Check Seo Of Article Forensic Hamilton girdle some viridescence and values his Latinists so delayingly! Stark-naked Westbrook never invaginatingdisguisings so foreknown etymologically ungainly. or muring any roomettes nauseously. Dolomitic Goddard autoclave, his shadoofs In your post is a drop in? Some of your posts are some other domains option, perform the top serp features cover it. We check out of seo article by nightwatch search engines but keep google only indexes and seos and match interested. As a article, of articles are unlimited focus of those pages? Google had low content in enterprise search index due to querystring parameters that shadow were passing along god the URL. SEO checklist on the internet. On page is kindergarten a few since many factors that search engines looks at are they build their index. How do I know that a particular page can be indexed? Irina Weber is Brand Manager at SE Ranking. It makes you frustrated when faculty receive affection with errors. This category only includes cookies that ensures basic functionalities and security features of the website. Google SEO Ranking Checker Our Free Google SEO Ranking Tool helps your find you top traffic driving keywords Enter a domain known to identify high. This makes it easy for readers to share your content continuously as they are reading down the page. This ensures that a wider audience will enjoy great content and acquit the headline but it shows up in Google results pages. Thanks for seo article title tag, checking tool can conduct readability score to click the articles are highly useful was of.
    [Show full text]