Title by fionan

VIEWS: 9 PAGES: 15

									The Information School at the University of Washington

                                                         LIS 549 U/TU: Intro to Content Management
                                                         Fall 2003 * Bob Boiko * MSIM Associate Chair




                                                                       XML Basics
The Information School at the University of Washington

                                                         A First Look at XML

                                                         1.         You invent a set of names for                   3.          You add additional information to the
                                                                    the stuff you want to manage                                names
                                                                    and put <> around them
                                                                                                                            •       <MyInfo Date=“”>
                                                                –           <MyInfo>
                                                                                                                                    •     <Title>
                                                                –           <Title>
                                                                                                                                    •     <Author eMail = “”>
                                                                –           <Author>
                                                                                                                                    •     <Body Revision=“”>
                                                                –           <Body>                                                          •    <Para Style=“”>
                                                                –           <Para>                                                  •     </Body>
                                                         2.         You figure out which ones go                            •       </MyInfo>
                                                                    inside witch others
                                                                •           <MyInfo>
                                                                                                                    4.          You fill in the blanks
                                                                        •       <Title>                                     •       <MyInfo Date=“2004-03-03”>
                                                                        •       <Author>                                            •     <Title>My Title</Title>
                                                                        •       <body>                                              •     <Author eMail = “A@B.Org”>Bob</Author>
                                                                                •      <Para>
                                                                                                                                    •     <Body Revision=“2”>
                                                                        •       </Body
                                                                                                                                            •    <Para Style=“ListHead”>Some Head</Para>
                                                                        •       </MyInfo>
                                                                                                                                            •    <Para Style=“List”>Point 1</Para>
                                                                                                                                            •    <Para Style=“List”>Point 2</Para>
                                                                                                                                    •     </Body>

                                                              LIS 549 U/TU: Intro to Content Management * Fall 2004 * Bob Boiko * MSIM Associate Chair
The Information School at the University of Washington



                                                                                             Data- Transfer




                                                         The Three Faces of XML




                                                                              Resource identification and
                                                           Content modeling   discovery (Dublin core, RDF, etc.)
The Information School at the University of Washington

                                                         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
The Information School at the University of Washington

                                                         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
The Information School at the University of Washington

                                                         XML vs. Other Markup Languages

                                                                                                 HTML                XML             WP Markup
                                                                          ASCII vs.              ASCII               ASCII           Binary
                                                                          Binary

                                                                          Format vs. Format                          Struct          Format and
                                                                          Structure                                                  Structure

                                                                          Extendable Non Ext                         Ext             Non Ext
                                                                          vs. Non
                                                                          Extendable


                                                                          Range of               Low                 High            Medium
                                                                          coverage


                                                          LIS 549 U/TU: Intro to Content Management * Fall 2004 * Bob Boiko * MSIM Associate Chair
The Information School at the University of Washington

                                                         How do you Write XML?




                                                          LIS 549 U/TU: Intro to Content Management * Fall 2004 * Bob Boiko * MSIM Associate Chair
The Information School at the University of Washington

                                                         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
The Information School at the University of Washington
                                                                                                                  XML Instance Documents
                                                         No Tagging
                                                         Dodge Durango
                                                         Sport Utility Minimal Tagging Tagging
                                                                                       XML
                                                         4             Name: Dodge Durango
                                                                                       <VEHICLES>
                                                         32000 miles Type: Sport Utility <VEHICLE inventory_number="1">
                                                         $18000        Doors: 4           <MAKE>Dodge</MAKE>
                                                         Yes           Miles: 32000       <MODEL model_code="USA23">Durango</MODEL>
                                                         Yes           Price: 18000       <YEAR>1998</YEAR>
                                                                       Power_Locks: Yes <STYLE>Sport Utility</STYLE>
                                                         Radio/Cassette/CD                <DOORS>4</DOORS>
                                                         Yes           Power_Windows: Yes <PRICE>18000</PRICE>
                                                         Yes           Stereo: Radio/Cassette/CD
                                                                                          <MILES>32000</MILES>
                                                         Full/Partial  Air-Conditioning: Yes
                                                                                          <OPTIONS>
                                                         Very clean    Automatic: Yes       <POWER_LOCKS>Yes</POWER_LOCKS>
                                                                       FWD: Full/Partial    <POWER_WINDOWS>Yes</POWER_WINDOWS>
                                                                       Note: Very clean     <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 Information School at the University of Washington

                                                         The Gross Anatomy of a Tag




                                                          LIS 549 U/TU: Intro to Content Management * Fall 2004 * Bob Boiko * MSIM Associate Chair
The Information School at the University of Washington

                                                         The Micro Anatomy of a Tag



                                                                                       White Space is for Your Eyes Only

                                                                              <TABLE><TR><TD COLSPAN="2">Here is
                                                                                                     • Shorthand
                                                                               the picture<IMG SRC="ngo.jpg" BORDER tag                  names
                                                                                      ="1"> </TD> </TR><TABLE>
                                                                                                                         stand for real words.
                                                                                                                       • Every tag "inside" is
                                                                                                                         contained by that tag.
                                                                                                                       • Parameters tell you
                                                                                                                         what the tag has.
                                                          LIS 549 U/TU: Intro to Content Management * Fall 2004 * Bob Boiko * MSIM Associate Chair
The Information School at the University of Washington

                                                         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 Information School at the University of Washington

                                                         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
The Information School at the University of Washington

                                                         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
The Information School at the University of Washington

                                                         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

								
To top