150 likes | 245 Views
LIS 549 U/TU: Intro to Content Management Fall 2003 * Bob Boiko * MSIM Associate Chair. XML Basics. You invent a set of names for the stuff you want to manage and put <> around them <MyInfo> <Title> <Author> <Body> <Para> You figure out which ones go inside witch others <MyInfo> <Title>
E N D
LIS 549 U/TU: Intro to Content ManagementFall 2003 * Bob Boiko * MSIM Associate Chair XML Basics
You invent a set of names for the stuff you want to manage and put <> around them <MyInfo> <Title> <Author> <Body> <Para> You figure out which ones go inside witch others <MyInfo> <Title> <Author> <body> <Para> </Body </MyInfo> You add additional information to the names <MyInfo Date=“”> <Title> <Author eMail = “”> <Body Revision=“”> <Para Style=“”> </Body> </MyInfo> You fill in the blanks <MyInfo Date=“2004-03-03”> <Title>My Title</Title> <Author eMail = “A@B.Org”>Bob</Author> <Body Revision=“2”> <Para Style=“ListHead”>Some Head</Para> <Para Style=“List”>Point 1</Para> <Para Style=“List”>Point 2</Para> </Body> A First Look at XML LIS 549 U/TU: Intro to Content Management * Fall 2004 * Bob Boiko * MSIM Associate Chair
Data- Transfer Resource identification and discovery (Dublin core, RDF, etc.) Content modeling The Three Faces of XML
Why XML is Cool • Has an X in its name! • Is as strong as it’s “also ran” parent SGML • More flexible than it’s superficial cousin HTML • It’s accepted LIS 549 U/TU: Intro to Content Management * Fall 2004 * Bob Boiko * MSIM Associate Chair
What is XML Good For? You can treat and XML file like: • A word processing file • Type it, edit it, display it • An HTML file • Tag it, display it with a style sheet • A database • Open it. Search it, add, update, delete LIS 549 U/TU: Intro to Content Management * Fall 2004 * Bob Boiko * MSIM Associate Chair
HTML XML WP Markup ASCII vs. Binary ASCII ASCII Binary Format vs. Structure Format Struct Format and Structure Extendable vs. Non Extendable Non Ext Ext Non Ext Range of coverage Low High Medium XML vs. Other Markup Languages LIS 549 U/TU: Intro to Content Management * Fall 2004 * Bob Boiko * MSIM Associate Chair
How do you Write XML? LIS 549 U/TU: Intro to Content Management * Fall 2004 * Bob Boiko * MSIM Associate Chair
Three Views of XML Tag View Schematic View Browser View LIS 549 U/TU: Intro to Content Management * Fall 2004 * Bob Boiko * MSIM Associate Chair
XML Instance Documents No Tagging Dodge DurangoSport Utility432000 miles$18000Yes YesRadio/Cassette/CDYesYesFull/PartialVery clean Minimal Tagging Name: Dodge DurangoType: Sport UtilityDoors: 4Miles: 32000Price: 18000Power_Locks: YesPower_Windows: YesStereo: Radio/Cassette/CDAir-Conditioning: YesAutomatic: YesFWD: Full/PartialNote: Very clean XML Tagging <VEHICLES> <VEHICLE inventory_number="1"> <MAKE>Dodge</MAKE> <MODEL model_code="USA23">Durango</MODEL> <YEAR>1998</YEAR> <STYLE>Sport Utility</STYLE> <DOORS>4</DOORS> <PRICE>18000</PRICE> <MILES>32000</MILES> <OPTIONS> <POWER_LOCKS>Yes</POWER_LOCKS> <POWER_WINDOWS>Yes</POWER_WINDOWS> <STEREO>Radio/Cassette/CD</STEREO> <AIR_CONDITIONING>Yes</AIR-_CONDITIONING> <AUTOMATIC>Yes</AUTOMATIC> <FWD>Full/Partial</FWD> </OPTIONS> <NOTE>Very clean</NOTE> </VEHICLE></VEHICLES> LIS 549 U/TU: Intro to Content Management * Fall 2004 * Bob Boiko * MSIM Associate Chair
The Gross Anatomy of a Tag LIS 549 U/TU: Intro to Content Management * Fall 2004 * Bob Boiko * MSIM Associate Chair
The Micro Anatomy of a Tag • Shorthand tag names stand for real words. • Every tag "inside" is contained by that tag. • Parameters tell you what the tag has. White Space is for Your Eyes Only <TABLE><TR><TD COLSPAN="2">Here is the picture<IMG SRC="ngo.jpg" BORDER="1"> </TD> </TR><TABLE> LIS 549 U/TU: Intro to Content Management * Fall 2004 * Bob Boiko * MSIM Associate Chair
The Element • The thing in brackets • <CapitalizationMatters/> • <NoSpaces/> • <StartWithALetter/> • <BeDescriptive/> • <Nest> • <Nest> • <Nest/> • </Nest> • </Nest> LIS 549 U/TU: Intro to Content Management * Fall 2004 * Bob Boiko * MSIM Associate Chair
The Attribute • Really just another form of an element • Always quote them • A variety of data types • Can be linked to a list of values • Cannot nest LIS 549 U/TU: Intro to Content Management * Fall 2004 * Bob Boiko * MSIM Associate Chair
How to Approach an Instance • Understand it is an instance of a model • Model of what? • From what perspective? • What are the names • What are the biggies? • Which ones to ignore for now • How is capitalization handled? • Strip it to know it • Get rid of the bulk. • Lay out the major structure LIS 549 U/TU: Intro to Content Management * Fall 2004 * Bob Boiko * MSIM Associate Chair
Finding Stuff in an XML File - Xpath • Directories are hierarchies • Each file has a path • XML files are hierarchies • Each element has an Xpath • /Subject • //Subject • //Subject[@id=‘s0’] • //*[@id=‘s0’] • //*[@id=‘s0’]/title LIS 549 U/TU: Intro to Content Management * Fall 2004 * Bob Boiko * MSIM Associate Chair