`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 1 of 55
`
`EXHIBIT A
`EXHIBIT A
`
`
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 2 of 55
`
`fee.9-CV-00859-RTH DOCUN2S EECGNOs20/2255)aQesZs0loo
`
`
`
`*Code for Rot) TTTete
`TTMUR L)ae nT:
`CeeCrile
`Se Cue eneemt ROY
`
`
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 3 of 55
`
` Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 3 of 55
`
`XMLBible
`
`EET,
`
`tay
`2 OR
`SY PS5be PB, re
`
`
`
`
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 4 of 55
`
`XML’ Bible
`
`Elliotte Rusty Harold
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04)P9/22 Page 4 of 55
`
`
`
`
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 5 of 55 XML™Bible
`
`Published by
`IDG Books Worldwide,Inc.
`An International Data Group Company
`919 E. Hillsdale Blvd., Suite 400
`Foster City, CA 94404
`www. idgbooks .com (IDG Books Worldwide Website)
`Copyright © 1999 IDG Books Worldwide,Inc. All rights
`reserved. Nopart of this book,includinginterior
`design, cover design, and icons, may be reproduced or
`transmitted in any form, by any means(electronic,
`photocopying, recording, or otherwise) without the
`prior written permissionof the publisher.
`ISBN: 0-7645-3236-7
`Printed in the United States of America
`1098765
`1B/QU/QR/QQ/IN
`Distributed in the United States by IDG Books
`Worldwide,Inc.
`Distributed by CDG Books CanadaInc.for Canada; by
`Transworld Publishers Limited in the United Kingdom,
`by IDG Norge Books for Norway; by IDG Sweden Books
`for Sweden; by IDG Books Australia Publishing
`Corporation Pty. Ltd. for Australia and New Zealand; by
`TransQuest Publishers Pte Ltd.for Singapore,
`Malaysia, Thailand, Indonesia, and Hong Kong, by
`Gotop Information Inc.for Taiwan; by ICG Muse,Inc.
`for Japan;by Intersoft for South Africa; by Eyrolles for
`France; by International Thomson Publishing for
`Germany, Austria and Switzerland; by Distribuidora
`Cuspide for Argentina; by LR Internationalfor Brazil;
`by Galileo Libros for Chile; by Ediciones ZETA5.C.R.
`Ltda. for Peru; by WS Computer Publishing
`Corporation,Inc., for the Philippines; by
`Contemporanea de Ediciones for Venezuela; by
`Express ComputerDistributors for the Caribbean and
`WestIndies; by Micronesia Media Distributor, Inc. for
`Micronesia; by Chips ComputadorasS.A. de C.V. for
`Mexico; by Editorial Norma de Panama S.A. for
`Panama; by American Bookshopsfor Finland.
`
`-Sill
`
`WORLDWIDE
`
`is a registered trademark under exclusive
`license to IDG Books Worldwide, Inc. from
`International Data Group,Inc.
`
`:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 5 of 55
`
`For general information on IDG Books Worldwide’s
`books in the US., please call our Consumer Customer
`Service departmentat 800-762-2974. For reseller
`information, including discounts and premium sales,
`please call our Reseller Customer Service department
`at 800-434-3422.
`For information on where to purchase IDG Books
`Worldwide’s books outside the U.S., please contact our
`International Sales departmentat 317-596-5530or fax
`317-572-4002.
`For consumerinformation on foreign language
`translations, please contact our Customer Service
`departmentat 1-800-434-3422, fax 317-572-4002, or e-
`mail rights@idgbooks.com.
`For information onlicensing foreign or domestic rights,
`please phone +1-650-653-7098.
`For sales inquiries and special prices for bulk
`quantities, please contact ourSales departmentat 800-
`762-2974 or write to the address above.
`For information on using IDG Books Worldwide’s books
`in the classroom orfor ordering examination copies,
`please contact our EducationalSales departmentat
`800-434-2086 or fax 317-572-4005.
`For press review copies, authorinterviews, or other
`publicity information, please contact our Public
`Relations departmentat 650-653-7000 orfax 650-653-
`7500.
`For authorization to photocopyitems for corporate,
`personal, or educational use, please contact Copyright
`Clearance Center, 222 Rosewood Drive, Danvers, MA
`01923, or fax 978-750-4470.
`
`Library of Congress Cataloging-in-Publication Data
`Harold, Elliote Rusty.
`XMLbible / Elliote Rusty Harold.
`p.
`em.
`ISBN 0-7645-3236-7 (alk. paper)
`1. XML (Document markup language) I. Title.
`QA76.76.H94H34
`1999
`99-31021
`005.7°2-de2l
`cIP
`
`
`ISCLAIMER OF WARRANTY: THE PUBLISHER AND AUTHOR HAVE USED THEIR BEST
`
`LIMIT OF LIABILITY/D)
`
`EFFORTS IN PREPARING THIS BOOK. THE PUBLISHER AND AUTHOR MAKE NO REPRESENTATIONS OR
`
`
`COMPLETENESS OF THE CONTENTS OF THIS BOOK
`WARRANTIES WITH RESPECT TO THE ACCURACY OR
`
`
`
`
`AND SPECIFICALLY DISCLAIM ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
`PARTICULAR PURPOSE. THERE ARE NO WARRANTIES WHICH EXTEND BEYOND THE DESCRIPTIONS
`
`
`MAY BE CREATED OR EXTENDED BY SALES
`CONTAINED IN THIS PARAGRAPH. NO WARRANTY
`
`
`ACCURACY AND COMPLETENESS OF THE
`REPRESENTATIVES OR WRITTEN SALES MATERIALS. THE
`GUARANTEED OR
`
`
`INFORMATION PROVIDED HEREIN AND THE OPINIONS STATED HEREIN ARE NOT
`
`
`WARRANTED TO PRODUCE ANY PARTICULAR RESULTS, AND THE ADVICE AND STRATEGIES CONTAINED
`
`
`HEREIN MAY NOT BE SUITABLE FOR EVERY INDIVIDUAL. NEITHER THE PUBLISHER NOR AUTHOR SHALL
`
`
`BE LIABLE FOR ANY LOSS OF PROFIT OR ANY OTHER COMMERCIAL DAMAGES, INCLUDING BUT NOT
`
`
`LIMITED TO SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR OTHER DAMAGES.
`Trademarks: For Dummies, Dummies Man, A Referencefor the Rest of Us!, The Dummies Way, DummiesDaily,
`and related trade dress are registered trademarks or trademarksof IDG Books Worldwide,Inc. in the United
`States and other countries, and may not be used without written permission. All other trademarksare the
`propertyof their respective owners. IDG Books Worldwideis not associated with any product or vendor
`mentionedin this book.
`®
`
`
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 6 of 55
`
`Document 82-1 Filed 04/29/22 Page 6 of 55
`
`co
`In This Chapter
`elements
`
`Attributes
`
`Attributes versus
`
`Empty tags
`XSL
`+
`
`+
`
`+
`
`+
`
`
`
`
`
`
`Attributes,
`Empty Tags,
`and XSL
`Y
`
`ou can encodea given set of data in XMLin nearly
`an infinite numberof ways. There’s no oneright
`way to doit although some ways are more right than others,
`and some are more appropriatefor particular uses. In this
`chapter, we explore a different solution to the problem of
`marking up baseball statistics in XML, carrying over the
`baseball example from the previous chapter. Specifically,
`we will address the use of attributes to store information
`and empty tags to define element positions. In addition,
`since CSS doesn’t work well with content-less XML
`elements of this form, we'll examine an alternative —
`and more powerful —style sheet languagecalled XSL.
`
`Attributes
`In the last chapter, all data was categorized into the name of
`a tag or the contents of an element. This is a straightforward
`and easy-to-understand approach,but it’s not the only one.
`As in HTML, XML elements may haveattributes. An attribute
`is a name-value pair associated with an element. The name
`and the value are eachstrings, and no element may contain
`two attributes with the same name.
`You're already familiar with attribute syntax from HTML.For
`
`
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 7 of 55
`
`led OaZ9/22 Page 7 of 55
`
`Chapter 5 + Attributes, Empty Tags, and XSL
`
`‘hsa
`
`"
`
`NN NAME="East"> ague?
`<LEAGUE NAME="“American Le
`MM NAME="Red Sox" eaNatlsangeetall
`.
`imore"><
`"
`EAM NAME="Orioles” CITY="Balti
`EAM ManetRs CITY="New York"></TEAM>
`<TEAM NAME"Devil Rays” CTyterorontors</TEAM>
`COTVESTONS
`y
`Y="Toronto"></TEAM>
`
`</LEAGUE>
`
`Part | + Introducing XML
`
`It has four attributes,
`
`AeN
`ack
`
`the SRC attribute whose value is Cup. gif, the WIDTH attribute
`whosevalue is 89, the HEIGHT attribute whosevalueis 67, and the ALT attribute
`whosevalue is Cup of coffee. However, inXML-unlikeHTML-attributevalues
`must always bequoted andstarttags musthave matchingclosetags. Thus, the
`XMLequivalent of this tag is:
`<IMG SRC="cup.gif" WIDTH="89" HEIGHT="67" ALT="Cup of coffee"?
`Forexample,here areJoe Girardi’s 1998 statistics as attributes:
`tstic an attribute.
`utes if you choose to make each
`isti
`i
`</1MG@>
`r
`sta’
`
`Players will havealot ofattrib i
`between HTML and XML is that XML assigns no particular
`tes. In particular, there’s no guarantee that
`ote
`Another difference
`meaningto the IMG tag andits attribu
`to load and display the
`GAMES="78" AT_BATS="254" RAEaETS="70"
`"
`u
`" Y
`” G |
`an XML browserwill interpret this tag as an instruction
`<PLAYER GIVEN NAME="Joe" SURNAME="Gi
`imagein thefile cup.gif.
`DOUBLES="11" TRIPLES="4" HOME_RUNS="3"
`You can applyattribute syntaxto the baseball example quiteeasily. This has the
`RUNS.BATTED_IN="31" WALKS="14" STRUCK_OUT="38"
`advantageof makingthe markup somewhat more concise. For example, instead of
`STOLENBASES="2" CAUGHT_STEALING="4"
`containing a YEAR child element, the SEASON element only needsa YEAR attribute.
`SACRIFICE_FLY="1" SACRIFICE_HIT="8"
`HIT_BY_PITCH="2">
`-
`</PLAYER>
`
`<SEASON YEAR="1998" 7
`</ SEASON?
`UE should be a child of the SEASON element rather than an
`attribute. For onething, there aretwo leagues in aseason. Anytimethere’slikelyto
`On the other hand, LEAG
`be morethan one of somethingchild elementsare called for. Attribute names must
`beuniquewithin an element.Thusyou should not, for example,write 4 SEASON
`
`elementlike this:
`
`Listingeslistnew SeOeoak for a complete XML documentcontaining
`information(i.e.,
`two leagues, six divisi
`ae aye rs) a2d
`t
`s for
`the
`major league season. It displ
`Listing4-1 in the last chapter. It is m
`teOreet shom
`ifor
`s
`,
`ons, 30 teams, andni
`1
`this documentloadedinto Internet Explorer 5.0 without a clesheet. ST shows
`I
`.
`erely markedupdifferently.
`Fi
`
`
`
`
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 8 of 55
`
`Chapter 5 @ Attributes, Empty Tags, and XSL
`
`99
`
`.
`
`<P
`
`S="5" WALKS="30"
`STRUCK_OUT="85"
`HIT_BY_PITCH="6">
`</PLAYER>
`OOSTOkeOnEteednantes" toonGAMESSpA
`AT_BATS="427" eld" GAMES="129" GAMES_STARTED="124"
`TRIPLES="1" H
`="69" HITS="117" DOUBLES="29"
`CAUGHT_STEA OME_RUNS="18" RBI="70" STEALS="5"
`SACRIFICE
`LING="3" SACRIFICE_HITS="0"
`STRUCK sure "66>HIT ERRORS="2" WALKS="56"
`</PLAYER>
`_BY_PITCH="3">
`CoCrOMeEnronBa Andres" SURNAME="Galarraga”
`TRIPLES="1" 40 UNS="103" HITS="169" DOUBLES="27"
`51
`AT_BATS="555"
`R
`ase" GAMES="153" GAMES_STARTED="151"
`CAUGHT_STEA
`ME_RUNS="44" RBI="121" STEALS="7"
`PARete ee Tete e
`STRUCK BUT 146" I ERRORS="11" WALKS="63"
`</PLAYER>
`T_BY_PITCH="25">
`OOSTTtONnThindBase’ GANESe"y"GuNeS
`AT BATS="13" R Base" GAMES="7" GAMES STARTED="2"
`TRIPLES="0"
`RUNS="2" HITS="4" DOUBLES="1"
`CAUGHT_STEA HOME RUNS="1" RBI="2" STEALS="0"
`ee LING="0" SACRIFICE_HITS="0"
`STRUCKOUR-PA®HIT. ERRORS="1" WALKS="0"
`K_OUT="4" HIT_BY_PITCH="0"
`=
`</PLAYER>
`-
`>
`
`Part | ¢ Introducing XML
`Listing 5-1: A complete XML documentthat uses attributes to
`store baseball statistics
`<?xml] version="1.0" standalone="yes"??
`<SEASON YEAR="1998">
`<LEAGUE NAME="National League">
`<DIVISION NAME="East"?
`<TEAM CITY="Atlanta" NAME="Braves">
`y" SURNAME="Mal loy"
`POSITION="Second Base” GAMES="11" GAMES_STARTED="8"
`<PLAYER GIVEN_NAME="Mart
`AT_BATS="28" RUNS="3" HITS="5" DOUBLES="1"
`TRIPLES="0" HOME_RUNS="1" RBI="1" STEALS="0"
`CAUGHT_STEALING="0" SACRIFICE_HITS="0"
`SACRIFICE_FLIES="0" ERRORS="0" WALKS="2"
`STRUCK_OUT="2" HIT_BY_PITCH="0">
`<PLAYER GIVEN_NAME="0zzie" SURNAME="Gui tien”
`</ PLAYER?
`POSITION="Shortstop” GAMES="83" GAMES_STARTED="59"
`AT_BATS="264" RUNS="35" HITS="73" DOUBLES="15"
`TRIPLES="1" HOME_RUNS="1" RBI="22" STEALS="1"
`CAUGHT_STEALING="4" SACRIFICE_HITS="4"
`SACRIFICE_FLIES="2" ERRORS="6" WALKS=" 24"
`STRUCK_OUT="25" HIT_BY_PITCH="1">
`<PLAYER GIVEN_NAME="Danny" SURNAME="Bautista”
`</PLAYER>
`POSITION="Outfield” GAMES="82" GAMES_STARTED="27"
`AT_BATS="144" RUNS="17" HITS="36" DOUBLES="11"
`TRIPLES="0" HOME_RUNS="3" RBI="17" STEALS="1"
`
`eae LT U-CV-UU0ODU-R 1H Document 82-1 Filed 04/ (22 Page 8 of 55
`
`</TEAM>
`<TEAM CITY="
`
`</TEAM>
`
`7
`
`.
`
`Florida” NAME="Marlins">
`
`”
`
`
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 9 of 55
`
`§=Wocument 82-1 Filed 04/2p/22
`
`Page 9 of 55
`
`Chapter 5 @ Attributes, Empty Tags, and XSL
`
`101
`
`Pati * IntroducingXML
`
`Listing 5-1 (continued)
`="
`t">
`.
`ORC vee ee "
`F="Diamondbacks >
`NAM
`<TEAM CITY= Arizona”
`CrEAM CiTY="Colorado NAME="Rockies
`AM?
`. NAME="Dodgers"?
`CTEAN CITY="Los Angeles
`AMcITY="San Diego"
`NAME Padres"?
`NAME="Giants"?
`STEAM ciTY="San Francisco
`
`"
`
`="
`
`=
`
`"»
`
`cy
`
`="
`
`"
`
`,
`
`TEAM>
`
`?
`
`EAM>
`
`Listing 5-1 uses only attributes for player information. Listing 4-1 used only element
`content. There are intermediate approachesas well. For example, you could make
`the player’s namepartof element content while leaving the rest of the statistics as
`attributes, like this:
`
`<P>
`On Tuesday <PLAYER GAMES="78" AT_BATS="254" RUNS="31"
`HITS="70" DOUBLES="11" TRIPLES="4" HOME_RUNS="3"
`RUNSBATTED_IN="31" WALKS="14" STRIKE_OUTS="38"
`STOLEN_BASES="2" CAUGHT_STEALING="4"
`SACRIFICE_FLY="1" SACRIFICE_HIT="8"
`HIT_BY_PITCH="2">Joe Girardi</PLAYER> struck out
`and...
`</P>
`
`twice
`
`This would include Joe Girardi’s namein the text of a page whilestill making his
`statistics available to readers who wantto look deeper, as a hypertext footnote or
`tool tip. There’s always more than one way to encodethe same data. Which way
`you pick generally depends on the needsof your specific application.
`
`Attributes versus Elements
`
`There are no hard andfast rules about whento use child elements and whento use
`attributes. Generally, you’ll use whicheversuits your application. With experience,
`you'll gain a feel for when attributes are easier than child elements and vice versa.
`Until then, one good rule of thumbis that the data itself should be stored in
`
`|
`
`
`
`
`
`
`
`</LEAGUE> see Cy UCT Tr)
`
`</TEAM>
`</DIVISTON>
`League"?
`i
`="
`<LEAGUE NAME= American
`<DIVISION NAME= East >
`.
`NAME="Orioles"?
`<TEAM ciTY="Baltimore
`ale CiTY="Boston NAME="Red SOX >
`AM?
`wo
`NAME="Yankees "?
`</TEAM>
`<TEAM CITY="New York
`"Devil Rays"?
`</TEAM>
`ChEAM ciTY="Tampa Bay
`NAME
`eycitY="Toronto” NAME="Blue Jays
`
`— a
`
`"
`
`.
`
`.
`
`_
`
`-_ W
`
`W >
`
`?
`
`</TEAM>
`
`
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 10 of 55
`
`Chapter 5 + Attributes, Empty Tags, and XSL
`
`103
`
`iL
`
`<DATE>
`<YEAR>1969</YEAR>
`<MONTH>O6</MONTH>
`<DAY>28</DAY>
`</DATE>
`
`For instance, with CSS
`,
`
`or XSL,it’s easy
`
`to f
`
`that only the year appears. For example, usingC88. Say and month invisibly so
`MONTH {display: None).
`
`:
`YEAR {display:
`
`n
`
`inli
`
`DAY {display: none}
`
`th
`
`:
`
`:
`
`ripu ’ h
`
`’
`
`2
`
`’
`
`_
`
`1guous.
`syntax is ambi
`
`hat doe:
`
`“
`
`”
`
`guarantee the peo
`
`‘
`
`chi
`children rather th
`
`i
`
`.
`
`cases, it
`
`i
`
`102 Patti introducing XML
`
`Structured Meta-data
`Oneimportant principal to rememberis that elements can have substructure and
`attributes can’t.This makes elements far more flexible, and may convinceyouto
`encode meta-data as child elements. For example, supposeyou're writing apaper
`andyouwantto include asourcefor afact. It might looksomethinglikethis:
`<FACT SOURCE="The Biographical History of B k: Carroll &
`Donald Dewey and Nicholas Acocella (New Yor
`Graf Publishers,
`Inc. 1995) P- 169">
`Josh Gibson is the only person in the history of baseball
`to
`hit a pitch out of Yankee Stadium.
`</FACTO
`Clearlytheinformation “TheBiographical Historyof Baseball, DonaldDewey and
`Nicholas Acocella (NewYork: Carroll &Graf Publishers, Inc. 1995) p. 169”is
`meta-data.It is not the factitself. Ratherit is information aboutthe fact. However,
`the SOURCEattribute containsalotof implicit substructure. You mightfind it more
`useful to organize the information like this:
`
`aseball,
`
`<SOURCE>
`CAUTHOR> Donald Dewey</AUTHOR>
`CAUTHORDNicholas Acocel 1a</AUTHOR?
`<BOOK><TITLE>The Biographical History of
`ZPAGES> 169</ PAGES?
`ZYEARD1995</Y EAR?
`
`Baseball</TITLE?
`
` ——_—_ SSSSe UV UOT dU ocument 82-1 Filed 04/2B/22 Page 10 of 55
`
`format, there’s no
`,
`
`Finally, using DATE
`,
`
`XML,by contrast,is unambiguous ple entering the data will enter it correctly. The
`associatedwit nanelement.Foranstance, scholarlyarticles aresitenreturnedfo
`Finally,usingare
`an attributes allows more th
`revised article was received. For example: aiso be Imortant fo note when the
`
`child elements of a DATE element, as shownbelow: difficult than reading
`
`
`
`Part! + IntroducingXML
`
`the ALT attribute of an IMG tag in HTML. This is
`ider
`picture is worth a thousand
`As anotherest rettes
`limited to a single string of text. However, given tha
`:
`ta
`eae
`.
`:
`words, you might well want to replace an IMG with marked uptext. For instance,
`
`Major League Baseball Positions
`
` tame t).| Filed OMPo22 Page 110f55
`
`consider the pie chart shownin Figure 5-2.
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 11 of 55
`
`Chapter 5 ¢ Attributes, EmptyTags, and xsL 105 iti
`
`<IMG SRC="05021.gif” WIDTH="819" HEIGHT="623">
`<ALT>
`<TABLE>
`<TR>
`<TD>Starting Pitcher</TD> <TD>242</TD> <TD>20%</TD>
`</TR>
`<TR>
`<TD>Relief Pitcher</TD> <TD>336</TD> <TD>27%</TD>
`</TR>
`<TR>
`<TD>Catcher</TD> <TD>104</TD> <TD>9%</TD>
`</TR>
`<TR>
`<TD>Outfield</TD> <TD>235</TD> <TD>19%</TD>
`</TR>
`<TR>
`<TD>First Base</TD> <TD>67</TD> <TD>6%</TD>
`</TR>
`<TR>
`<TD>Shortstop</TD> <TD>67</TD> <TD>6%</TD>
`</TR>
`<TR>
`<TD>Second Base</TD> <TD>88</TD> <TD>7%</TD>
`</TR>
`<TR>
`<TD>Third Base</TD> <TD>67</TD> <TD>6%</TD>
`</TR>
`</TABLE>
`</ALT>
`</IMG>
`
`
`
`
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 12 of 55
`
`
`AST
`5
`- ———— ee —
`=
`————
`
`5
`V-UU0
`
`oT —_
`-
`
`Document 82-1 Filed 04/
`
`Page 12 of 55
`
`Part! + Introducing XML
`
`However, if POET is an attribute rather than a child element, you re stuckwith
`unwieldy constructs like this:
`<POEM POET="Homer" POET_LANGUAGE="Engl ish"
`POEM_LANGUAGE="English">
`Tell me, O Muse, of the cunning man...
`</POEM>
`Andit’s even more bulky if youwant to provide both the poet’s English and Greek
`
`names.
`
`NGUAGE_1="English"
`"
`="
`POET_LA
`\GE_
`=
`EM POET_NAME_1="Homer
`<BOET NAME_2="Qpnos" POET_LANGUAGE_2= Greek
`M_LANGUAGE="English">
`een me, O Muse, of the cunning man...
`
`</POEM>
`
`What's Your Meta-data Is SomeoneElse’s Data
`“Metaness”is inthemindof thebeholder.Who6 readingyounatthaneweyer
`da’
`hat they consider to be
`i
`i
`ing
`they are readingit determines Ww
`'
`2 and asly journal
`?
`ly reading an article in a
`i
`nal,
`to be meta-data. For example,if you're simp
`artic
`a sch aever. if
`icle
`i
`tial to the informationit contains.
`if
`then the authorof the article is tangen
`Soe whos
`i
`i
`ttee scanning a journal
`to
`‘re
`sitting on a tenure and promotions commi
`yeblishing and whois not, then the names of the authors and the number orare)
`they've published may be more important to you than what they wrote (sai
`
`.
`
`
`
`Chapter 5 ¢ Attributes, Empty Tags, and XSL
`
`107 pees
`
`Although any such changewill probably require somerevision of your documents,
`style sheets, and associated programs,it’s still much easier to change a simple
`elementto a tree of elementsthanit is to make an attribute a tree of elements.
`However, if you used an attribute, then you’re stuck.It’s quite difficult to extend
`yourattribute syntax beyondthe region it was originally designedfor.
`
`Good Timesto Use Attributes
`Having exhaustedall the reasons why you should use elements instead of
`attributes, I feel compelled to point out that there are nonetheless some times when
`attributes makesense.Firstof all, as previously mentioned, attributes are fully
`appropriate for very simple data without substructure that the readeris unlikely to
`want to see. One example is the HEIGHT and WIDTH attributes of an IMG. Although
`the values of these attributes may changeif the image changes,it’s hard to imagine
`howthe datain the attribute could be anything more than a very shortstring of
`text. HEIGHT and WIDTH are one-dimensional quantities (in more ways than one) so
`they workwell as attributes.
`
`Furthermore,attributes are appropriate for simple information about the document
`that has nothing to do with the contentof the document. For example,it is often
`useful to assign an ID attribute to each element. Thisis a uniquestring possessed
`only by one element in the document. You can then use this string for a variety of
`tasks includinglinking to particular elements of the document, even if the elements
`move around as the document changesovertime. For example:
`
`<SOURCE ID="S1">
`<AUTHOR ID="Al">Donald Dewey</AUTHOR>
`
`
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 13 of 55
`
`led OF
`
`9/22
`
`Page 13 of 55
`
`Chapter 5 + Attributes, EmptyTags, and XSL
`
`109 i
`
`part + Introducing XML
`
`ed to store document-specific style information. For
`dered as bold text but if you want
`so often us
`Attributesare al
`E elements are generally ren
`t write something
`TITLE element both bold and italic, you migh
`example, if TITL
`to make just one
`like this:
`<TITLE styl e="font-style:
`1calic"™>Si gnifi cant Others</TITLE?
`e information to be embedded without changing the tree
`ent. While ideallyyou'dlike to use a separate element, this
`This enables the styl
`structure of the docum
`t authors somewhat more contro
`elementsto thetag setthey'reworkingwith. For example, theWebmaster of asite
`schemegives documen
`mightrequiretheuseofaparticularDTD andnotwantto alloweveryonetomodify
`theDTD. Nonetheless, theywantto allowthemto make minor adjustments to
`individual pages. Usethis schemewithrestraint, however, oryou'll soon find
`yourself backintheHTMLhellXMLwas supposedto saveUS from, where
`formattingis freely intermixed with meaning and documents are no longer
`maintainable.
`to maintain compatibility with HTML.To the
`least look similar to HTMLsuch as <IMG>, <P>,
`Thefinal reason to use attributesis
`and <TD>,you mig
`he standard HTMLattributes for thesetags.
`extent that you're using tags that at
`This has the double advantage of enablinglegacyprowsersto atleast partially
`ht as well employ t
`parseand displayyour document, andofbeingmorefamiliartothepeoplewriting
`
`the documents.
`
`
`
`
`
`
`
`
`
`SACRIFICE_FLY="1" SA
`
`vgn
`
`HIT_BY_PITCH="2"/> CRIFICE_HIT="8
`vecareeciacly identically to the non-empty equivalent. This PLAYER
`.
`ao
`y equal(thoughnotidentical) to the previous PLAY ER element
`formed with an emptytag.
`
`XML
`
`aoeeaeeToenos4RUNGEST" HITS=
`DOUBLES="11" TRIPLES="4"
`SNERUNS@“3"
`IPLES=
`HOME_RUNS="3"
`RUNS_BATTED_IN- "31 WALKS="14" STRUCK_OUT="38"
`STOLEN
`S="2"
`CAUGHT_STEALING="4" _
`S
`IFICE_FLY="1" SACRIFICE_HIT="8"
`IT_BY_PITCH="2"></PLAYER>
`Thediffme “teeetyoudon'the> and <PLAYER></PLAYER>is syntactic sugar,
`Seveeit
`iketheemptytagsyntax,orfind ithard to read,you
`
`Attrib
`
`XSL
`naeutesarevisiblecgo XML source view of the document as shownin Fi
`aesMetinpee at Sstylesheetisappliedtheattributesdisappear. Fi ue53
`Snead TtlookslikeeinepaseballStats stylesheetfromthepreviouschapteris
`content,ereIfyouuseCSS,anydatayouwanttoipo*hee
`app
`styles onl
`.
`:
`ocument
`becauseCSSstyl
`e part of an element’s content rather than oneofits attributes
`
`isi
`
`i
`
`
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 14 of 55
`
`SOCUNC nN
`
`°
`
`“Il Filed OM 9/22 Page 14 of 55
`
`Chapter 5 + Attributes, Empty Tags, and XSL
`
`111
`
`
`
`Part | + Introducing XML
`
`the XML document.
`
`ere is an alternative style sheet language that doesallow you to access
`data. This language is the Extensible Style Language (XSL);
`However,th
`5.0, at least in part. XSL is divided into
`and display attribute
`andit is also supported by Internet Explorer
`two sections, transformations and formatting.
`Thetransformation part ofXSLenablesyouto replaceonetagwith another.You
`can define rules that replaceyourXMLtagswith standard HTMLtags, OFwith
`HTMLtags plus CSS attributes.Youcan also do aJot moreincluding reorderingthe
`elements inthe document and adding additional contentthatwas never presentin
`The formatting part ofXSL defines an extremely powerfulview of documents as
`you to specify the appearance and layoutof a page
`includingmultiple columns,textflow aroundobjects,line spacing, assorted font
`pages. XSL formatting enables
`properties, andmore.It’s designedtobepowerfulenoughtohandleautomated
`layouttasks forboththeWeband print fromthe same source document. For
`instance, XSLformattingwould allow oneXML document containing show times
`and advertisements to generate both the print and online editionsof alocal
`newspaper's television listings. However,IE5.0 and most othertools do notyet
`supportXSLformatting. Therefore, in this sectionI'll focus onXSLtransformations.
`\
`XSLformatting is discussed in Chapter 15,XSL Formatting Objects.
`
`This ma
`
`i
`
`is very tyremyouot someserver-side include schemes for HTML. In fact, thi
`spurteXMLdocumenerieincludes. However,theactualtransformationofthe
`and
`XSLstyle sheet takes place on the client rather thanon
`
`?
`
`XSL instructions can retrieve any d
`
`i
`
`sanateslerncetcontenelementnames,and,mostTracortanthyforoasment
`y data stored in the elements
`Thiet
`SEtheSeee es. Particularelementsarechosenbyapatternthat
`sostere at aelative
`name,its value, its attributes’ names and values, its
`Fooe he date ‘Position in thetree structure of theXML document. and
`manipulated in avarietyofways WenanttcoverMNcathinaes copied, ae
`iaennantathisbriefintroduction.However,yuwilllearnto_sXSLto
`I
`;
`ft
`ways.
`r everythi
`i
`¢
`pretty amazing documentsthat can be viewed on the Web right wey
`iSeferonce\
`apter 14, XSL Transformations, covers XSL transformations in depth
`rf
`:
`‘Cross-
`
`\
`
`Ch
`
`The Body of the Document
`NyhbaseballstatisticsshowninListing5-1.Listing5-2isanXSLayiSheet.Tht
`it t
`KIN,
`>
`:
`pplying
`Let’s begin by looking at a simple example and applying
`eet provides the HTML moldinto which XMLdatawill bepoured. ims
`
`i
`
`| Listing 5-2: An XSL style sheet
`
`
`
`
`
`
`
`
` aSE
`
`-Cross-
`
`Reference \\
`
`XSL Style Sheet Templates
`AnXSLstyle sheet contains templates intowhich datafromtheXMLdocumentis
`
`
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 15 of 55
`
`|
`Chapter 5 + Attributes, EmptyTags,and XSL
`113
`lt
`
`Attaching the XSL style sh
`straigh
`i
`
`eet of Listing 5-2 to the XML document in Listing 5-1 is
`
`and an href attribute th
`
`i
`
`<A ozeanmailtorelharo@metal ab.unc.edu"?
`elharo@metalab.unc.edu
`
`smbles an HTML file included inside an
`3 its structure lookslike this:
`
`HTML file goes here
`
`ueEOamplyaceace\-s‘yle°heet?> processinginstructionwith a
`sheet between theXMLdeclaration and the root element. ForPemple:. the style
`cian version="1.0"2>
`CENSON ANSE ext/xsl"
`href="5-2.xs1"2>
`7This is the same way a CSSst
`difference is that the type attribute is text/xs1 instead ofDet): . only
`
`
`
`
`
`
`
`
`
`
`
`Maio Ene LFecatacam PSTP sri citseaeCoes
`|| Ee Eat Yew Favories
`‘Tods Heb
`
`
`
`
`|
`tack" Fowad
`Stop
`_Rekesh a | 2, ae 3 \ e
`e.2. 9 2 Al
`a |
`
`es
`tS]D\XMLBible\CD\source\O5tstyled51xml
`-
`=
`~
`=
`
`
` xslitemplate element. In other
`
`
`
`
`
`
`
`
`slistylesneet xmins:xsl="nttp://www.w3.org/TR/WO-xs1"?
`Major League Baseball
`.
`éxslitemplate match="/"?
`Statistics
`
`
`Copyright1999ElliatteRustyHarald
`
`ing5-2isnotonlyanXSLstylesheet;it’salsoawell-formedXMLdocument.
`|
`
`eginswithanXMLdeclaration.Therootelementofthisdocumentisxs]:
`|
`
`Figure5-4:ThedatafromtheXMLdocument,nottheXSL
`-odedasanxS|-templateelement.Thexsl:templateelementhasamatch
`|
`template,ismissingafterapplicationoftheXSLstylesheet
`i
`ributewiththevalue/anditscontentisawell-formedHTMLdocument.It’s
`|
`Listing5-2.
`eetin
`tacoincidencethattheoutputHTMLiswell-formed.BecausetheHTMLmust
`|
`;
`‘Vesheet.This stylesheetcontainsasingletemplatefortheXMLdata
`stbepartofanXSLstylesheet,andbecauseXSLstylesheetsarewell-formed
`
`TheTitle
`.
`
`
`{Ldocuments,alltheHTMLinaXSLstylesheetmustbewell-formed.
`.
`ieentiredocumentitself.Thebrowserreadsthetemplateandinsertsdatafrom
`BroughthestylesheetinListing5-2displaysmSONae5-4—thedata!
`
`,
`s1:templateelement.The/templatematchestherootofthedocument;thatis
`rsetherewassomethingratherobvious
`missi
`
`1eWebbrowsertriestomatchpartsoftheXMLdocumentagainsteach
`Ofcou
`h
`1eXMLdocumentwhereindicatedbyXSLinstructions.However,thisparticular”
`ca ofFigure5-3)itdoesn’tshowanydatafromtheXMLdoIketae
`»mplatecontainsnoXSLinstructions,soitscontentsaremerelycopiedverbatim
`apuneedtouseXSLinstructionelementstocopydatafr eeeToaddthis,
`ducingtheoutputyouseeinFigure5-4.NoticethatFigur
`HonintotheXSLtemplate.Listing5-3addstheneces:oeXSLineXM
`
`
`exml-stylesheet type="t
`
`"
`
`="
`
`"
`
`yle sheet is attached to a doc
`i
`
`
`
`
`
`|
`
`|
`
`|
`
`|
`
`|
`
`
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 16 of 55
`
`-U00DU-R 1H Document 82-1 Filed 04/29
`
`D2 Page 16 of 55
`
`|
`
`a
`
`pry
`
`Ss,
`
`113
`
`i4
`
`Attaching the XS
`eet of Listing 5-2 t
`straightforward. Si
`:
`:
`L style sh
`one
`o the XML d
`)
`. Simpl
`type attributewithvineteas?xml-stylesheet?> proce:mentinListing5-1 is
`sheet between theXML declariXS] and an hrefattribute that5 instruction with a
`ion and the root elem
`pointsto thestyl
`ent. For example:
`yle
`Lee
`YEAR="1998">
`1"
`href="5-2.xs1"?>
`<SEASON
`heet type="text/xs1"
`,
`
`This is the sameway a CSS style sheet is attached to a document. The only
`xt/
`
`<?xml version="1.0"?>
`<?xml-stylesh
`
`:
`
`Part! + Introducing XML
`
`5-4 does not display any
`
`Listing 5-2 (continued)
`ailto:e| haro@meta| ab.unc.edu"?
`<BR />
`<A HREF="M
`alharo@metatab.unc .edu
`</A>
`
`</HTML>
`</BODY>
`
`gixslistylesheet?
`
`ean xs -template elemen
`
`t. In other
`
`HTMLfile included insid
`It resembles anture looks like this:
`wordsits struc
`exslistylesneet 002gqenmttp: //uwww3.0rg/TR/WO-AST™?
`<?xml yersion="1.0"??
`éxsli template match="/"?
`HTML file goes here
`</xsl -template>
`</xsl -stylesheet?
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`
`AY Major League Baseb.
`eee cilSteftsth
`
`oth
`
`
`
`
`
`
`|
`
`
`Beav _ f ain arene
`a
`ne Loe
`iseee
`: i z
`: é
`oe = |
`
`ack
`Orwet
`top
`Reesh
`Home
`| Seach Favortes Histecy
`Mi :
`"|
`
`oF D \XMLABibIe\CD\source\O5\styled5-1 xml
`7
`ed
`
`=| @Ga
`|
`
`Statistics.
`Baseball
`Major Leagu e
`
` Copyright 1999 Elliotte Rust
`
`
`
`Iiotte
`
`Rusty Harele
`
`
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 17 of 55
`
`Page 17 of 55
`
`Chapter 5 + Attributes, Empty Tags, and XSL
`
`115
`
`
`
`
`
` e.°.906 4/4@ 89\e@
`
`_Fowerd Stop _Relresh_Home
`__Search Favortes Hitoy_| Mal
`|| Back”
`
`|| Address [37 D:\XMLBibleCD\source\05\stpled5-1 a
`
`
`1998 Major League Baseball
`Statistics
`
` opyright 1999
`
`elharqwine
`Elli
`elhiarc@metalab
`
`
`
`
`Figure 5-5: Listing 5-1 after application of the XSLstyle sheet
`in Listing 5-3
`
`
`
`
`
`
`
`
`
`These instructions appear twice because we want the year to appear twice in the
`output document-oncein the H1 header and oncein the TITLE. Each time they
`appear,these instructions do the same thing. <xs1:for-each select=" SEASON">
`finds all SEASON elements. <xs1:value-of select="@YEAR"/> inserts the value
`of the YEARattribute of the SEASON element —thatis, the string “1998” — found by
`<xsl:for-each select="SEASON">.
`This is important, so let me sayit again: x s1:for-each selects a particular XML
`element in the source document(Listing 5-1 in this case) from whichdata will be
`
` 714 Part! + Introducing XML
`
`
`
`BSGEE lies stics - Mictosoll Internet Exploter
`
`Listing 5-3: An XSLstyle sheet with instructions to extract the
`SEASON element and YEARattribute
`
`<?xml version="1.0"2>
`<xsl:stylesheet mins ixsle"http://www.w3.org/TR/WO-xs1">
`<xsl:template match="/">
`<HTML>
`<HEAD>
`<TITLE>
`<xsl:for-each select="SEASON">
`<xsl:value-of select="@YEAR"/>
`</xs1:for-each>
`——
`Major League Baseball Statistics
`</TITLE>
`</HEAD>
`<BODY>
`<xsl:for-each select="SEASON">
`<H1>
`<xsl:value-of select="@YEAR"/>
`Major League Baseball Statistics
`</H1>
`</xs1:for-each>
`
`<HR></HR>
`Copyright 1999
`<A MREF="http://www.macfag.com/personal whtm) ">
`
`
`
`[2] DAXMLIBible\CD\source\O5\styled-1 amleaMele, Ca
`
`Stop
`
`
`
`=
`
`Parti + Introducing XML
`Statistics
`O94
`Major Leaque Baseball
`eRe i
`f
`Pinger eteeented
`_4: An XSLstyle sheetwith instructionsto extract
`|Ble Et Yow fate Took Heb
`Ke ae 9a4)a
`a6
`a
`Refresh Home | Search Favottes History
`
`Listing 5
`LEAGUE elements
`OO eee
`1998 Major Lea
`|
`Statistics
`gue Baseball
`éxslistylesneet 0722esternttps//ww.w3.0ra/TR/NDXS! >
`<?xml version="1.0"2?
`.
`<xsl:template match="/"?
`<HTML>
`<HEAD>
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 18 of 55
`
`Filed 047% 9/22 Page 18 of 55
`
`Chapter 5 + Attributes, Empty Tags, and XSL
`
`117
`
`|
`
`elharo@metal eee Baie
`
`National League
`
`American League
` Copyright 1999 ElliotteRust
`
`Figure 5-6: The lea
`.
`
`:
`gue namesare displ
`
`the XSLstyle sheetin Listing 5-4 is ore as H2 headers when
`
`<xsl:fo
`
`ouie r-each select="SEASON">
`
`"
`
`<xsl:value-of select="@YEAR"/>
`ote
`ague Baseball Statistics
`Major Le
`i
`
` Ument 82-1
`
`<TITLED«xsl -for-each sel ect="SEASON"?
`<xs] -value-of select="@YEAR"/?
`</xsl -for-each?
`Major League Basebal] Statistics
`
`</TITLE>
`</HEAD>?
`<BODY>
`
`<xs] -for-eacn sel ect="SEASON">
`Tect="@YEAR"/?
`<H1>
`<xsl:value-of se
`Major League Basebal] Statistics
`
`</H1>
`
`<xsl -for-eacn select="LEAGUE">
`<H2 ALIGN="CENTER">
`<xsl -value-of select="@NAME"/?
`
`
`
`Case 1:19-cv-00859-RTH Document 82-1 Filed 04/29/22 Page 19 of 55
`
`TIO CV. O0CD0-RTH Document 82-1 Filed 04/29)o2
`
`Page 19 of 55
`
`Chapter 5
`Attributes, Empt