صفحه 1:
0 :00 امین
صفحه 2:
با(
Giruture oP XOL Data
XOL Orancedt Gchewa
Queer ood ProePorwaiod
Oppicaica Progra ‘loterPaces to XOL
Girne ام XOL Duta
هم با
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. wo
صفحه 3:
trod
BXOL: Cxereble ما مطهه
OeP iced by the OOD مین )060(
© Qerved Prow GBOL (Strand Geoeruized Dorbup Looguee), but siopler to use
tro GBOL
§ Oornveds have toys yivioy exica fPorwoiica ubvul sevivcs oF he domucrct
© Gy. <te> XOL </itle> <slde> eirrducton ...</shce>
© Gxewbe, whe TOL
© Osers coo add ew tags, ood separa} speoPy how the tog should be hooded
Por depray
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. wo ©Sbervehnts, Cork ced Cnakershe
صفحه 4:
+ XOD “kirodhwton (Ov)
11 Dhe chy spec) cow ep, od ip cred cested for structures ache XL a rect
مومت و رون uta, oot et سح
© Dek oP the we oP XOL hoy bee to dota exckocge apphraives, ot oy مساو ه
POL
Bl Dex woke chit (rekivel)) sel demure
٠ به
وت
>
حصامه_مموی> 6400 >|مموس_ديمابجت
۱
<boknee> SOO <inkwe>
حممجوول>
>
0
> ملگ تسار ری مهم sane?
> مسجل
حلمیا>
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. we ©Sbervehnts, Cork ced Cnakershe
صفحه 5:
+ XO: Oowatoa
Bata hterchouge t onticd ta tokay's الوب لجو لوقه
۶ تسس
۱ لمخاصص عمط لوق
۱ 0 (صطس مس رطجس) مس
> Gout مد
~ Chet: Okew(DL, ...
تست OCOL (Oe-Ceqewe Dorhup Lunpane), -.-
© Caper Pow oF toPorwatica betveed oryouizaices i beta rephaced by
مه اه روا وا
مت رو ۳ ع موه اه وه نی عا opptcaivs ored hur و( ©
تست صل مج ری bee bevowe the busts Por dl را( ۲
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. wo ©Sbervehnts, Cork ced Cnakershe
صفحه 6:
+ X@L Dvarton (Ovct.)
© Gorter yeverciva Porwats were bused va phoia tea wits toe headers عل وله
دا نام رس
۶ ما امه تون لوق
۰ وا سر اجه مه اه له ۲ لب و0
© Ded too coset عنصا بيصا جا dorancedt struckee (hes, spares, et)
۴ Bock XOL bored standard defies what oe vod elewects, Ukr
© XO موه با موه نا وا موه سر
» OPO (Oorancest Dupe Oreos)
> XOL Grkewa
© Phe text desoripiras of the secre
XO) cis لا با با ها تنم we required
© Wowever, this way be را ام 0
Buide variety oP tons is avatuble Por porstag, browsieny ced queries XL
مدل صصص جص
سا0 لح 0 لا سواه 1 وه Px GO, OOO. بسع *© - مرجي س9 لوق
صفحه 7:
+ Ovwpeeoa wk Rektirod Daa
11 4oePPitedt xp, whick اج سوه روط موی او ما و
۲ ام مومسم و و لا ماج
© Octke rebaiced tuples, XOL dota اه و وا صدط الیو جا
ine
© Doerricgd Poreoat tage coo be ode
© ال vested sites
© Onde usceptoue, wot voly io dotobase sysiews, but der tt browsers, took,
اه و
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. wr ©Sbervehnts, Cork ced Cnakershe
صفحه 8:
Crwtre oP XOb Ou
Por a sect oF dott سل یی ا
wih Spryocre> cond eck wih wach رام تاه مه سا
>
ای سس سا ی ی ا
Gite
<a> ... Sbokne> .... <S/bukne> <ai> ”
© Aoproper vestry
١ <at> ... Sboknoe> .... Slasmmni> </pre>
© Conny: every stort tec cust have a uakque oatchiery eerd fer, that i ict the
otter oF the suxve ای موم
© Cvery donned weet hove اوه امه له و
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. we ©Sbervehnts, Cork ced Cnakershe
صفحه 9:
+ Gxanple oP Osvied Cleweus
<>
<ورومواضج>
هلک وبا <جدكمد_وصصاصى>
Dart </amiexver_sireet> <اسه_ مس و>
<mestower_piy> — Wanisva </ostower_viy>
<at>
> امه _ موه > 0409 امه موه
> واگ لصو
> 00 <عصل>
<حججو>
>
حاوممموو>
حوموصو|>
<الجاما/>
مه Px GO, OOO. بسع *© - مرجي س9 لوق
صفحه 10:
+ Ovwaiva Por Oeotay
Bete oF ta ie weed ta dota troy
© Groople! records represrukn meiner مه اس هه
seed eat ore roche مسا
BE Westen مه supported, or decourned, اد اما و
© tk لت orders, custrwer anne ond ولب ore stored reckankrly
cesied structures is ack order by Poreiga key ini table او من و
اوه ی لوصو منود
© Destiog & supported it object ekticad daotobases
© ®t cestioy is oppreprist uhec trasPerray dott
© Cxterad uppicaiva doer ot hove direct uovess to dota rePereured by o Porter
kev
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO.
صفحه 11:
+ Orwtee oP XML Oca (Ova)
BO inture of text wily sub-elewets ts beyal to XOL.
© Cxnvple:
>
۳ یه و امه werd cay wore.
حجتاسم_سحووو|> 0-00(6) حججاسم_سحدحه>
<حعهم_عاممصط» Perryridye</brauk_enve>
> سوام < ۳ > <
مها >
او ول و( وحم تا ,موی مج OsePul Por ©
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. wa ©Sbervehnts, Cork ced Cnakershe
صفحه 12:
+ Otrbuss
© @eweds co اف چم
Soret wertype = “checks” >
<uoomnt_avber> B-IOE </accoucit_sober>
<brooch_ceve> Perr yridye </broack_sane>
<botrace> POO </bckrace>
>
مه ما و rete the starter مساو را اجه اه 19
۳ Qo dewedt way kee severd airbus, bul cack oirbue cere صمت سوه رات موه
2 رهب a سیم
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. 40.00 ©Sbervehnts, Cork ced Cnakershe
صفحه 13:
+ Orbuse ve. Oubelewous
اه ای له یا مت( ۲
ماه ات ,موی اه موم و اه تحص چاه مس ددا 215 8
ای مج مان نهر و ان
© میم عا و oP data represeutaivn, the امن تا وال ood way be
rant rey
> Gewwe kPorwaion con be represecied a hor wae
- > ماک <0400 ۹ ام مه
- مس
> حوطججح_سجووه|>0100-()حوناصج_ سمدم ...
> مس
اه بو سوسوم ما ل Por وله و لو مر و مت
ی با
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. 00.00 ©Sbervehnts, Cork ced Cnakershe
صفحه 14:
Onwespwes
۲ XOb dota hos te be exchooyed betwees pryqusizaicns
۲ Gowe toy coe way have دا مه تال dPPeredl oreaizaioes, cousin
وتو oo او domes
© GpecPyioy voique sirtog os وی ماه مه voids oooh ira
توص :مشاه طو)
۲ یه عون با رم سر ol pver doruvedt by usiegy XOL Oexvespaces:
> حامس Kerker P@= تس( یاوه
< اسم :00>
<وبوصوصاصحمصجا: ذا):)/>مسصخحسص(])< سردو صاصدسا: <P
<روصطاسموا: 0۵ > مواس<)
> ۳0۵ <رواسمو:
</P@tbroach>
<عامبال>
Px GO, OOO. بسع *© - مرجي س9 لوق
صفحه 15:
QOore va XOb Gyniax
۲ @leweus wikout subeleweuis or text cvoied coc be obbrevicied by radi the stir كما
wits a /> oad deletions the eer fer
</ (00ات"حعصمسما ۱
جه له رها و لا مات ,و ی بو ال پم Po sire ©
subeleweds, wer ODOT us bel
۰ >] ۵] ... > <[[حمسسس
عه لفيا ده ی جل pet ee ere
COTO stands Por “chararter kta”
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. 00.00 ©Sbervehnts, Cork ced Cnakershe
صفحه 16:
+ X@L Oronced Ortewa
۲ موادت( schewes coustrais whol iPorwaiva cod be stored, ond the dota pes
OP stored values
© XOb doranvedts ore wt required ty hove om wevrited svhewa
18 dhowever, schewer oe very Reported Por XOL dott exch
۶ ,شمان 0 te cocut oui@utivdly toerpret data received Poo carter
vie
© Dw werkuisws Por spevP yen XOL sckewa
© Oorancedt Type م0 )0۳0(
* Ordely used
© XOL Gchewa
7 رو یو( use
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. 40.00 ©Sbervehnts, Cork ced Cnakershe
صفحه 17:
+ سم Type DePraioa (DTO)
10 11 ype of ot XL doranvedt con be spevPied usta ¢ DTO
BODO cewiranis sinwture oP XOL cata
© Oke tewents van pour
ها مه مه coolest ات Oke ©
© Oko abel weds coolest poour inside cack elewed, ued how way,
ی
حجر مد مت بت ی 0۳۵ ۲
۱ مج بت لت لس 0 ٩
مد 0۵ ۲
< (متاسسسممسلم) مس ۱0,۵06 > ۰
eewed (ctrbutes) > ۵۲۵۲ > ۰
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. سا0 لح 0 لا سواه 1 جوهه
صفحه 18:
+ @bwed OperPrara a OTD
Babbar ean be oped el ce
۶ را اه ی oF
© HPOOOTO (paved charmer مه مات سا ز(صقل
© BOOTY (cv aubekwects) or 00۲) سل هسام
۱ ات
> ۵۵0۵ ی _ممسم) ماس wxrnnt_sanvber)>
<! CLEOOOT مسی_سسی )#6000/۵(<
<1 CLODGOP exxxrsct_snvber (HPOOHDO)>
B Otbebwedt speoPivatva way have reqdar وی
<IPLEOCO ححص ) ) جلما | rwteswer | depovitor)+)>
< Doren
مس و و "و ال
مج بت و 00 ۲
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. 00.00 ©Sbervehnts, Cork ced Cnakershe
صفحه 19:
+ @uk OTO
> ۵۵ ]
<IGLEOEOT bank ( (cern | etree | depesior)+)>
<IGLEOEOP cecrand (ceoeret_manber browh sexe bokre)>
<! CLEOECO? asiwer(asiwer_anve mptnrer_sieet
ی
>! CELEOEOD cepostor (aetwer_senve eant_onober)>
>! GELEDEOT cerrrrt_savber (HPOOBNO)>
<! ELEDEOT breech _cexve (HPOORTO)>
>! ELEOEOP )سس 000091: )3(<
>| ۲۵0۵ <(#۵06/۵)سی_ سس
>| ۲۵0۵0۲۳ سموه_ سس #۳000۵
>! ۲060 <(00/۵)#)بو_مسسه
Pp
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. 00.00 ©Sbervehnts, Cork ced Cnakershe
صفحه 20:
+ سا OpeoPodra ia DTO
۱ trbue specPicaioa | Por اميه الوم
© سم
© ype اف خر
> COKTO
» AD (MeciPer) or WOREE (10 rePerewe) or WRERG (catiple REPS)
سا ام و
© ان
« ملس )۵۵0۱60(
+ نع defind cher (uch),
» or wether (#DPLIEO)
B Croke
© OTNACT arnt wotpe COON “checkin>
© > ۵۲/۷۵ مه
ل مهد 10 # ۵
جمد 10۵6۵۵0۵060 > Ez
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. سا0 لح 0 لا سواه 1 موه
صفحه 21:
10000۳2 مه 4002
hove of west ove otros oP ype 1D. موی موه و( لا
BD ke 10 atrtbute vole oP buck ele wed on XO) doranved cust be اس
© Drop the 10 ottbute volte is oe object تا
© Qo atribute of pe TORE wast ovata the 1 موی من نصا fo the
مج وود
a set of (D or wore) 1D voles. یس 106 سره ات ۲
مج pe ۸ ۰ مرب Back 10 vohue wet ovotoa the 1D vohue oF
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. سا0 لح 0 لا سواه 1 »وه
صفحه 22:
+ ack OTD wik Orrinies
۲ Gack OPO wk 0 ord WORE که turer.
<DOOTYPE bxxk- Ol
<IBLEOEO verre (brows, bokeee)>
مه >
۵۵ # 0 اسر سس
۵601۵60۶ # 1086606 ره
1 apie _siert,
<(ه سم
<IBD IGT asiower
meter 40 # ۵
ی TREES # REQOIREO>
. dedoraizgs Por broock, bokrase, custocer_xeKve,
] ood mstower_viy
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. سا0 لح 0 لا سواه 1 موه
صفحه 23:
+ NOL dae wik W aad WREE ات
><
> )موه 00 امه 00067<
> هجو >
<عصدداصا/> 0000© <عصدامجا>
>
<ousiomer مه 00000 لسع )0000<
> ل<عسی_ </owstower_sexve>
<newwer_sireet> Ovave </nustvwer_sireet>
<mewwer_viy> — Oxdisva</custower_vipy>
حوموصو|>
> میت 00067 دمصت ۵400 0065
<asinver_oave> Day هه
<custower_sireet> Bric S/awtower_stireet>
<pewwer_viy> — Oewurk </oustower_viy>
حوموصو|>
<لمی>
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. سا0 لح 0 لا سواه 1 موه
صفحه 24:
+ Licotaowes oP OT Os
Be typi oF اه له ماه فا
© Oluckes oe six, ات رن ها من
۲ 0 to مه vaordered sets oP واه
© Order ip nly irrelevant te dotubuses (vole to the domreecthyrut
eoiroved Prow which XL evolved)
© @ | ©) dws speoP dion of فا رت ای مه
> Camert pare that park oP @ aad @ poms oly roe
BW ocd TRE Ps oe vce
© Dke nwuers otinbute oP oc acorunt way oodtain a rePereore te cote
موی ها ات ,اوه
وه وا ان وا یی سا رال له ماه حوو
ماه
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. woe ©Sbervehnts, Cork ced Cnakershe
صفحه 25:
+ X@L Orkewa
© XOb Gchewa is 9 wore suphisicded sche hrauage whick addresses the
drawbacks of OTODs. Supports
© Dy preg oF yokes
* @.x, rteyer, siren, اه
۲ موه ,بط va wiolwax voles
© OserdeRaed, cowlex yer
© Ooo wore Peutures, fochudkay
١ فصيو" لجن دعص وص hey pocstrains, tcheriaare
© XOb Gchew is tse spectied in XOL syotax, uthe DTOs
© Oore-stondard represeutaiva, bul verbose
© XOb Gchewe tf iteyroted wih ی
B GOT: XOL Gchewa ts siqaPicodly wore cowphcdted tat DT Os.
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. سا0 لح 0 لا سواه 1 موه
صفحه 26:
+ X@L Ockewa Ovrsiva oP Bad OTO
سا ,۵ ۱)۱۵۱/۷ کرو نکر سا هکم امد مورک
<ol>
سیک exon ="aoorant_sanvber” ype" birt />
we مایت
كد لماعك
<عمصجسووهم|>
حسبرالصام عمج :| >
>
.... اور لو ی اه مه
<'سور )وه سر سامممونم>
سوک
7 0
< ی سوه )وت ۳ موه روط موی >
< یک هکم ۳( موه( توس >
>
Dype> سابوممسنمل>
</xetovkewa>
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. wee ©Sbervehnts, Cork ced Cnakershe
صفحه 27:
+ X@L Ockewa Ovrsiva oP Bad OTO
© Choice oP xe.” wae pure — ony her oneespare prefix could be chose
© Clewen “buck” hos ype “Back Dye", which ip deProed seporciely
© xstorwplex Type is ved biter to oreute the canned complex Ve
“Bad ype”
© Glewed “arco” hus its type dePiced terior
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. wor ©Sbervehnts, Cork ced Cnakershe
صفحه 28:
Qore Peaues oP XOb Ockewa
© Otrbutes اند روا تاو ter:
* >: <الجتامصجح_محصحه" - ممم صحاف
© هلكلمي لجتامجمد ججا اصسجه عداس عمصم "لجمشوصم" 2 وب صنجاطه هذا
© و ای مت تم رو a hey Por یی وه موه the
تاه لا اسر
> روا مج < موم بو
> سح لطس < مود موی <
و سک و
<روانی>
۲ تمه وا ود ما موی روا و
> نج )الصممي وا توا همطل < سم سای <
Sxeiselevior xpak < سح لطس <
> لاس سس < گم الا <
و
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. سا0 لح 0 لا سواه 1 موه
صفحه 29:
+ لت برس TrawPorckey XOL Oda
ره و موه با نموت متا
des امس
took وه by لس ای لصا Obove tie ore closely
ما هلوس با للم
۳ 9
تعسو اجه مه مممها وق
xo ©
تا لو با و تلا مت متا Greople hoocquage destqoed Por *
to WOOL
© ص6۵
١ Ba XOb query kregquerge wil: a rick set oP Pectures:
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. سا0 لح 0 لا سواه 1 وه
صفحه 30:
+ Tree Dede oP XOL Oca
© Qhery od texePorwaivs kreenges ore based vo و tree wodel oP XOL data
Ba XO) donned & worded os 0 tree, wih wdes correspradiny ty elewents ond
اه
جوم واه مه ماع موی انیت لاه سره له ام
ماك دما خام Dex tooo peur ts wordeled aso text orde chid
te their order to the XOL dorancect عمل صصص Obidres of a onde are ordered
Clewent oad ctirbute codes (except Por the root code) hove o pind parent, which
oc pleut oe
(© Phe root ade hos a siege chi, which is the root elewedt oP the domnvect
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. woo ©Sbervehnts, Cork ced Cnakershe
صفحه 31:
+ X@uk
Bl XPak & wed tp ckbese (orton!) parte of ص دمجم
poh previ
۲ 0 poh expressiva is u sequewe of steps امه
© Dhick oP Pile caves foo dreviory hierarchy
BO Result oP pak expressive: set of values thot dca ی کیت
جلدم لاه سا اس اه حول
۱ اس تلو مومسم ع bool) cuter we
sew porter retires
Scustower_sawe oe </rstcer_xnnve>
Smusiower_sae>Oory</asiower_snrve>
Gk, He eae th ee
returnees the مش تج ,موی و the coclosicny كعم
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. سا0 لح 0 لا سواه 1 موه
صفحه 32:
X@uk (Cou)
BD he لصم "1" decries root of the dorancect (cove the to-tovel te)
Bl Pak express oe evchnted fA to right
© Gack sep operdes on the set of etree produced by the previne sey
11 Getevies predodies way Polow oy step tra pot, []
* ساس مس اما بت < POO]
reine مما محفصي صان سل و جلانن اجات ححص POO
١ یاه موه اه لمحم مسجم [عدمامط] مت حصط اما
ملد
1 ماص "©"
© Cy, امه_مم 6 [600۵ < مساق
۱ یی he orcad axnobers of arconte wih bokare > POO
۰ 10۵6 مه سس رهاط بت بو لته his ter)
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. woe ©Sbervehnts, Cork ced Cnakershe
صفحه 33:
+ Cxrstrw to XP ok
۲ X@ak provides عمط اوه
ما مات خن ای سا عقوت تم و othe eed of ( مت مش ©
pats بط را لهس بو با
۱ (سسها امس اما مق < ©[
- مه مق wth > 6 هه
۶ مس سا Por texters ponies ((, ©, ..) oP oe wart. ماه
Bl @ooeon صخا لم اذ لمي اج صم صمي oo) cam be weed ia predicies
۶ WRECPs cos be rePerewed iste میت 0)(
© id() coo dsy be opted to sets oP rePereues suck os IDRECG ond ever
ty امه و( وال بای وه by backs
لجسم )سمه ا حصا .© ©
اجه oP اه نی | مت نا لاصو اه سب
هی
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. woo ©Sbervehnts, Cork ced Cnakershe
صفحه 34:
+ Ove XP ck وس خسن
Bo Operdor "|" weed to Roped ira
© Bx, Ibo Clhemmnild(@oweer) | سا @berewer)
١ Bies nrtrers wih ether acco nts or borer
> Whowever, “|" can be له ide ober operdore.
BY? oxi be veed to ship crue levels oP codes
© ومم_ ححص و|اقطما مه
۱ جما عصلمب جمجطانييوه مجك بمد_وصماصج نوه [bora
ای ۱ جات و ماه سا اه ميب امسر
© 0 step tothe pub coo yw ty poreus, siiogs, co | ch dercits oF th
تحص لیم by the previous step, uot et to یاهع
۰ ۰ desorbed chove, جا 3 shor Brow Por speck ian "عم مس
© 0 species be pared.
Boo (cane) retarces the root of 9 oenned doranvet
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. woe ©Sbervehnts, Cork ced Cnakershe
صفحه 35:
XQuery
© XQuey tp 0 geverd purpose عمجت زر Por XL dota
۲ روا تلو ما رامین the Dortd Dice Deb Oowsoritn (DOC)
© Dhe textbook desorption ts bored vo a kenny CDOS droht oF the
stantard. The Pied versica way dPPer, but oor Peutures likely to stay
ی
© XQeery is derived Prow the Quit query lrogquage, whick سس ام Pro
GQL, XQ ved XML-GL
۲ XQen wes ه
Por... tet... where... order by لفجحب...
یرو
GAL Pow جم
where © (GAL where
order by © GAL order by
سید rent © GQ
equidect kr GAL مه bt dws teeporay vorkbes, ond kar
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO.
صفحه 36:
+ 6006 6+ ta XQuery
۲ Por knee wes X(Puk expressions, ond vorteble ta Por واه renee over voor i
the set retired by Xa
۲ Grope PLOOR expression it XQuery
© Pred ol arom eis wits bokere > POO, wik euk result eocboeed te ort
هما <جطامسی_ میلگ .. امس _مجمی>
Por See kl ee
با Sunt ام ما ع:
ما5 ات < 600
حجباصج_ سح !> ( سل ) < ایتک مور
© وات فصا با( )ا صمت وجاك مممجور ححا دا سسا eorksed tc {}, ter hick rose they
عامج و
© bet cknse wt redly weeded to this query, ood selective coo be doo Io XPak. Query
pan be writes a!
[0000:)<سسممامجا] صصص | 6 حامص ا Por $x in
حك م5 | اس رس سب
_السجوهه|>
Px GO, OOO. wee ©Sbervehnts, Cork ced Cnakershe بسع *© - مرجي س9 لوق
صفحه 37:
سل +
Boke oe sperPed iro omer very stoke 7 GAL
Por $0 ta lint,
$0 te ماس طاطحنا
50 ۰ سل
الط < چام پیمولد؟ وان
موجه واه؟ له
حمسو سه معنن | Se Say ee
Bh Dhe sowe query oon be expressed wik مراد spoofed we XPak
سس رل سیب وت
<اسه_صهاک> ( 50 92 ) حاممد_صج> مور
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. wor ©Sbervehnts, Cork ced Cnakershe
صفحه 38:
هس +
18 وه توص پا با dota Brow the Plat structure Por boots ما وت the
vested structure used tt boc!
>< )
Por $e ta foo stower
rer
<pustxrer>
{ $o/"* }
الم سما لم + ی
a
سب $a}
> مسا
( <مال>
© Sol* dewtes oll the chidres oP the ode ty whick $r te bowed, wihout the eodlestery top
fevel tory
BE Scleni() ماه روت جات ماه مخ مت بت رف | kre
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. wee ©Sbervehnts, Cork ced Cnakershe
صفحه 39:
+ Gorkay ht XGhaey
15 Dhe ordbr by okay vont be wed ut he ead oP oxy expresvion. Oa. rekra nwiwcery sorted by
مرس ولج ۰ 5 بیط
[7 envy
حجومسو|> ( *إ30 ) ججمصافى> مسج
Bl Dor oreky by Suletruer_snnie tp ort ١ عطست مط مسصصسة
onal by accent_xurber wikia rack ,وی ی (oot by جناي Qo oor ot andy eves oP ها
مامت
<tr> {
و
۳
rhe
ی
$ol* } {
ی ما یکی مومس ج ول ما ۰ 5۱ Por {
[ [جایی_ سکع جوامیه_ نسم ]لها موق
جیاتن5 by ی
retars Sarat $al* <laromnt>
Shawnie
<br> }
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. wee ©Sbervehnts, Cork ced Cnakershe
صفحه 40:
+ Pawan Gai Our XGhaey Cackrer
‘he * (ve ta decked) indicus 0 sequeue of uch of thot ire
۳ 0105 بت سیخ لت the type systew of XOL Ocho
Banton bokraes (xe ‘striee $12) retary boi(neidevicrd") {
Por $d ta (buch! depostor[amiower_senve = Sr],
[ا_ سل < لیاسم ولا دا و3
سمل متا
}
19 Dyes oe opiived Por Puontica poraweters ocd retura volves
© Ocversd ocd existential quaciPicdiog it where ck وحم
© sowe $e ta pak sobPes P
© poy $e ta poh sues P
© XQuery dbo supports hewebe chases
مومه
Px GO, OOO. بسع *© - مرجي س9 لوق
صفحه 41:
XOLT
BO vptevhert sires Porwutioy optivos Por a domed, usudly separdiely Pow
© Cy. vo WT OD sie sheet way speck y Poot oolore aed sizes Por heuckorer,
3-3
ری و لحم نمی سم (را))) بحس حصنا اسسدإسارو) 001لا 11 19
مس باب
۲ موم ماو ملس وت را
© بل تلا لت تلا سا رل)۷ا اسب ون
۲ ه شوه را expressed wet nes coed tewphies
© Dewphtes cowbice selevtiog ustoy X Pubs wit: coustruntion of res ue
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. سا0 لح 0 لا سواه 1 موه
صفحه 42:
XGLT Tewpkiss
Crcrople oF XLT texopkte wits xvi ond elect port
> سا کم اس بسا <
ی
اراک
> ساسا cote" >
ا atk و مس و موه اراد ان سای
۲ تا ta the ست من ما مایت تحص با processed by the وميه wikia
the xobiewphite سماد
© مزا selents (ours) specPied ucker (here, oveiwer_snre)
۳ ات روم ای بت ول ما مسا و
© یله cen text oocteuis are ult
© له مه لاو راومه ار
ا
و مجان وج شومر ارود تك وجل موصو سم
© Oped که بات بل مرن تا مسجت و
رو موه و من لصو لح جا وه رام مها اوه اون ماه مه ۱ ۲
اس سوه سود
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. wee ©Sbervehnts, Cork ced Cnakershe
صفحه 43:
+ Orectoq XOL Oup
Buy tent or iy ithe XBL sifechert thot i ol fa the 20k waweepare by ouipul or i
Bg. to wep ren in ,اه را( تنم
<xshtewphate wratch="/bods-Olrustrwer">
>
مه ای امسامناو>
> ۲ص <
سا
اس ساممسنای> <
© Gxexople vulput
Sawtower> doe </oustower>
<aetirwer> Day </oustower>
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. wee ©Sbervehnts, Cork ced Cnakershe
صفحه 44:
+ مهن XOL Ouput (Oo)
۲ و Coca dreniy tosert 0 xelivdue-of tog tostde corther tory
© G5, cama cred ویک بط مه ta he previne emnope by اس
سس نام وی
مه سا جوا نا سا هناهد صصمت و لوا ۶
پبپ۰ب-دددسسا-
حمسه> وه ۱
مهس ات اس>
<ا_مست" > اسایه سل نامک
<س وا ها >
<ممسول>
9
“م ۱ اه صمسعصی>
ل ل و ل ا 22س
Px GO, OOO. wee ©Sbervehnts, Cork ced Cnakershe بسع *© - مرجي س9 لوق
صفحه 45:
Grrwtard Reowswa
ماه Decopkte ontea cos opp) terres recursively 7 ke poaiccts oP a cocked للا
<rohtewphite wich="Iboh”>
<asiovers>
Srobtewphite ppl terphies!>
صومحصو|> <
<roktewphie>
<roltecnphae vack="/ostower">
<custower>
<rohvohe-vP سس تساه
حوووصج|>
<roktewophte>
< ۲ص صطاممجنای>
B Crop
<nstowers>
<pstower> loka </rustower>
حوووصج|> بجو() حومووصج>
حمورووصو|>
Px GO, OOO. بسع *© - مرجي س9 لوق
صفحه 46:
Notes ta MOLT
۲ را keys dlaw clewests ty be looked up (indexed) by تاش مه وله و تلا
۶ Qeye onet be decked (wil a unre) ond, the hep() Puortion coo thea be used Por
مسا 2.
کی وکسم روااو>
<ا مکی
(۲۵ :مس واه امسد راک
را ۱ Beye perwt (sowe) pre ty be expressed
<الجاصج_ مح "حبس " "تاعفار "ماسح حصب بود نايك
موی هه ای تکوم راو >
< سس ای صاومس ای >
<سه_سی>
<ا( سس ,ماسجا )سوه سل ناک
<ا( یهن ,)ره اس زا >
حسم_سو>
<ص اهنا >
امس سمامسسنامی>
4
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. wee ©Sbervehnts, Cork ced Cnakershe
صفحه 47:
را سم +
Osta ام drevive teste o tewphite cases ofl eleweuts waichiey the tecrptae
to be sorted
ارس مان ری ساسا مس Garten ©
Sxshiewplate watch="/back">
<xshupphtewphies selevt="rsinwer”>
> سس موه موزل <
Sheskapphewphies>
> ارجام
>: <”لوموصج "حجاعوجم جاماومج
>
<اعمم_صصمصصج "حامجايد “اص اسذات>
<|”وود_صوصصاصج "حامجايه “اص اسزات>
> روص ی سای مصامنای <
حوووصو|>
>
> ون ماو "| <
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. wer ©Sbervehnts, Cork ced Cnakershe
صفحه 48:
+ سس رت (Progen ‘hae Par
Bl Dhere a to stented اد موس مار to XL cheat
© COX (Giore BOA Por XOL)
» @used va parser wodel, weer provides evedt hoaders ره رم و
ور stat oP cewed, ead of rece
وب دسج و(
© DOO (orrncect Obert Ort)
> XOD chia & parsed kyo tree represectaios
> Oar oF للم مس Por رورم he DOO tree
« توق dart OOO BP provides Dede chase wth weeds
[۱ ), )صاطق دناس ,( )لل ساس (
xe(Birinte( ), ce(Dcta( ) (Por text coe)
هت ات ), 2.
١ bp provides Pucetioas Por updater DOO tree
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. wee ©Sbervehnts, Cork ced Cnakershe
صفحه 49:
+ Ovrag oP XOL Owe
© XOb dota co be stored it
© وه بل مایمن
٠١ Phot Pies
~ Oxturdl Por stortery OL
— ut kos oll problews deterred ta Chapter 0 (a7 earurrruy, جم
recovery, ...)
* XOD database
~ Oxtobuse bult specPicdly Por stortag XOL data, supports DOD
ی سول له ال
- رو وولو و زان
© مش dotcbors
* Dota cust be trocstated toto retaticod Porc
* Odvactage: woture dutcbasr systews
* Osadvadtages? overkead oF trocar date cod queries ha
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. wee ©Sbervehnts, Cork ced Cnakershe
صفحه 50:
مومه
Px GO, OOO. بسع *© - مرجي س9 لوق
صفحه 51:
+ Grey Represeckiva
اد ماه و عون تاه الم BE Gtre ewok tp bevel elewect oF 0 sito
عن اه سوه وا مق Ose connie ©
جور مه امرطوت ات و ما موه و Ope ©
اس و وه ره وق ۱
مه to store the هروه و رس او
he هط to be tendexed as extra ها Gre uch of sibel ©
hove Pick مه لها اجه متیر
ام روج و هو ١ Bax,
© Gowe رل عون نموه مرو تال whick use the result oP
ی توا اجه ی(
۱ Dhe Puantiog should retura the vdlue oP the required subele went اه
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. 00.60 ©Sbervehnts, Cork ced Cnakershe
صفحه 52:
+ Oriaq Reprevecktioa (Ova)
© @evehic:
© Com sire way XOL dota even witout DTO
© Os troy os here ore wony toptevel cleweuis io domed, اه ore
awl cowpared to Pull dorancect
١ Blows Post access to todvidud eleweuts.
۲ Oraubuck: Deed ty parse sirays ty uovess voles tside the اه
© Posie is slaw.
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. woo ©Sbervehnts, Cork ced Cnakershe
صفحه 53:
Vree Repression
Bl Vee repreveunion: بلست XO) det os tree ond store usin rehtiocer
sexks(tl, tare, kel, whe)
chk (ctl td, rorect_rd)
brschs (nk)
rastrwer (iO) نك) سح 6(
امه 0 سم _ مجان
۵ 9( (i: (
ام وی ه فا اه موه او
۲ اه امه عصلی ter
Lobel speviPies اه وله اه و ركم جما trate
Ondue tp the text udue of امه سل
ke relics chit wtes the parcat-chid rekiicaships tc the tree
اجه اه ره لس وا لالم Cecodd oo exira uiribuie to ©
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO.
صفحه 54:
)ده و ال Vee +
© @evehit Cua sire wy XOL dag, eve witout OTD
HB Orabats:
© Onis brokeo هه سود توص بو با ما و
© Quen stop ات ,عم چاه ای واه سود هم rae be su
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. woe ©Sbervehnts, Cork ced Cnakershe
صفحه 55:
+ Drpptay XOL Orta to تا
0 Relate pera Bre each تام ما ان و بو
© ard aire صا otore a uci id Por euch ebro
© © rebtion aidbnte correspradny ty fark elect crib te
© @ pore _H tthe to heey track oP porect elewet
> Oe the tee represestaios
١ Poston kPorwaton (chi) con be store io
۲ ۵۱ اه ما ما وه ی رای مج با تمه
© Por texted subeleweds, store اس اجه با بط
سم پیب با cam و bre rk he os یط
Bl Cibebweds thot oo جاب موه وه او و ی و
© سمل to koodlog oP حول ۲) شمه ارت واه لصامطمی to
ال
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. woo ©Sbervehnts, Cork ced Cnakershe
صفحه 56:
+ Ovrieg XO Orta a Reksoud سس
§ Publshiey: provess oP coaverteg retaticod date to ot XOL Porat
۲ لمات process oP coaveriey ot XL doranvedt tei a get oP tuples to be
وا لو vo or wore rekiccs
© XOL-coubled database systews support cuicwoted الم oad shredders
© Gowe stews oP Per oatve steroge oF XL data usta the xen dats ye.
(Gpertd toterod dota structures ced todices are used Por ef Pinteamy
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. woo ©Sbervehnts, Cork ced Cnakershe
صفحه 57:
را +
© Dew standard GGL exteosiva that glows ای بل( تیه اه مش
© Gack pupa tuple & wopped tp oo XOL elewet row
له
میت
ریت
<جاه سس > 0400 حووامسم مه >
ح > مسصسو) ح >
> 000 سل
<ييوم|>
2 wore rows Phere ore wore DI جعاصب!
حسجويول>
<a>
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. wor ©Sbervehnts, Cork ced Cnakershe
صفحه 58:
تسده نوی +
اه با( میس ovbbwedt ©
اه من اد ۲
seen eoecedt are
ی مه مه و پر هار
اس ساسا سم ماما
robbed (aoe "kee", fukn)
امه مما
موه Px GO, OOO. بسع *© - مرجي س9 لوق
صفحه 59:
مه و0 +
موه (۵00) اسست) سا مان ان با Bl
اد مت نت ماوت و وج مه ۶
kept ced mip سوم و و لت با ۶
BO Deb service vu vie provider ۵0ج مسا و promedues
۶ Qrserbed usta the Deb Gerices Desorption Lopare (GOL)
© Orecores of Web senices oe desorbed win he Ooversd Description,
Oscovery, od eteurction (DDO) strnkad
Ocsdner Cyetrw Onewpte - O* Brtirg, Px GO, OOO. woo ©Sbervehnts, Cork ced Cnakershe
Chapter 10: XML
Database System Concepts
©Silberschatz, Korth and Sudarshan
See www.db-book.com for conditions on re-use
XML
Structure of XML Data
XML Document Schema
Querying and Transformation
Application Program Interfaces to XML
Storage of XML Data
XML Applications
Database System Concepts - 5th Edition, Aug 22, 2005.
10.2
©Silberschatz, Korth and Sudarshan
Introduction
XML: Extensible Markup Language
Defined by the WWW Consortium (W3C)
Derived from SGML (Standard Generalized Markup Language), but simpler to use
than SGML
Documents have tags giving extra information about sections of the document
E.g. <title> XML </title> <slide> Introduction …</slide>
Extensible, unlike HTML
Users can add new tags, and separately specify how the tag should be handled
for display
Database System Concepts - 5th Edition, Aug 22, 2005.
10.3
©Silberschatz, Korth and Sudarshan
XML Introduction (Cont.)
The ability to specify new tags, and to create nested tag structures make 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>
Database System Concepts - 5th Edition, Aug 22, 2005.
10.4
©Silberschatz, Korth and Sudarshan
XML: Motivation
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 formats
Database System Concepts - 5th Edition, Aug 22, 2005.
10.5
©Silberschatz, Korth and Sudarshan
XML Motivation (Cont.)
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
DTD (Document Type Descriptors)
XML Schema
Plus textual descriptions of the semantics
XML allows new tags to be defined as required
XML type specification languages to specify the syntax
However, this may be constrained by DTDs
A wide variety of tools is available for parsing, browsing and querying XML
documents/data
Database System Concepts - 5th Edition, Aug 22, 2005.
10.6
©Silberschatz, Korth and Sudarshan
Comparison with Relational Data
Inefficient: tags, which in effect represent schema information, are repeated
Better than relational tuples as a data-exchange format
Unlike relational tuples, XML data is self-documenting due to presence of
tags
Non-rigid format: tags can be added
Allows nested structures
Wide acceptance, not only in database systems, but also in browsers, tools,
and applications
Database System Concepts - 5th Edition, Aug 22, 2005.
10.7
©Silberschatz, Korth and Sudarshan
Structure of XML Data
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
Improper nesting
<account> … <balance> …. </balance> </account>
<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 element
Database System Concepts - 5th Edition, Aug 22, 2005.
10.8
©Silberschatz, Korth and Sudarshan
Example of Nested Elements
<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>
Database System Concepts - 5th Edition, Aug 22, 2005.
10.9
©Silberschatz, Korth and Sudarshan
Motivation for Nesting
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
key
Database System Concepts - 5th Edition, Aug 22, 2005.
10.10
©Silberschatz, Korth and Sudarshan
Structure of XML Data (Cont.)
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 representation
Database System Concepts - 5th Edition, Aug 22, 2005.
10.11
©Silberschatz, Korth and Sudarshan
Attributes
Elements can have attributes
<account acct-type = “checking” >
<account_number> A-102 </account_number>
<branch_name> Perryridge </branch_name>
<balance> 400 </balance>
</account>
Attributes are specified by name=value pairs inside the starting tag of an element
An element may have several attributes, but each attribute name can only occur once
<account acct-type = “checking” monthly-fee=“5”>
Database System Concepts - 5th Edition, Aug 22, 2005.
10.12
©Silberschatz, Korth and Sudarshan
Attributes vs. Subelements
Distinction between subelement and attribute
In the context of documents, attributes are part of markup, while subelement
contents are part of the basic document contents
In the context of data representation, the difference is unclear and may be
confusing
Same information can be represented in two ways
– <account account_number = “A-101”> …. </account>
– <account>
<account_number>A-101</account_number> …
</account>
Suggestion: use attributes for identifiers of elements, and use subelements
for contents
Database System Concepts - 5th Edition, Aug 22, 2005.
10.13
©Silberschatz, Korth and Sudarshan
Namespaces
XML data has to be exchanged between organizations
Same tag name may have different meaning in different organizations, causing
confusion on exchanged documents
Specifying a unique string as an element name avoids confusion
Better solution: use unique-name:element-name
Avoid using long unique names all over document by using XML Namespaces
<bank Xmlns:FB=‘http://www.FirstBank.com’>
…
<FB:branch>
<FB:branchname>Downtown</FB:branchname>
<FB:branchcity> Brooklyn </FB:branchcity>
</FB:branch>
…
</bank>
Database System Concepts - 5th Edition, Aug 22, 2005.
10.14
©Silberschatz, Korth and Sudarshan
More on XML Syntax
Elements without subelements or text content can be abbreviated by ending the start tag
with a /> and deleting the end tag
<account number=“A-101” branch=“Perryridge” balance=“200 />
To store string data that may contain tags, without the tags being interpreted as
subelements, use CDATA as below
<![CDATA[<account> … </account>]]>
Here, <account> and </account> are treated as just strings
CDATA stands for “character data”
Database System Concepts - 5th Edition, Aug 22, 2005.
10.15
©Silberschatz, Korth and Sudarshan
XML Document Schema
Database schemas constrain what information can be stored, and the data types
of stored values
XML documents are not required to have an associated schema
However, schemas are very important for XML data exchange
Otherwise, a site cannot automatically interpret data received from another
site
Two mechanisms for specifying XML schema
Document Type Definition (DTD)
Widely used
XML Schema
Newer, increasing use
Database System Concepts - 5th Edition, Aug 22, 2005.
10.16
©Silberschatz, Korth and Sudarshan
Document Type Definition (DTD)
The type of an XML document can be specified using a DTD
DTD constraints structure of XML data
What elements can occur
What attributes can/must an element have
What subelements can/must occur inside each element, and how many
times.
DTD does not constrain data types
All values represented as strings in XML
DTD syntax
<!ELEMENT element (subelements-specification) >
<!ATTLIST element (attributes) >
Database System Concepts - 5th Edition, Aug 22, 2005.
10.17
©Silberschatz, Korth and Sudarshan
Element Specification in DTD
Subelements can be specified as
names of elements, or
#PCDATA (parsed character data), i.e., character strings
EMPTY (no subelements) or ANY (anything can be a subelement)
Example
<! ELEMENT depositor (customer_name account_number)>
<! ELEMENT customer_name (#PCDATA)>
<! ELEMENT account_number (#PCDATA)>
Subelement specification may have regular expressions
<!ELEMENT bank ( ( account | customer | depositor)+)>
Notation:
– “|” - alternatives
– “+” - 1 or more occurrences
– “*” - 0 or more occurrences
Database System Concepts - 5th Edition, Aug 22, 2005.
10.18
©Silberschatz, Korth and Sudarshan
Bank DTD
<!DOCTYPE bank [
<!ELEMENT bank ( ( account | customer | depositor)+)>
<!ELEMENT account (account_number branch_name balance)>
<! ELEMENT customer(customer_name customer_street
customer_city)>
<! ELEMENT depositor (customer_name account_number)>
<! ELEMENT account_number (#PCDATA)>
<! ELEMENT branch_name (#PCDATA)>
<! ELEMENT balance(#PCDATA)>
<! ELEMENT customer_name(#PCDATA)>
<! ELEMENT customer_street(#PCDATA)>
<! ELEMENT customer_city(#PCDATA)>
]>
Database System Concepts - 5th Edition, Aug 22, 2005.
10.19
©Silberschatz, Korth and Sudarshan
Attribute Specification in DTD
Attribute specification : for each attribute
Name
Type of attribute
CDATA
ID (identifier) or IDREF (ID reference) or IDREFS (multiple IDREFs)
–
more on this later
Whether
mandatory (#REQUIRED)
has a default value (value),
or neither (#IMPLIED)
Examples
<!ATTLIST account acct-type CDATA “checking”>
<!ATTLIST customer
customer_id ID
# REQUIRED
accounts
IDREFS # REQUIRED >
Database System Concepts - 5th Edition, Aug 22, 2005.
10.20
©Silberschatz, Korth and Sudarshan
IDs and IDREFs
An element can have at most one attribute of type ID
The ID attribute value of each element in an XML document must be distinct
Thus the ID attribute value is an object identifier
An attribute of type IDREF must contain the ID value of an element in the
same document
An attribute of type IDREFS contains a set of (0 or more) ID values.
Each ID value must contain the ID value of an element in the same document
Database System Concepts - 5th Edition, Aug 22, 2005.
10.21
©Silberschatz, Korth and Sudarshan
Bank DTD with Attributes
Bank DTD with ID and IDREF attribute types.
<!DOCTYPE bank-2[
<!ELEMENT account (branch, balance)>
<!ATTLIST account
account_number ID
# REQUIRED
owners
IDREFS # REQUIRED>
<!ELEMENT customer(customer_name, customer_street,
customer_city)>
<!ATTLIST customer
customer_id
ID
# REQUIRED
accounts
IDREFS # REQUIRED>
… declarations for branch, balance, customer_name,
customer_street and customer_city
]>
Database System Concepts - 5th Edition, Aug 22, 2005.
10.22
©Silberschatz, Korth and Sudarshan
XML data with ID and IDREF attributes
<bank-2>
<account account_number=“A-401” owners=“C100 C102”>
<branch_name> Downtown </branch_name>
<balance>
500 </balance>
</account>
<customer customer_id=“C100” accounts=“A-401”>
<customer_name>Joe
</customer_name>
<customer_street> Monroe </customer_street>
<customer_city> Madison</customer_city>
</customer>
<customer customer_id=“C102” accounts=“A-401 A-402”>
<customer_name> Mary </customer_name>
<customer_street> Erin
</customer_street>
<customer_city> Newark </customer_city>
</customer>
</bank-2>
Database System Concepts - 5th Edition, Aug 22, 2005.
10.23
©Silberschatz, Korth and Sudarshan
Limitations of DTDs
No typing of text elements and attributes
All values are strings, no integers, reals, etc.
Difficult to specify unordered sets of subelements
Order is usually irrelevant in databases (unlike in the document-layout
environment from which XML evolved)
(A | B)* allows specification of an unordered set, but
Cannot ensure that each of A and B occurs only once
IDs and IDREFs are untyped
The owners attribute of an account may contain a reference to another
account, which is meaningless
owners attribute should ideally be constrained to refer to customer
elements
Database System Concepts - 5th Edition, Aug 22, 2005.
10.24
©Silberschatz, Korth and Sudarshan
XML Schema
XML Schema is a more sophisticated schema language which addresses the
drawbacks of DTDs. Supports
Typing of values
E.g. integer, string, etc
Also, constraints on min/max values
User-defined, comlex types
Many more features, including
uniqueness and foreign key constraints, inheritance
XML Schema is itself specified in XML syntax, unlike DTDs
More-standard representation, but verbose
XML Scheme is integrated with namespaces
BUT: XML Schema is significantly more complicated than DTDs.
Database System Concepts - 5th Edition, Aug 22, 2005.
10.25
©Silberschatz, Korth and Sudarshan
XML Schema Version of Bank DTD
<xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema>
<xs:element name=“bank” type=“BankType”/>
<xs:element name=“account”>
<xs:complexType>
<xs:sequence>
<xs:element name=“account_number” type=“xs:string”/>
<xs:element name=“branch_name”
type=“xs:string”/>
<xs:element name=“balance”
type=“xs:decimal”/>
</xs:squence>
</xs:complexType>
</xs:element>
….. definitions of customer and depositor ….
<xs:complexType name=“BankType”>
<xs:squence>
<xs:element ref=“account” minOccurs=“0” maxOccurs=“unbounded”/>
<xs:element ref=“customer” minOccurs=“0” maxOccurs=“unbounded”/>
<xs:element ref=“depositor” minOccurs=“0” maxOccurs=“unbounded”/>
</xs:sequence>
</xs:complexType>
</xs:schema>
Database System Concepts - 5th Edition, Aug 22, 2005.
10.26
©Silberschatz, Korth and Sudarshan
XML Schema Version of Bank DTD
Choice of “xs:” was ours -- any other namespace prefix could be chosen
Element “bank” has type “BankType”, which is defined separately
xs:complexType is used later to create the named complex type
“BankType”
Element “account” has its type defined in-line
Database System Concepts - 5th Edition, Aug 22, 2005.
10.27
©Silberschatz, Korth and Sudarshan
More features of XML Schema
Attributes specified by xs:attribute tag:
<xs:attribute name = “account_number”/>
adding the attribute use = “required” means value must be specified
Key constraint: “account numbers form a key for account elements under the
root bank element:
<xs:key name = “accountKey”>
<xs:selector xpath = “]bank/account”/>
<xs:field xpath = “account_number”/>
<\xs:key>
Foreign key constraint from depositor to account:
<xs:keyref name = “depositorAccountKey” refer=“accountKey”>
<xs:selector xpath = “]bank/account”/>
<xs:field xpath = “account_number”/>
<\xs:keyref>
Database System Concepts - 5th Edition, Aug 22, 2005.
10.28
©Silberschatz, Korth and Sudarshan
Querying and Transforming XML Data
Translation of information from one XML schema to another
Querying on XML data
Above two are closely related, and handled by the same tools
Standard XML querying/translation languages
XPath
XSLT
Simple language consisting of path expressions
Simple language designed for translation from XML to XML and XML
to HTML
XQuery
An XML query language with a rich set of features
Database System Concepts - 5th Edition, Aug 22, 2005.
10.29
©Silberschatz, Korth and Sudarshan
Tree Model of XML Data
Query and transformation languages are based on a tree model of XML data
An XML document is modeled as a tree, with nodes corresponding to elements and
attributes
Element nodes have child nodes, which can be attributes or subelements
Text in an element is modeled as a text node child of the element
Children of a node are ordered according to their order in the XML document
Element and attribute nodes (except for the root node) have a single parent, which
is an element node
The root node has a single child, which is the root element of the document
Database System Concepts - 5th Edition, Aug 22, 2005.
10.30
©Silberschatz, Korth and Sudarshan
XPath
XPath is used to address (select) parts of documents using
path expressions
A path expression is a sequence of steps separated by “/”
Think of file names in a directory hierarchy
Result of path expression: set of values that along with their containing
elements/attributes match the specified path
E.g.
/bank-2/customer/customer_name evaluated on the bank-2 data we
saw earlier returns
<customer_name>Joe</customer_name>
<customer_name>Mary</customer_name>
E.g.
/bank-2/customer/customer_name/text( )
returns the same names, but without the enclosing tags
Database System Concepts - 5th Edition, Aug 22, 2005.
10.31
©Silberschatz, Korth and Sudarshan
XPath (Cont.)
The initial “/” denotes root of the document (above the top-level tag)
Path expressions are evaluated left to right
Selection predicates may follow any step in a path, in [ ]
Each step operates on the set of instances produced by the previous step
E.g.
/bank-2/account[balance > 400]
returns account elements with a balance value greater than 400
/bank-2/account[balance] returns account elements containing a balance
subelement
Attributes are accessed using “@”
E.g. /bank-2/account[balance > 400]/@account_number
returns the account numbers of accounts with balance > 400
IDREF attributes are not dereferenced automatically (more on this later)
Database System Concepts - 5th Edition, Aug 22, 2005.
10.32
©Silberschatz, Korth and Sudarshan
Functions in XPath
XPath provides several functions
The function count() at the end of a path counts the number of elements in
the set generated by the path
E.g. /bank-2/account[count(./customer) > 2]
– Returns accounts with > 2 customers
Also function for testing position (1, 2, ..) of node w.r.t. siblings
Boolean connectives and and or and function not() can be used in predicates
IDREFs can be referenced using function id()
id() can also be applied to sets of references such as IDREFS and even
to strings containing multiple references separated by blanks
E.g. /bank-2/account/id(@owner)
returns all customers referred to from the owners attribute of account
elements.
Database System Concepts - 5th Edition, Aug 22, 2005.
10.33
©Silberschatz, Korth and Sudarshan
More XPath Features
Operator “|” used to implement union
E.g. /bank-2/account/id(@owner) | /bank-2/loan/id(@borrower)
Gives customers with either accounts or loans
However, “|” cannot be nested inside other operators.
“//” can be used to skip multiple levels of nodes
E.g. /bank-2//customer_name
finds any customer_name element anywhere under the /bank-2
element, regardless of the element in which it is contained.
A step in the path can go to parents, siblings, ancestors and descendants of the
nodes generated by the previous step, not just to the children
“//”, described above, is a short from for specifying “all descendants”
“..” specifies the parent.
doc(name) returns the root of a named document
Database System Concepts - 5th Edition, Aug 22, 2005.
10.34
©Silberschatz, Korth and Sudarshan
XQuery
XQuery is a general purpose query language for XML data
Currently being standardized by the World Wide Web Consortium (W3C)
The textbook description is based on a January 2005 draft of the
standard. The final version may differ, but major features likely to stay
unchanged.
XQuery is derived from the Quilt query language, which itself borrows from
SQL, XQL and XML-QL
XQuery uses a
for … let … where … order by …result …
syntax
for
SQL from
where SQL where
order by SQL order by
result SQL select
let allows temporary variables, and has no equivalent in SQL
Database System Concepts - 5th Edition, Aug 22, 2005.
10.35
©Silberschatz, Korth and Sudarshan
FLWOR Syntax in XQuery
For clause uses XPath expressions, and variable in for clause ranges over values in
the set returned by XPath
Simple FLWOR expression in XQuery
find all accounts with balance > 400, with each result enclosed in an
<account_number> .. </account_number> tag
for
$x in /bank-2/account
let
$acctno := $x/@account_number
where $x/balance > 400
return <account_number> { $acctno } </account_number>
Items in the return clause are XML text unless enclosed in {}, in which case they
are evaluated
Let clause not really needed in this query, and selection can be done In XPath. Query
can be written as:
for $x in /bank-2/account[balance>400]
return <account_number> { $x/@account_number }
</account_number>
Database System Concepts - 5th Edition, Aug 22, 2005.
10.36
©Silberschatz, Korth and Sudarshan
Joins
Joins are specified in a manner very similar to SQL
for $a in /bank/account,
$c in /bank/customer,
$d in /bank/depositor
where $a/account_number = $d/account_number
and $c/customer_name = $d/customer_name
return <cust_acct> { $c $a } </cust_acct>
The same query can be expressed with the selections specified as XPath
selections:
for $a in /bank/account
$c in /bank/customer
$d in /bank/depositor[
account_number = $a/account_number and
customer_name = $c/customer_name ]
return <cust_acct> { $c $a } </cust_acct>
Database System Concepts - 5th Edition, Aug 22, 2005.
10.37
©Silberschatz, Korth and Sudarshan
Nested Queries
The following query converts data from the flat structure for bank information into the
nested structure used in bank-1
<bank-1> {
for $c in /bank/customer
return
<customer>
{ $c/* }
{ for $d in /bank/depositor[customer_name = $c/customer_name],
$a in /bank/account[account_number=$d/account_number]
return $a }
</customer>
} </bank-1>
$c/* denotes all the children of the node to which $c is bound, without the enclosing toplevel tag
$c/text() gives text content of an element without any subelements / tags
Database System Concepts - 5th Edition, Aug 22, 2005.
10.38
©Silberschatz, Korth and Sudarshan
Sorting in XQuery
The order by clause can be used at the end of any expression. E.g. to return customers sorted by
name
for $c in /bank/customer
order by $c/customer_name
return <customer> { $c/* } </customer>
Use order by $c/customer_name to sort in descending order
Can sort at multiple levels of nesting (sort by customer_name, and by account_number within each
customer)
<bank-1> {
for $c in /bank/customer
order by $c/customer_name
return
<customer>
{ $c/* }
{ for $d in /bank/depositor[customer_name=$c/customer_name],
$a in /bank/account[account_number=$d/account_number] }
order by $a/account_number
return <account> $a/* </account>
</customer>
} </bank-1>
Database System Concepts - 5th Edition, Aug 22, 2005.
10.39
©Silberschatz, Korth and Sudarshan
Functions and Other XQuery Features
User defined functions with the type system of XMLSchema
function balances(xs:string $c) returns list(xs:decimal*) {
for $d in /bank/depositor[customer_name = $c],
$a in /bank/account[account_number = $d/account_number]
return $a/balance
}
Types are optional for function parameters and return values
The * (as in decimal*) indicates a sequence of values of that type
Universal and existential quantification in where clause predicates
some $e in path satisfies P
every $e in path satisfies P
XQuery also supports If-then-else clauses
Database System Concepts - 5th Edition, Aug 22, 2005.
10.40
©Silberschatz, Korth and Sudarshan
XSLT
A stylesheet stores formatting options for a document, usually separately from
document
E.g. an HTML style sheet may specify font colors and sizes for headings,
etc.
The XML Stylesheet Language (XSL) was originally designed for generating
HTML from XML
XSLT is a general-purpose transformation language
Can translate XML to XML, and XML to HTML
XSLT transformations are expressed using rules called templates
Templates combine selection using XPath with construction of results
Database System Concepts - 5th Edition, Aug 22, 2005.
10.41
©Silberschatz, Korth and Sudarshan
XSLT Templates
Example of XSLT template with match and select part
<xsl:template match=“/bank-2/customer”>
<xsl:value-of select=“customer_name”/>
</xsl:template>
<xsl:template match=“*”/>
The match attribute of xsl:template specifies a pattern in XPath
Elements in the XML document matching the pattern are processed by the actions within
the xsl:template element
xsl:value-of selects (outputs) specified values (here, customer_name)
For elements that do not match any template
Attributes and text contents are output as is
Templates are recursively applied on subelements
The <xsl:template match=“*”/> template matches all
elements that do not match any other template
Used to ensure that their contents do not get output.
If an element matches several templates, only one is used based on a complex priority
scheme/user-defined priorities
Database System Concepts - 5th Edition, Aug 22, 2005.
10.42
©Silberschatz, Korth and Sudarshan
Creating XML Output
Any text or tag in the XSL stylesheet that is not in the xsl namespace is output as is
E.g. to wrap results in new XML elements.
<xsl:template match=“/bank-2/customer”>
<customer>
<xsl:value-of select=“customer_name”/>
</customer>
</xsl;template>
<xsl:template match=“*”/>
Example output:
<customer> Joe </customer>
<customer> Mary </customer>
Database System Concepts - 5th Edition, Aug 22, 2005.
10.43
©Silberschatz, Korth and Sudarshan
Creating XML Output (Cont.)
Note: Cannot directly insert a xsl:value-of tag inside another tag
E.g. cannot create an attribute for <customer> in the previous example by directly
using xsl:value-of
XSLT provides a construct xsl:attribute to handle this situation
xsl:attribute adds attribute to the preceding element
E.g. <customer>
<xsl:attribute name=“customer_id”>
<xsl:value-of select = “customer_id”/>
</xsl:attribute>
</customer>
results in output of the form
<customer customer_id=“….”> ….
xsl:element is used to create output elements with computed names
Database System Concepts - 5th Edition, Aug 22, 2005.
10.44
©Silberschatz, Korth and Sudarshan
Structural Recursion
Template action can apply templates recursively to the contents of a matched element
<xsl:template match=“/bank”>
<customers>
<xsl:template apply-templates/>
</customers >
</xsl:template>
<xsl:template match=“/customer”>
<customer>
<xsl:value-of select=“customer_name”/>
</customer>
</xsl:template>
<xsl:template match=“*”/>
Example output:
<customers>
<customer> John </customer>
<customer> Mary </customer>
</customers>
Database System Concepts - 5th Edition, Aug 22, 2005.
10.45
©Silberschatz, Korth and Sudarshan
Joins in XSLT
XSLT keys allow elements to be looked up (indexed) by values of subelements or attributes
Keys must be declared (with a name) and, the key() function can then be used for
lookup. E.g.
<xsl:key name=“acctno” match=“account”
use=“account_number”/>
<xsl:value-of select=key(“acctno”, “A-101”)
Keys permit (some) joins to be expressed in XSLT
<xsl:key name=“acctno” match=“account” use=“account_number”/>
<xsl:key name=“custno” match=“customer” use=“customer_name”/>
<xsl:template match=“depositor”>
<cust_acct>
<xsl:value-of select=key(“custno”, “customer_name”)/>
<xsl:value-of select=key(“acctno”, “account_number”)/>
</cust_acct>
</xsl:template>
<xsl:template match=“*”/>
Database System Concepts - 5th Edition, Aug 22, 2005.
10.46
©Silberschatz, Korth and Sudarshan
Sorting in XSLT
Using an xsl:sort directive inside a template causes all elements matching the template
to be sorted
Sorting is done before applying other templates
<xsl:template match=“/bank”>
<xsl:apply-templates select=“customer”>
<xsl:sort select=“customer_name”/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match=“customer”>
<customer>
<xsl:value-of select=“customer_name”/>
<xsl:value-of select=“customer_street”/>
<xsl:value-of select=“customer_city”/>
</customer>
<xsl:template>
<xsl:template match=“*”/>
Database System Concepts - 5th Edition, Aug 22, 2005.
10.47
©Silberschatz, Korth and Sudarshan
Application Program Interface
There are two standard application program interfaces to XML data:
SAX (Simple API for XML)
Based on parser model, user provides event handlers for parsing events
– E.g. start of element, end of element
– Not suitable for database applications
DOM (Document Object Model)
XML data is parsed into a tree representation
Variety of functions provided for traversing the DOM tree
E.g.: Java DOM API provides Node class with methods
getParentNode( ), getFirstChild( ), getNextSibling( )
getAttribute( ), getData( ) (for text node)
getElementsByTagName( ), …
Also provides functions for updating DOM tree
Database System Concepts - 5th Edition, Aug 22, 2005.
10.48
©Silberschatz, Korth and Sudarshan
Storage of XML Data
XML data can be stored in
Non-relational data stores
Flat files
– Natural for storing XML
– But has all problems discussed in Chapter 1 (no concurrency, no
recovery, …)
XML database
– Database built specifically for storing XML data, supporting DOM
model and declarative querying
– Currently no commercial-grade systems
Relational databases
Data must be translated into relational form
Advantage: mature database systems
Disadvantages: overhead of translating data and queries
Database System Concepts - 5th Edition, Aug 22, 2005.
10.49
©Silberschatz, Korth and Sudarshan
Storage of XML in Relational Databases
Alternatives:
String Representation
Tree Representation
Map to relations
Database System Concepts - 5th Edition, Aug 22, 2005.
10.50
©Silberschatz, Korth and Sudarshan
String Representation
Store each top level element as a string field of a tuple in a relational database
Use a single relation to store all elements, or
Use a separate relation for each top-level element type
E.g. account, customer, depositor relations
– Each with a string-valued attribute to store the element
Indexing:
Store values of subelements/attributes to be indexed as extra fields of the
relation, and build indices on these fields
E.g. customer_name or account_number
Some database systems support function indices, which use the result of a
function as the key value.
The function should return the value of the required subelement/attribute
Database System Concepts - 5th Edition, Aug 22, 2005.
10.51
©Silberschatz, Korth and Sudarshan
String Representation (Cont.)
Benefits:
Can store any XML data even without DTD
As long as there are many top-level elements in a document, strings are
small compared to full document
Allows fast access to individual elements.
Drawback: Need to parse strings to access values inside the elements
Parsing is slow.
Database System Concepts - 5th Edition, Aug 22, 2005.
10.52
©Silberschatz, Korth and Sudarshan
Tree Representation
Tree representation: model XML data as tree and store using relations
nodes(id, type, label, value)
child (child_id, parent_id)
bank (id:1)
customer (id:2)
account (id: 5)
customer_name
(id: 3)
account_number
(id: 7)
Each element/attribute is given a unique identifier
Type indicates element/attribute
Label specifies the tag name of the element/name of attribute
Value is the text value of the element/attribute
The relation child notes the parent-child relationships in the tree
Can add an extra attribute to child to record ordering of children
Database System Concepts - 5th Edition, Aug 22, 2005.
10.53
©Silberschatz, Korth and Sudarshan
Tree Representation (Cont.)
Benefit: Can store any XML data, even without DTD
Drawbacks:
Data is broken up into too many pieces, increasing space overheads
Even simple queries require a large number of joins, which can be slow
Database System Concepts - 5th Edition, Aug 22, 2005.
10.54
©Silberschatz, Korth and Sudarshan
Mapping XML Data to Relations
Relation created for each element type whose schema is known:
An id attribute to store a unique id for each element
A relation attribute corresponding to each element attribute
A parent_id attribute to keep track of parent element
As in the tree representation
Position information (ith child) can be store too
All subelements that occur only once can become relation attributes
For text-valued subelements, store the text as attribute value
For complex subelements, can store the id of the subelement
Subelements that can occur multiple times represented in a separate table
Similar to handling of multivalued attributes when converting ER diagrams to
tables
Database System Concepts - 5th Edition, Aug 22, 2005.
10.55
©Silberschatz, Korth and Sudarshan
Storing XML Data in Relational Systems
Publishing: process of converting relational data to an XML format
Shredding: process of converting an XML document into a set of tuples to be
inserted into one or more relations
XML-enabled database systems support automated publishing and shredding
Some systems offer native storage of XML data using the xml data type.
Special internal data structures and indices are used for efficiency
Database System Concepts - 5th Edition, Aug 22, 2005.
10.56
©Silberschatz, Korth and Sudarshan
SQL/XML
New standard SQL extension that allows creation of nested XML output
Each output tuple is mapped to an XML element row
<bank>
<account>
<row>
<account_number> A-101 </account_number>
<branch_name> Downtown </branch_name>
<balance> 500 </balance>
</row>
…. more rows if there are more output tuples …
</account>
</bank>
Database System Concepts - 5th Edition, Aug 22, 2005.
10.57
©Silberschatz, Korth and Sudarshan
SQL Extensions
xmlelement creates XML elements
xmlattributes creates attributes
select xmlelement (name “account,
xmlattributes (account_number as account_number),
xmlelement (name “branch_name”, branch_name),
xmlelement (name “balance”, balance))
from account
Database System Concepts - 5th Edition, Aug 22, 2005.
10.58
©Silberschatz, Korth and Sudarshan
Web Services
The Simple Object Access Protocol (SOAP) standard:
Invocation of procedures across applications with distinct databases
XML used to represent procedure input and output
A Web service is a site providing a collection of SOAP procedures
Described using the Web Services Description Language (WSDL)
Directories of Web services are described using the Universal Description,
Discovery, and Integration (UDDI) standard
Database System Concepts - 5th Edition, Aug 22, 2005.
10.59
©Silberschatz, Korth and Sudarshan