DOC PREVIEW
SJSU CMPE 226 - XML

This preview shows page 1-2-3-25-26-27-28-50-51-52 out of 52 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 52 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 52 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 52 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 52 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 52 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 52 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 52 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 52 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 52 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 52 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 52 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Database DesignPowerPoint PresentationSlide 3XML Introduction (1)XML Introduction (2)XML Motivations (1)XML Motivations (2)Structure of XML DataEx: of Nested ElementsMotivation for NestingStructure of XML (2)AttributesAttributes vs. SubelementsMore on XML SyntaxNamespacesXML Document SchemaDocument Type Definition (DTD)Element Specification in DTDBank DTDAttributes Spec in DTDIDs and IDREFsBank DTD with AttributesXML data with ID and IDREF attributesLimitations of DTDsXML SchemaXML Schema Version of Bank DTDQuerying and Transforming XML DataTree Model of XML DataXpath (1)XPath (2)Functions in XPathMore XPath FeaturesXSLTXSLT Templates (1)XSLT Templates (2)Creating XML Output (1)Creating XML Output (2)Structural RecursionSorting in XSLTXQueryFLWR Syntax in XQueryJoinsChanging Nesting StructureXQuery Path ExpressionsSorting in XQueryFunctions and Other XQuery FeaturesApplication Program InterfaceStorage of XML DataStoring XML in Relational DatabasesStoring XML as RelationsStoring XML in RelationsDiscussion Questions2003SJSU -- CmpE L13-S1 XMLDatabase Design Dr. M.E. Fayad, ProfessorComputer Engineering Department, Room #283I College of EngineeringSan José State UniversityOne Washington SquareSan José, CA 95192-0180 http://www.engr.sjsu.edu/~fayad2003SJSU – CmpE --- M.E. Fayad L13-S2 XML2Lesson 13:XML2003SJSU – CmpE --- M.E. Fayad L13-S3 XML Lesson ObjectivesObjectives3 Introduce XML Understand The motivation behind XML Explore the structure of XML:  Document Type Definition XML Schema XSLT Explore querying and transforming XML data Learn about storing XML in relational databases2003SJSU – CmpE --- M.E. Fayad L13-S4 XMLXML: Extensible Markup LanguageDefined by the WWW Consortium (W3C)Originally intended as a document markup language not a database language–Documents have tags giving extra information about sections of the document•E.g. <title> XML </title> <slide> Introduction …</slide>–Derived from SGML (Standard Generalized Markup Language), but simpler to use than SGML–Extensible, unlike HTML•Users can add new tags, and separately specify how the tag should be handled for display–Goal was (is?) to replace HTML as the language for publishing documents on the Web4XML Introduction (1)2003SJSU – CmpE --- M.E. Fayad L13-S5 XMLThe ability to specify new tags, and to create nested tag structures made XML a great way to exchange data, not just documents.–Much of the use of XML has been in data exchange applications, not as a replacement for HTMLTags make data (relatively) self-documenting –E.g. <bank> <account> <account-number> A-101 </account-number> <branch-name> Downtown </branch-name> <balance> 500 </balance> </account> <depositor> <account-number> A-101 </account-number> <customer-name> Johnson </customer-name> </depositor> </bank>5XML Introduction (2)2003SJSU – CmpE --- M.E. Fayad L13-S6 XMLData interchange is critical in today’s networked world–Examples:•Banking: funds transfer•Order processing (especially inter-company orders)•Scientific data–Chemistry: ChemML, …–Genetics: BSML (Bio-Sequence Markup Language), …–Paper flow of information between organizations is being replaced by electronic flow of informationEach application area has its own set of standards for representing informationXML has become the basis for all new generation data interchange formats6XML Motivations (1)2003SJSU – CmpE --- M.E. Fayad L13-S7 XMLEarlier generation formats were based on plain text with line headers indicating the meaning of fields–Similar in concept to email headers–Does not allow for nested structures, no standard “type” language–Tied too closely to low level document structure (lines, spaces, etc)Each XML based standard defines what are valid elements, using– XML type specification languages to specify the syntax•DTD (Document Type Descriptors)•XML Schema–Plus textual descriptions of the semanticsXML allows new tags to be defined as required–However, this may be constrained by DTDsA wide variety of tools is available for parsing, browsing and querying XML documents/data7XML Motivations (2)2003SJSU – CmpE --- M.E. Fayad L13-S8 XMLTag: label for a section of dataElement: section of data beginning with <tagname> and ending with matching </tagname>Elements must be properly nested–Proper nesting• <account> … <balance> …. </balance> </account> –Improper nesting • <account> … <balance> …. </account> </balance> –Formally: every start tag must have a unique matching end tag, that is in the context of the same parent element.Every document must have a single top-level element8Structure of XML Data2003SJSU – CmpE --- M.E. Fayad L13-S9 XML<bank-1> <customer> <customer-name> Hayes </customer-name> <customer-street> Main </customer-street> <customer-city> Harrison </customer-city> <account> <account-number> A-102 </account-number> <branch-name> Perryridge </branch-name> <balance> 400 </balance> </account> <account> … </account> </customer> . . </bank-1>9Ex: of Nested Elements2003SJSU – CmpE --- M.E. Fayad L13-S10 XMLNesting of data is useful in data transfer–Example: elements representing customer-id, customer name, and address nested within an order elementNesting is not supported, or discouraged, in relational databases–With multiple orders, customer name and address are stored redundantly–normalization replaces nested structures in each order by foreign key into table storing customer name and address information–Nesting is supported in object-relational databasesBut nesting is appropriate when transferring data–External application does not have direct access to data referenced by a foreign key10Motivation for Nesting2003SJSU – CmpE --- M.E. Fayad L13-S11 XMLMixture of text with sub-elements is legal in XML. –Example: <account> This account is seldom used any more. <account-number> A-102</account-number> <branch-name> Perryridge</branch-name> <balance>400 </balance></account>–Useful for document markup, but discouraged for data representation11Structure of XML (2)2003SJSU – CmpE --- M.E. Fayad L13-S12


View Full Document

SJSU CMPE 226 - XML

Documents in this Course
SQL-99

SQL-99

71 pages

XML

XML

14 pages

Chapter 9

Chapter 9

45 pages

Load more
Download XML
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view XML and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view XML 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?