Professional Documents
Culture Documents
DatabaseSystemConcepts
Silberschatz,KorthandSudarshan Seewww.dbbook.comforconditionsonreuse
XML
s StructureofXMLData s XMLDocumentSchema s QueryingandTransformation s ApplicationProgramInterfacestoXML s StorageofXMLData s XMLApplications
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.2
Silberschatz,KorthandSudarshan
Introduction
s XML:ExtensibleMarkupLanguage s DefinedbytheWWWConsortium(W3C) s DerivedfromSGML(StandardGeneralizedMarkupLanguage),but
simplertousethanSGML document
q
s Documentshavetagsgivingextrainformationaboutsectionsofthe
s Extensible,unlikeHTML
q
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.3
Silberschatz,KorthandSudarshan
XMLIntroduction(Cont.)
s Theabilitytospecifynewtags,andtocreatenestedtagstructuresmake
XMLagreatwaytoexchangedata,notjustdocuments.
q
MuchoftheuseofXMLhasbeenindataexchangeapplications,notasa replacementforHTML
s Tagsmakedata(relatively)selfdocumenting
E.g. <bank> <account> <account_number>A101</account_number> <branch_name>Downtown</branch_name> <balance>500</balance> </account> <depositor> <account_number>A101</account_number> <customer_name>Johnson</customer_name> </depositor> </bank>
q
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.4
Silberschatz,KorthandSudarshan
XML:Motivation
s Datainterchangeiscriticalintodaysnetworkedworld
q
Examples:
Paperflowofinformationbetweenorganizationsisbeingreplacedby electronicflowofinformation
s Eachapplicationareahasitsownsetofstandardsforrepresenting
information formats
s XMLhasbecomethebasisforallnewgenerationdatainterchange
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.5
Silberschatz,KorthandSudarshan
XMLMotivation(Cont.)
s Earliergenerationformatswerebasedonplaintextwithlineheaders
indicatingthemeaningoffields
q q q
s EachXMLbasedstandarddefineswhatarevalidelements,using
q
DTD(DocumentTypeDescriptors) XMLSchema
Plustextualdescriptionsofthesemantics However,thismaybeconstrainedbyDTDs
s XMLallowsnewtagstobedefinedasrequired
q
s Awidevarietyoftoolsisavailableforparsing,browsingandqueryingXML
documents/data
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.6
Silberschatz,KorthandSudarshan
ComparisonwithRelationalData
s Inefficient:tags,whichineffectrepresentschemainformation,are
repeated
q
s Betterthanrelationaltuplesasadataexchangeformat
q q q
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.7
Silberschatz,KorthandSudarshan
StructureofXMLData
s Tag:labelforasectionofdata s Element:sectionofdatabeginningwith<tagname>andendingwith
matching</tagname>
q
s Elementsmustbeproperlynested
Propernesting
<account><balance>.</balance></account> <account><balance>.</account></balance>
Impropernesting
Formally:everystarttagmusthaveauniquematchingendtag, thatisinthecontextofthesameparentelement.
s Everydocumentmusthaveasingletoplevelelement
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.8
Silberschatz,KorthandSudarshan
ExampleofNestedElements
<bank1> <customer> <customer_name>Hayes</customer_name>
</customer> . . </bank1>
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.9
Silberschatz,KorthandSudarshan
MotivationforNesting
s Nestingofdataisusefulindatatransfer
q
s Nestingisnotsupported,ordiscouraged,inrelationaldatabases
q
s Butnestingisappropriatewhentransferringdata
q
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.10
Silberschatz,KorthandSudarshan
StructureofXMLData(Cont.)
s MixtureoftextwithsubelementsislegalinXML.
q
Example:
Usefulfordocumentmarkup,butdiscouragedfordata representation
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.11
Silberschatz,KorthandSudarshan
Attributes
s Elementscanhaveattributes
element
s Anelementmayhaveseveralattributes,buteachattributenamecan
onlyoccuronce
<accountaccttype=checkingmonthlyfee=5>
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.12
Silberschatz,KorthandSudarshan
Attributesvs.Subelements
s Distinctionbetweensubelementandattribute
q
Suggestion:useattributesforidentifiersofelements,anduse subelementsforcontents
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.13
Silberschatz,KorthandSudarshan
Namespaces
s XMLdatahastobeexchangedbetweenorganizations s Sametagnamemayhavedifferentmeaningindifferentorganizations,
causingconfusiononexchangeddocuments
Namespaces
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.14
Silberschatz,KorthandSudarshan
MoreonXMLSyntax
s Elementswithoutsubelementsortextcontentcanbeabbreviatedby
endingthestarttagwitha/>anddeletingtheendtag
q
<accountnumber=A101branch=Perryridgebalance=200/>
s Tostorestringdatathatmaycontaintags,withoutthetagsbeing
interpretedassubelements,useCDATAasbelow
q
<![CDATA[<account></account>]]>
Here,<account>and</account>aretreatedasjuststrings CDATAstandsforcharacterdata
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.15
Silberschatz,KorthandSudarshan
XMLDocumentSchema
s Databaseschemasconstrainwhatinformationcanbestored,andthe
datatypesofstoredvalues
s XMLdocumentsarenotrequiredtohaveanassociatedschema s However,schemasareveryimportantforXMLdataexchange
q
s TwomechanismsforspecifyingXMLschema
q
Widelyused Newer,increasinguse
XMLSchema
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.16
Silberschatz,KorthandSudarshan
DocumentTypeDefinition(DTD)
s ThetypeofanXMLdocumentcanbespecifiedusingaDTD s DTDconstraintsstructureofXMLdata
q q q
s DTDdoesnotconstraindatatypes
q
s DTDsyntax
q q
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.17
Silberschatz,KorthandSudarshan
ElementSpecificationinDTD
s
Subelementscanbespecifiedas
q q q
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.18
Silberschatz,KorthandSudarshan
BankDTD
<!DOCTYPEbank[ <!ELEMENTbank((account|customer|depositor)+)> <!ELEMENTaccount(account_numberbranch_namebalance)> <!ELEMENTcustomer(customer_namecustomer_street customer_city)> <!ELEMENTdepositor(customer_nameaccount_number)> <!ELEMENTaccount_number(#PCDATA)> <!ELEMENTbranch_name(#PCDATA)> <!ELEMENTbalance(#PCDATA)> <!ELEMENTcustomer_name(#PCDATA)> <!ELEMENTcustomer_street(#PCDATA)> <!ELEMENTcustomer_city(#PCDATA)> ]>
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.19
Silberschatz,KorthandSudarshan
AttributeSpecificationinDTD
s Attributespecification:foreachattribute
q q
Name Typeofattribute
Whether
s Examples
q q
DatabaseSystemConcepts5thEdition,Aug22,2005.
IDsandIDREFs
s AnelementcanhaveatmostoneattributeoftypeID s TheIDattributevalueofeachelementinanXMLdocumentmustbe
distinct
q
ThustheIDattributevalueisanobjectidentifier
s AnattributeoftypeIDREFmustcontaintheIDvalueofanelementin
thesamedocument
s AnattributeoftypeIDREFScontainsasetof(0ormore)IDvalues.
EachIDvaluemustcontaintheIDvalueofanelementinthesame document
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.21
Silberschatz,KorthandSudarshan
BankDTDwithAttributes
s BankDTDwithIDandIDREFattributetypes.
<!DOCTYPEbank2[ <!ELEMENTaccount(branch,balance)> <!ATTLISTaccount account_numberID#REQUIRED ownersIDREFS#REQUIRED> <!ELEMENTcustomer(customer_name,customer_street, customer_city)> <!ATTLISTcustomer customer_idID#REQUIRED accountsIDREFS#REQUIRED> declarationsforbranch,balance,customer_name, customer_streetandcustomer_city ]>
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.22
Silberschatz,KorthandSudarshan
XMLdatawithIDandIDREFattributes
<bank2> <accountaccount_number=A401owners=C100C102> <branch_name>Downtown</branch_name>
<balance>500</balance>
</account>
..
<customer_street>Monroe</customer_street> <customer_city>Madison</customer_city>
</customer> </bank2>
<customer_street>Erin</customer_street> <customer_city>Newark</customer_city>
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.23
Silberschatz,KorthandSudarshan
LimitationsofDTDs
s Notypingoftextelementsandattributes
q
s Difficulttospecifyunorderedsetsofsubelements
q
CannotensurethateachofAandBoccursonlyonce
s IDsandIDREFsareuntyped
q
Theownersattributeofanaccountmaycontainareferenceto anotheraccount,whichismeaningless
ownersattributeshouldideallybeconstrainedtoreferto customerelements
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.24
Silberschatz,KorthandSudarshan
XMLSchema
s XMLSchemaisamoresophisticatedschemalanguagewhich
addressesthedrawbacksofDTDs.Supports
q
Typingofvalues
E.g.integer,string,etc Also,constraintsonmin/maxvalues
q q
Userdefined,comlextypes Manymorefeatures,including
uniquenessandforeignkeyconstraints,inheritance
s XMLSchemaisitselfspecifiedinXMLsyntax,unlikeDTDs
q
Morestandardrepresentation,butverbose
s XMLSchemeisintegratedwithnamespaces s BUT:XMLSchemaissignificantlymorecomplicatedthanDTDs.
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.25
Silberschatz,KorthandSudarshan
XMLSchemaVersionofBankDTD
<xs:schemaxmlns:xs=http://www.w3.org/2001/XMLSchema> <xs:elementname=banktype=BankType/> <xs:elementname=account> <xs:complexType> <xs:sequence> <xs:elementname=account_numbertype=xs:string/> <xs:elementname=branch_nametype=xs:string/> <xs:elementname=balancetype=xs:decimal/> </xs:squence> </xs:complexType> </xs:element> ..definitionsofcustomeranddepositor. <xs:complexTypename=BankType> <xs:squence>
</xs:complexType> </xs:schema>
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.26
Silberschatz,KorthandSudarshan
XMLSchemaVersionofBankDTD
s Choiceofxs:wasoursanyothernamespaceprefixcouldbe
chosen
q
s ElementbankhastypeBankType,whichisdefinedseparately
xs:complexTypeisusedlatertocreatethenamedcomplextype BankType
s Elementaccounthasitstypedefinedinline
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.27
Silberschatz,KorthandSudarshan
MorefeaturesofXMLSchema
s Attributesspecifiedbyxs:attributetag:
q q
s Keyconstraint:accountnumbersformakeyforaccountelements
s Foreignkeyconstraintfromdepositortoaccount:
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.28
Silberschatz,KorthandSudarshan
QueryingandTransformingXMLData
s TranslationofinformationfromoneXMLschematoanother s QueryingonXMLdata s Abovetwoarecloselyrelated,andhandledbythesametools s StandardXMLquerying/translationlanguages
q
XPath
XQuery
XSLT
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.29
Silberschatz,KorthandSudarshan
TreeModelofXMLData
s QueryandtransformationlanguagesarebasedonatreemodelofXML
data
s AnXMLdocumentismodeledasatree,withnodescorrespondingto
elementsandattributes
q
q q
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.30
Silberschatz,KorthandSudarshan
XPath
s XPathisusedtoaddress(select)partsofdocumentsusing
pathexpressions
q
s Apathexpressionisasequenceofstepsseparatedby/
Thinkoffilenamesinadirectoryhierarchy
s Resultofpathexpression:setofvaluesthatalongwiththeir
containingelements/attributesmatchthespecifiedpath bank2datawesawearlierreturns
s E.g./bank2/customer/customer_nameevaluatedonthe
<customer_name>Joe</customer_name> <customer_name>Mary</customer_name>
s E.g./bank2/customer/customer_name/text()
returnsthesamenames,butwithouttheenclosingtags
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.31
Silberschatz,KorthandSudarshan
XPath(Cont.)
s Theinitial/denotesrootofthedocument(abovethetopleveltag) s Pathexpressionsareevaluatedlefttoright
q
s Selectionpredicatesmayfollowanystepinapath,in[]
q
s Attributesareaccessedusing@
q
E.g./bank2/account[balance>400]/@account_number
returnstheaccountnumbersofaccountswithbalance>400
IDREFattributesarenotdereferencedautomatically(moreonthis later)
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.32
Silberschatz,KorthandSudarshan
FunctionsinXPath
s XPathprovidesseveralfunctions
q
Thefunctioncount()attheendofapathcountsthenumberof elementsinthesetgeneratedbythepath
E.g./bank2/account[count(./customer)>2]
Returnsaccountswith>2customers q Alsofunctionfortestingposition(1,2,..)ofnodew.r.t.siblings
s Booleanconnectivesandandorandfunctionnot()canbeusedin
predicates
q q
s IDREFscanbereferencedusingfunctionid()
returnsallcustomersreferredtofromtheownersattributeof accountelements.
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.33
Silberschatz,KorthandSudarshan
MoreXPathFeatures
s Operator|usedtoimplementunion
q
E.g./bank2/account/id(@owner)|/bank2/loan/id(@borrower)
Givescustomerswitheitheraccountsorloans However,|cannotbenestedinsideotheroperators.
s //canbeusedtoskipmultiplelevelsofnodes
q
E.g./bank2//customer_name
s Astepinthepathcangotoparents,siblings,ancestorsand
descendantsofthenodesgeneratedbythepreviousstep,notjust tothechildren
q q
s doc(name)returnstherootofanameddocument
DatabaseSystemConcepts5thEdition,Aug22,2005. 10.34 Silberschatz,KorthandSudarshan
XQuery
s XQueryisageneralpurposequerylanguageforXMLdata s CurrentlybeingstandardizedbytheWorldWideWebConsortium
(W3C)
q
s XQueryisderivedfromtheQuiltquerylanguage,whichitselfborrows
fromSQL,XQLandXMLQL
s XQueryusesa
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.35
Silberschatz,KorthandSudarshan
FLWORSyntaxinXQuery
s ForclauseusesXPathexpressions,andvariableinforclauserangesover
valuesinthesetreturnedbyXPath
q
s SimpleFLWORexpressioninXQuery
s Letclausenotreallyneededinthisquery,andselectioncanbedoneIn
XPath.Querycanbewrittenas:
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.36
Silberschatz,KorthandSudarshan
Joins
s JoinsarespecifiedinamannerverysimilartoSQL
XPathselections:
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.37
Silberschatz,KorthandSudarshan
NestedQueries
s Thefollowingqueryconvertsdatafromtheflatstructureforbank
informationintothenestedstructureusedinbank1 <bank1>{ for$cin/bank/customer return <customer> {$c/*} {for$din/bank/depositor[customer_name=$c/customer_name], $ain/bank/account[account_number=$d/account_number] return$a} </customer> }</bank1>
s $c/*denotesallthechildrenofthenodetowhich$cisbound,withoutthe
enclosingtopleveltag
s $c/text()givestextcontentofanelementwithoutanysubelements/tags
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.38
Silberschatz,KorthandSudarshan
SortinginXQuery
s
s s
DatabaseSystemConcepts5thEdition,Aug22,2005.
</customer> }</bank1>
10.39
Silberschatz,KorthandSudarshan
FunctionsandOtherXQueryFeatures
s UserdefinedfunctionswiththetypesystemofXMLSchema
some$einpathsatisfiesP every$einpathsatisfiesP
s XQueryalsosupportsIfthenelseclauses
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.40
Silberschatz,KorthandSudarshan
XSLT
s Astylesheetstoresformattingoptionsforadocument,usually
separatelyfromdocument
q
E.g.anHTMLstylesheetmayspecifyfontcolorsandsizesfor headings,etc.
s TheXMLStylesheetLanguage(XSL)wasoriginallydesignedfor
generatingHTMLfromXML
q
s XSLTisageneralpurposetransformationlanguage
s XSLTtransformationsareexpressedusingrulescalledtemplates
q
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.41
Silberschatz,KorthandSudarshan
XSLTTemplates
s ExampleofXSLTtemplatewithmatchandselectpart
<xsl:templatematch=/bank2/customer>
<xsl:valueofselect=customer_name/>
elementsthatdonotmatchanyothertemplate
q
Usedtoensurethattheircontentsdonotgetoutput.
s Ifanelementmatchesseveraltemplates,onlyoneisusedbasedona
complexpriorityscheme/userdefinedpriorities
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.42
Silberschatz,KorthandSudarshan
CreatingXMLOutput
s AnytextortagintheXSLstylesheetthatisnotinthexslnamespace
</xsl;template> <xsl:templatematch=*/>
q
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.43
Silberschatz,KorthandSudarshan
CreatingXMLOutput(Cont.)
s Note:Cannotdirectlyinsertaxsl:valueoftaginsideanothertag
q
E.g.cannotcreateanattributefor<customer>inthepreviousexample bydirectlyusingxsl:valueof q XSLTprovidesaconstructxsl:attributetohandlethissituation xsl:attributeaddsattributetotheprecedingelement E.g.<customer> <xsl:attributename=customer_id> <xsl:valueofselect=customer_id/> </xsl:attribute> </customer> resultsinoutputoftheform <customercustomer_id=.>. s xsl:elementisusedtocreateoutputelementswithcomputednames
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.44
Silberschatz,KorthandSudarshan
StructuralRecursion
s Templateactioncanapplytemplatesrecursivelytothecontentsofa
matchedelement
<xsl:templatematch=/bank> <customers> <xsl:templateapplytemplates/> </customers> </xsl:template> <xsl:templatematch=/customer> <customer> <xsl:valueofselect=customer_name/> </customer> </xsl:template> <xsl:templatematch=*/>
s Exampleoutput:
DatabaseSystemConcepts5thEdition,Aug22,2005.
JoinsinXSLT
s XSLTkeysallowelementstobelookedup(indexed)byvaluesof
subelementsorattributes q Keysmustbedeclared(withaname)and,thekey()functioncanthen beusedforlookup.E.g. <xsl:keyname=acctnomatch=account use=account_number/> <xsl:valueofselect=key(acctno,A101) s Keyspermit(some)joinstobeexpressedinXSLT <xsl:keyname=acctnomatch=accountuse=account_number/> <xsl:keyname=custnomatch=customeruse=customer_name/> <xsl:templatematch=depositor> <cust_acct> <xsl:valueofselect=key(custno,customer_name)/> <xsl:valueofselect=key(acctno,account_number)/> </cust_acct> </xsl:template> <xsl:templatematch=*/>
DatabaseSystemConcepts5thEdition,Aug22,2005. 10.46 Silberschatz,KorthandSudarshan
SortinginXSLT
s Usinganxsl:sortdirectiveinsideatemplatecausesallelements
matchingthetemplatetobesorted
q
Sortingisdonebeforeapplyingothertemplates
<xsl:templatematch=/bank> <xsl:applytemplatesselect=customer> <xsl:sortselect=customer_name/> </xsl:applytemplates> </xsl:template> <xsl:templatematch=customer> <customer> <xsl:valueofselect=customer_name/> <xsl:valueofselect=customer_street/> <xsl:valueofselect=customer_city/> </customer> <xsl:template> <xsl:templatematch=*/>
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.47
Silberschatz,KorthandSudarshan
ApplicationProgramInterface
s TherearetwostandardapplicationprograminterfacestoXMLdata:
q
SAX(SimpleAPIforXML)
DOM(DocumentObjectModel)
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.48
Silberschatz,KorthandSudarshan
StorageofXMLData
s XMLdatacanbestoredin
q
Nonrelationaldatastores
Relationaldatabases
DatabaseSystemConcepts5thEdition,Aug22,2005.
StorageofXMLinRelationalDatabases
s Alternatives:
q q q
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.50
Silberschatz,KorthandSudarshan
StringRepresentation
s Storeeachchildoftoplevelelementasastringfieldofatupleina
relationaldatabase
q q
Useasinglerelationtostoreallelements,or Useaseparaterelationforeachtoplevelelementtype
E.g.account,customer,depositorrelations Eachwithastringvaluedattributetostoretheelement
s Indexing:
q
Storevaluesofsubelements/attributestobeindexedasextrafields oftherelation,andbuildindicesonthesefields
E.g.customer_nameoraccount_number
Somedatabasesystemssupportfunctionindices,whichusethe resultofafunctionasthekeyvalue.
Thefunctionshouldreturnthevalueoftherequired subelement/attribute
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.51
Silberschatz,KorthandSudarshan
StringRepresentation(Cont.)
s Benefits:
q q
Allowsfastaccesstoindividualelements.
s Drawback:Needtoparsestringstoaccessvaluesinsidetheelements
q
Parsingisslow.
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.52
Silberschatz,KorthandSudarshan
TreeRepresentation
s Treerepresentation:modelXMLdataastreeandstoreusingrelations
nodes(id,type,label,value) child(child_id,parent_id)
Canaddanextraattributetochildtorecordorderingofchildren
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.53
Silberschatz,KorthandSudarshan
TreeRepresentation(Cont.)
s Benefit:CanstoreanyXMLdata,evenwithoutDTD s Drawbacks:
q
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.54
Silberschatz,KorthandSudarshan
MappingXMLDatatoRelations
s Relationcreatedforeachelementtypewhoseschemaisknown:
q q q
Asinthetreerepresentation Positioninformation(ithchild)canbestoredtoo
s Allsubelementsthatoccuronlyoncecanbecomerelationattributes
q q
s Subelementsthatcanoccurmultipletimesrepresentedinaseparatetable
q
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.55
Silberschatz,KorthandSudarshan
StoringXMLDatainRelationalSystems
s Publishing:processofconvertingrelationaldatatoanXMLformat s Shredding:processofconvertinganXMLdocumentintoasetof
tuplestobeinsertedintooneormorerelations shredding
s XMLenableddatabasesystemssupportautomatedpublishingand s SomesystemsoffernativestorageofXMLdatausingthexmldata
type.Specialinternaldatastructuresandindicesareusedfor efficiency
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.56
Silberschatz,KorthandSudarshan
SQL/XML
s NewstandardSQLextensionthatallowscreationofnestedXML
output
q
<bank>
</bank>
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.57
Silberschatz,KorthandSudarshan
SQLExtensions
s xmlelementcreatesXMLelements s xmlattributescreatesattributes
s xmlforest(attr1,attr2,..)createsasequence(forest)ofoneormore
elements,withtagnamessameastheSQLattributename
s xmlagg:aggregatefunctioncreatesaforestfromelementsingroup
XMLApplication:WebServices
s TheSimpleObjectAccessProtocol(SOAP)standard:
q
s AWebserviceisasiteprovidingacollectionofSOAPprocedures
q q
DatabaseSystemConcepts5thEdition,Aug22,2005.
10.59
Silberschatz,KorthandSudarshan