Turner<)q(/LA)q(ST>)q()q(5<)q(/PO)q(INT)q(S>)q()p Black -283 4114
5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 18 17 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-18)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1017 52 3310 4 v 1017 551 4 500 v 1103 397 a Fj(First)142
b(Example)j(\(2\))p 4323 551 V 1017 554 3310 4 v 4326
555 67 440 v 1083 621 3310 67 v Black 142 1018 a Fh(\017)p
Black 83 w Fi(A)100 b(cha)-7 b(racteristic)99 b(feature)h(of)f(X)-7
b(Query)101 b(a)-7 b(re)100 b(\\FL)-28 b(W)-7 b(OR-)324
1294 y(exp)g(ressions")83 b(\(p)-7 b(ronounced)83 b(\\Flo)-7
b(w)g(er-exp)g(ressions"\).)p Black 142 1645 a Fh(\017)p
Black 83 w Fi(This)98 b(name)h(is)g(derived)f(from)g(the)g(k)-7
b(eyw)g(o)g(rds)99 b Fg(for)p Fi(,)h Fg(let)p Fi(,)324
1920 y Fg(where)p Fi(,)85 b Fg(order)107 b(by)p Fi(,)83
b Fg(return)p Fi(.)p Black Black 608 2177 a Fo(They)66
b(a)-5 b(re)66 b(written)h(\\FL)-19 b(W)-5 b(OR-exp)g(ressions",)66
b(and)h(p)-5 b(ronounced)66 b(\\Flo)-5 b(w)g(er",)608
2351 y(although)51 b(t)-5 b(w)g(o)51 b(cha)-5 b(racters)51
b(a)-5 b(re)51 b(exchanged:)e Ff(where)i Fo(comes)f(b)5
b(efo)-5 b(re)49 b Ff(order)75 b(by)p Fo(.)p Black 142
2715 a Fh(\017)p Black 83 w Fi(The)86 b Fg(for)p Fi(-clause)h(co)-7
b(rresp)7 b(onds)85 b(to)h Fg(FROM)h Fi(in)f(SQL:)g(It)g(ge-)324
2990 y(nerates)d(a)f(sequence)i(of)e(va)-7 b(riable)83
b(bindings.)p Black 142 3341 a Fh(\017)p Black 83 w Fi(The)68
b Fg(return)p Fi(-clause)j(co)-7 b(rresp)7 b(onds)67
b(to)h Fg(SELECT)i Fi(in)e(SQL:)h(It)324 3617 y(p)-7
b(ro)7 b(duces)64 b(a)f(piece)h(of)f(output)f(fo)-7 b(r)62
b(each)i(va)-7 b(riable)64 b(binding)324 3893 y(that)82
b(satis\014es)h(the)f Fg(where)p Fi(-clause.)p Black
-283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 19 18 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-19)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1017 52 3310 4 v 1017 551 4 500 v 1103 397 a Fj(First)142
b(Example)j(\(3\))p 4323 551 V 1017 554 3310 4 v 4326
555 67 440 v 1083 621 3310 67 v Black 142 1018 a Fh(\017)p
Black 83 w Fi(Note)98 b(that)g(the)g(o)-7 b(rder)98 b(of)g(the)g
(clauses)h(in)g(X)-7 b(Query)98 b(\014ts)324 1317 y(b)7
b(etter)86 b(with)h(the)f(evaluation)h(sequence:)h(Also)e(in)h(SQL,)324
1617 y Fg(FROM)68 b Fi(is)d(conceptually)i(evaluated)f(\014rst,)e(and)i
Fg(SELECT)i Fi(last.)p Black 142 1991 a Fh(\017)p Black
83 w Fi(In)83 b(X)-7 b(Query)-21 b(,)83 b(all)g(k)-7
b(eyw)g(o)g(rds)83 b(a)-7 b(re)83 b(written)f(in)h(lo)-7
b(w)g(er)83 b(case.)p Black Black 608 2285 a Fo(In)52
b(contrast,)g(SQL)f(is)i(case-insensitive.)e(Ho)-5 b(w)g(ever,)51
b(since)g(case)g(is)h(imp)5 b(o)-5 b(rtant)608 2464 y(in)49
b(XML,)f(the)h(choice)f(fo)-5 b(r)49 b(X)-5 b(Query)49
b(seems)f(natural.)i(As)f(XP)-5 b(ath,)50 b(X)-5 b(Query)48
b(has)608 2644 y(no)57 b(reserved)g(w)-5 b(o)g(rds.)58
b(It)f(is)h(p)5 b(ossible)57 b(to)h(name)f(an)h(element)e
Ff(for)p Fo(.)p Black 142 3030 a Fh(\017)p Black 83 w
Fi(XP)-7 b(ath)127 b(2.0)h(is)h(a)f(subset)g(of)g(X)-7
b(Query)-21 b(,)128 b(i.e.)h(FL)-28 b(W)-7 b(OR-)324
3330 y(exp)g(ressions)83 b(a)-7 b(re)83 b(not)f(the)h(only)f(t)-7
b(yp)7 b(e)83 b(of)f(queries.)p Black Black 608 3624
a Fo(The)75 b Ff(for)p Fo(-lo)5 b(op)76 b(in)f(XP)-5
b(ath)76 b(is)f(a)g(simpli\014ed)h(version)e(\(sp)5 b(ecial)75
b(case\))f(of)h(the)608 3803 y(FL)-19 b(W)-5 b(OR-exp)g(ression)57
b(in)h(X)-5 b(Query)-14 b(.)p Black -283 4114 5977 9
v -283 4260 a(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 20 19 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-20)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1017 52 3310 4 v 1017 551 4 500 v 1103 397 a Fj(First)142
b(Example)j(\(4\))p 4323 551 V 1017 554 3310 4 v 4326
555 67 440 v 1083 621 3310 67 v Black 142 1018 a Fh(\017)p
Black 83 w Fi(Exp)-7 b(ressions)124 b(can)f(b)7 b(e)123
b(a)-7 b(rbitra)g(rily)122 b(nested,)h(also)g(inside)324
1298 y(explicitly)74 b(given)e(XML)i(\(direct)e(element)h(constructo)-7
b(rs\).)p Black 142 1654 a Fh(\017)p Black 83 w Fg(<)60
b Fi(sta)-7 b(rts)58 b(literal)g(XML)i(mo)7 b(de,)59
b(and)g Fg({...})i Fi(ma)-7 b(rks)59 b(sections)324 1934
y(that)82 b(must)g(b)7 b(e)83 b(evaluated:)p Black Black
326 2310 a Fg({)92 b(for)106 b(...)h(where)g(...)f(return)i
(...)90 b(})p Black 142 2667 a Fh(\017)p Black
83 w Fi(Result:)p Black Black 362 2970 a Fg()572
3207 y(Smith)q(LAS)q(T>)q(1)q(0<)q(/PO)q(INT)
q(S>)q()572 3444 y(Jones)q(LAS)q(T>)q(9)q()q(POI)q(NTS)q(><)q(/h1)q(>)572 3680 y(Turner<)q
(/LA)q(ST)q(>)q(5<)q(/PO)q(INT)q(S>)q()362
3917 y(
)p Black -283 4114 5977 9 v -283 4260
a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725
b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p Black
eop end
PStoPSsaved restore
%%Page: (20,21,22,23) 6
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 21 20 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-21)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1017 52 3310 4 v 1017 551 4 500 v 1103 397 a Fj(First)142
b(Example)j(\(5\))p 4323 551 V 1017 554 3310 4 v 4326
555 67 440 v 1083 621 3310 67 v Black 142 971 a Fh(\017)p
Black 83 w Fi(Of)76 b(course,)f(the)g(value)h(of)f(an)g(X)-7
b(Query)76 b(exp)-7 b(ression)75 b(is)h(an)324 1245 y(XDM)84
b(sequence.)p Black 142 1594 a Fh(\017)p Black 83 w Fi(Ho)-7
b(w)104 b(this)f(is)h(p)-7 b(rinted)103 b(\(\\serialized"\))i(dep)7
b(ends)103 b(on)h(the)324 1869 y(implementation)55 b(\(most)g(have)g
(options)g(to)g(control)f(this\).)p Black 142 2218 a
Fh(\017)p Black 83 w Fi(E.g.,)95 b(it)g(could)g(b)7 b(e)95
b(written)f(into)h(one)g(long)g(line,)g(o)-7 b(r)95 b(in-)324
2492 y(dented)83 b(with)f(one)h(element)g(p)7 b(er)82
b(line:)p Black Black 1415 2776 a Fg()1837 2996
y()2258 3158 y(Smith)2258 3378 y(10)1837 3598 y(
)1837 3768 y(...)1415 3988 y()p
Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)
g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 22 21 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-22)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1777 154 1789 4 v 1777 558 4 405 v 1864 475 a Fj(Overview)p
3563 558 V 1777 561 1789 4 v 3566 561 67 345 v 1844 628
1789 67 v Black Black 690 1343 a Fi(1.)83 b(Intro)7 b(duction)690
1887 y(2.)83 b(Basic)f(Syntax,)h(Constructo)-7 b
0 setlinecap
(rs)2705
1832 y
save /setgray { pop } def
2705 1832 a @beginspecial @setspecial
0.99626401 0.99626401 scale 0.79999 setlinewidth 261.2973 0 moveto
261.2973 9.86255 lineto 0 11.04584 -8.95416 20 -20 20 rcurveto 0 29.86255
lineto -241.2973 29.86255 lineto -11.04584 0 -20 -8.95416 -20 -20 rcurveto
-261.2973 0 lineto -261.2973 -9.86255 lineto 0 -11.04584 8.95416 -20
20 -20 rcurveto 0 -29.86255 lineto 241.2973 -29.86255 lineto 11.04584
0 20 8.95416 20 20 rcurveto 261.2973 0 lineto stroke
@endspecial
2705 1832 a
restore
2705 1832 a 690 2445 a Fi(3.)83 b(FLO)-7
b(WR-Exp)g(ressions)690 3002 y(4.)83 b(Examples,)g(Compa)-7
b(rison)83 b(with)f(SQL)690 3560 y(5.)h(Prolog,)f(F)-7
b(unctions)p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 23 22 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-23)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
950 52 3443 4 v 950 551 4 500 v 1036 397 a Fj(Overall)144
b(Syntax)g(\(1\))p 4390 551 V 950 554 3443 4 v 4393 555
67 440 v 1017 621 3443 67 v Black 142 1065 a Fh(\017)p
Black 83 w Fi(The)83 b(basic)g(X)-7 b(Query)83 b(unit)f(is)h(a)f(mo)7
b(dule.)p Black 142 1429 a Fh(\017)p Black 83 w Fi(A)83
b(mo)7 b(dule)82 b(can)h(b)7 b(e)p Black 359 1743 a Fh(\005)p
Black 128 w Fi(a)111 b(lib)-7 b(ra)g(ry)111 b(mo)7 b(dule)110
b(\(contains)i(mainly)f(function)f(de-)592 2031 y(cla)-7
b(rations\),)p Black 359 2345 a Fh(\005)p Black 128 w
Fi(a)83 b(main)f(mo)7 b(dule)83 b(\(contains)g(mainly)g(the)f(query\).)
p Black 142 2709 a Fh(\017)p Black 83 w Fi(Each)111 b(mo)7
b(dule)111 b(ma)-7 b(y)110 b(optionally)h(sta)-7 b(rt)109
b(with)i(a)g(version)324 2998 y(decla)-7 b(ration:)p
Black Black 1784 3289 a Fg(xquery)108 b(version)g("1.0";)p
Black Black 608 3614 a Fo(One)91 b(can)h(also)g(sp)5
b(ecify)90 b(the)h(enco)5 b(ding,)91 b(but)h(the)g(treatment)g(of)f
(this)h(is)608 3792 y(implementation-dep)5 b(endent:)57
b Ff(xquery)74 b(version)h("1.0")f(encoding)g("utf-8";)p
Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)
g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 24 23 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-24)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
950 52 3443 4 v 950 551 4 500 v 1036 397 a Fj(Overall)144
b(Syntax)g(\(2\))p 4390 551 V 950 554 3443 4 v 4393 555
67 440 v 1017 621 3443 67 v Black 142 1079 a Fh(\017)p
Black 83 w Fi(A)82 b(main)h(mo)7 b(dule)82 b(consists)h(of)f(a)g(p)-7
b(rolog)83 b(\(which)g(can)g(b)7 b(e)324 1364 y(empt)-7
b(y\))83 b(and)g(the)f(query)h(\(\\QueryBo)7 b(dy"\).)p
Black 142 1723 a Fh(\017)p Black 83 w Fi(A)96 b(lib)-7
b(ra)g(ry)96 b(mo)7 b(dule)96 b(consists)g(of)g(a)h(mo)7
b(dule)96 b(decla)-7 b(ration)324 2008 y(and)83 b(a)g(p)-7
b(rolog.)p Black 142 2367 a Fh(\017)p Black 83 w Fi(The)83
b(p)-7 b(rolog)82 b(can)h(contain)p Black 359 2677 a
Fh(\005)p Black 128 w Fi(First)g(an)g(a)-7 b(rbitra)g(ry)83
b(sequence)h(of)f(namespace)h(decla-)592 2962 y(ractions,)59
b(mo)7 b(dule)59 b(imp)7 b(o)-7 b(rt)59 b(commands)g(\(fo)-7
b(r)59 b(schemas)592 3246 y(and)83 b(mo)7 b(dules\),)82
b(and)h(X)-7 b(Query)83 b(pa)-7 b(rameter)82 b(settings,)p
Black 359 3556 a Fh(\005)p Black 128 w Fi(and)72 b(then)g(an)h(a)-7
b(rbitra)g(ry)71 b(sequence)i(of)f(va)-7 b(riable,)73
b(func-)592 3841 y(tion,)82 b(and)h(option)f(decla)-7
b(rations.)p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
%%Page: (24,25,26,27) 7
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 25 24 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-25)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
950 52 3443 4 v 950 551 4 500 v 1036 397 a Fj(Overall)144
b(Syntax)g(\(3\))p 4390 551 V 950 554 3443 4 v 4393 555
67 440 v 1017 621 3443 67 v Black 142 1079 a Fh(\017)p
Black 83 w Fi(The)83 b(query)f(itself)h(\(\\QueryBo)7
b(dy"\))83 b(is)g(an)f(exp)-7 b(ression.)p Black 142
1429 a Fh(\017)p Black 83 w Fi(XP)g(ath-exp)g(ressions)82
b(a)-7 b(re)83 b(also)f(X)-7 b(Query-exp)g(ressions.)p
Black Black 608 1685 a Fo(Ho)i(w)g(ever,)79 b(the)h(gramma)-5
b(r)81 b(in)g(the)e(X)-5 b(Query)80 b(standa)-5 b(rd)82
b(completely)d(de\014nes)608 1860 y(exp)-5 b(ressions.)58
b(Basically)-14 b(,)58 b(XP)-5 b(ath)59 b(is)g(a)f(restricted)h
(version)f(of)g(X)-5 b(Query)-14 b(.)58 b(Since)608 2035
y(X)-5 b(Query)59 b(has)h(extensions)f(in)i(many)e(places,)g(it)i(w)-5
b(as)60 b(not)g(p)5 b(ossible)60 b(to)g(simply)608 2209
y(emb)5 b(edd)56 b(an)i(XP)-5 b(ath)58 b(exp)-5 b(ression)57
b(as)h(de\014ned)e(in)i(the)f(XP)-5 b(ath)59 b(standa)-5
b(rd.)p Black 142 2572 a Fh(\017)p Black 83 w Fi(As)65
b(in)f(XP)-7 b(ath,)64 b(all)h(data)f(values)h(a)-7 b(re)65
b(sequences)g(of)f(items,)324 2848 y(where)83 b(items)g(a)-7
b(re)82 b(atomic)h(values)g(o)-7 b(r)82 b(no)7 b(des.)p
Black 142 3198 a Fh(\017)p Black 83 w Fi(Exp)-7 b(ressions)83
b(can)g(b)7 b(e)83 b(a)-7 b(rbitra)g(rily)82 b(nested.)p
Black Black 608 3454 a Fo(While)52 b(only)h(recent)f(SQL)g(DBMS)g(supp)
5 b(o)-5 b(rt)53 b(the)g(use)f(of)g(an)h(SQL)f(query)g(with)608
3629 y(one)67 b(result)h(value)f(as)g(a)h(term,)f(the)h(a)-5
b(rbitra)g(ry)69 b(nesting)f(w)-5 b(as)67 b(a)h(basic)g(design)608
3803 y(p)-5 b(rinciple)58 b(in)g(X)-5 b(Query)-14 b(.)56
b(It)i(is)f(sometimes)g(called)g(a)h(funtional)g(language.)p
Black -283 4114 5977 9 v -283 4260 a(Stefan)e(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 26 25 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-26)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1236 52 2872 4 v 1236 551 4 500 v 1322 397 a Fj(Exp)-12
b(ressions)145 b(\(1\))p 4104 551 V 1236 554 2872 4 v
4107 555 67 440 v 1302 621 2872 67 v Black 142 1042 a
Fh(\017)p Black 83 w Fi(On)129 b(the)g(top)f(level,)h(an)g(exp)-7
b(ression)129 b(consists)g(of)g(one)324 1329 y(o)-7 b(r)122
b(mo)-7 b(re)122 b(sub)7 b(exp)-7 b(ressions)122 b(\(\\Exp)-7
b(rSingle"\))123 b(sepa)-7 b(rated)324 1616 y(b)g(y)83
b(\\)p Fg(,)p Fi(")g(\(sequence)h(concatenation)e(op)7
b(erato)-7 b(r\).)p Black 142 1978 a Fh(\017)p Black
83 w Fi(On)83 b(the)g(next)f(level,)h(an)g(exp)-7 b(ression)83
b(\(\\Exp)-7 b(rSingle"\))84 b(is)p Black 359 2290 a
Fh(\005)p Black 128 w Fi(a)f(FL)-28 b(W)-7 b(OR-exp)g(ression,)p
Black 359 2603 a Fh(\005)p Black 128 w Fi(a)83 b(quanti\014ed)f(exp)-7
b(ression)83 b(\()p Fg(some)p Fi(,)h Fg(every)p Fi(\))p
Black 359 2915 a Fh(\005)p Black 128 w Fi(a)f(t)-7 b(yp)7
b(eswitch)82 b(exp)-7 b(ression)83 b(\(see)h(b)7 b(elo)-7
b(w\))p Black 359 3227 a Fh(\005)p Black 128 w Fi(an)83
b Fg(if)p Fi(-exp)-7 b(ression,)p Black 359 3539 a Fh(\005)p
Black 128 w Fi(o)g(r)76 b(an)h(exp)-7 b(ression)77 b(with)g(the)f
(usual)h(logical,)g(compa)-7 b(ri-)592 3827 y(son)83
b(and)f(a)-7 b(rithmetic)82 b(op)7 b(erato)-7 b(rs)82
b(\(see)h(b)7 b(elo)-7 b(w\).)p Black -283 4114 5977
9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 27 26 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-27)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1236 52 2872 4 v 1236 551 4 500 v 1322 397 a Fj(Exp)-12
b(ressions)145 b(\(2\))p 4104 551 V 1236 554 2872 4 v
4107 555 67 440 v 1302 621 2872 67 v Black 142 1112 a
Fh(\017)p Black 83 w Fi(In)83 b(compa)-7 b(rison,)82
b(the)h Fg(XPath)107 b(2.0)84 b Fi(gramma)-7 b(r)82 b(has)p
Black 359 1423 a Fh(\005)p Black 128 w Fi(a)77 b Fg(for)p
Fi(-exp)-7 b(ression)78 b(instead)f(of)g(the)g Fg(FLWOR)p
Fi(-exp)-7 b(ression,)p Black 359 1733 a Fh(\005)p Black
128 w Fi(no)82 b Fg(typeswitch)87 b Fi(exp)-7 b(ression.)p
Black 142 2092 a Fh(\017)p Black 83 w Fi(Note)60 b(that)f(the)h
Fg(for)p Fi(-exp)-7 b(ressions)62 b(in)e(XP)-7 b(ath)59
b(2.0)h(a)-7 b(re)60 b(valid)324 2378 y(FL)-28 b(W)-7
b(OR-exp)g(ressions)84 b(in)f(X)-7 b(Query:)p Black 359
2688 a Fh(\005)p Black 128 w Fi(They)83 b(have)g(only)g(the)f
Fg(for)i Fi(and)e(the)h Fg(return)h Fi(pa)-7 b(rt.)p
Black Black 875 2946 a Fo(It)58 b(is)g(legal)f(in)h(X)-5
b(Query)57 b(to)h(leave)e(out)i(the)f(other)h(pa)-5 b(rts.)p
Black 359 3256 a Fh(\005)p Black 128 w Fi(The)90 b Fg(for)p
Fi(-clause)h(is)f(simpli\014ed:)h(X)-7 b(Query)90 b(p)7
b(ermits)89 b(to)592 3542 y(decla)-7 b(re)78 b(a)h(t)-7
b(yp)7 b(e)78 b(fo)-7 b(r)77 b(the)h(va)-7 b(riable,)78
b(and)g(to)g(add)g(a)g(p)7 b(o-)592 3827 y(sitional)82
b(va)-7 b(riable)84 b(\(see)f(b)7 b(elo)-7 b(w\).)p Black
-283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 28 27 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-28)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1236 174 2872 4 v 1236 674 4 500 v 1322 519 a Fj(Exp)-12
b(ressions)145 b(\(3\))p 4104 674 V 1236 677 2872 4 v
4107 677 67 440 v 1302 743 2872 67 v Black 142 1235 a
Fh(\017)p Black 83 w Fi(The)79 b(gramma)-7 b(rs)79 b(fo)-7
b(r)78 b(X)-7 b(Query)80 b(and)f(XP)-7 b(ath)78 b(2.0)h(a)-7
b(re)79 b(very)324 1550 y(simila)-7 b(r)113 b(\(they)h(a)-7
b(re)113 b(generated)f(from)g(a)i(single)f(source,)324
1866 y(only)91 b(some)f(p)7 b(ossibilities)90 b(a)-7
b(re)90 b(missing)g(in)g(XP)-7 b(ath)89 b(o)-7 b(r)90
b(re-)324 2181 y(placed)83 b(b)-7 b(y)83 b(simpler)g(mechanisms\).)p
Black 142 2571 a Fh(\017)p Black 83 w Fi(Continuing)g(the)f(compa)-7
b(rison,)82 b(one)h(\014nds)g(that)p Black 359 2912 a
Fh(\005)p Black 128 w Fi(Quanti\014ed)69 b(exp)-7 b(ressions)70
b(\()p Fg(some)p Fi(,)h Fg(every)p Fi(\))h(p)7 b(ermit)69
b(a)g(t)-7 b(y-)592 3227 y(p)7 b(e)83 b(decla)-7 b(ration)82
b(fo)-7 b(r)82 b(the)h(va)-7 b(riable)83 b(in)f(X)-7
b(Query)-21 b(.)p Black Black 875 3534 a Fo(In)73 b(XP)-5
b(ath,)74 b(no)f(such)g(t)-5 b(yp)5 b(e)72 b(decla)-5
b(ration)74 b(is)f(p)5 b(ossible.)73 b(In)g(X)-5 b(Query)-14
b(,)72 b(it)h(is)875 3717 y(optional)59 b(\(thus,)f(XP)-5
b(ath)58 b(is)f(still)i(a)e(subset)h(of)f(X)-5 b(Query\).)p
Black -283 4114 5977 9 v -283 4260 a(Stefan)56 b(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
%%Page: (28,29,30,31) 8
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 29 28 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-29)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1236 52 2872 4 v 1236 551 4 500 v 1322 397 a Fj(Exp)-12
b(ressions)145 b(\(4\))p 4104 551 V 1236 554 2872 4 v
4107 555 67 440 v 1302 621 2872 67 v Black 142 1126 a
Fh(\017)p Black 83 w Fi(The)93 b(\\valueExp)-7 b(ression")94
b(\(Argument)e(of)h(una)-7 b(ry)93 b Fg(+)h Fi(and)324
1407 y Fg(-)p Fi(,)112 b(i.e.)g(at)f(the)h(end)f(of)h(the)f(op)7
b(erato)-7 b(r)111 b(hiera)-7 b(rchy\))112 b(is)g(a)324
1689 y(path)72 b(exp)-7 b(ression)72 b(in)g(XP)-7 b(ath.)71
b(In)i(X)-7 b(Query)-21 b(,)72 b(there)g(a)-7 b(re)72
b(t)-7 b(w)g(o)324 1970 y(additional)83 b(p)7 b(ossibilities:)p
Black 359 2276 a Fh(\005)p Black 128 w Fg(validate)108
b Fi(\()p Fg(strict)p Fh(j)p Fg(lax)p Fi(\))h Fg({)d
Fh(h)p Fg(Expression)t Fh(i)f Fg(})p Black Black 875
2528 a Fo(The)43 b(exp)-5 b(ression)43 b(must)g(evaluate)g(to)g
(exactly)e(one)i(do)5 b(cument)42 b(o)-5 b(r)44 b(element)875
2704 y(no)5 b(de.)63 b(It)h(is)g(treated)g(as)g(an)g(XML)f(infoset)h
(\(i.e.)f(existing)g(t)-5 b(yp)5 b(e)63 b(annota-)875
2880 y(tions)70 b(a)-5 b(re)70 b(igno)-5 b(red\),)69
b(validated)h(acco)-5 b(rding)69 b(to)h(the)e(\\in-scop)5
b(e)69 b(schema)875 3055 y(de\014nitions",)56 b(and)g(a)f(new)g(tree)f
(is)i(built)g(from)f(the)g(PSVI.)g(Ho)-5 b(w)g(ever,)54
b(the)875 3231 y(\\Schema)j(Imp)5 b(o)-5 b(rt)58 b(F)-5
b(eature")58 b(is)g(optional)g(in)g(X)-5 b(Query)-14
b(.)p Black 359 3537 a Fh(\005)p Black 128 w Fi(An)82
b(\\extension)h(exp)-7 b(ression")83 b(with)g(a)f(p)-7
b(ragma:)592 3818 y Fg(\(#)106 b(...#\))h({)f Fh(h)p
Fg(Expression)t Fh(i)f Fg(})p Black -283 4114 5977 9
v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 30 29 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-30)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1236 52 2872 4 v 1236 551 4 500 v 1322 397 a Fj(Exp)-12
b(ressions)145 b(\(5\))p 4104 551 V 1236 554 2872 4 v
4107 555 67 440 v 1302 621 2872 67 v Black 142 1112 a
Fh(\017)p Black 83 w Fi(As)110 b(explained)h(ab)7 b(ove,)110
b(the)f(XP)-7 b(ath)109 b(gramma)-7 b(r)110 b(p)7 b(ermits)324
1412 y(the)62 b Fg(namespace)k Fi(axis,)c(with)g(is)g(not)g(supp)7
b(o)-7 b(rted)61 b(in)h(X)-7 b(Query)-21 b(.)p Black
Black 608 1706 a Fo(But)43 b(b)5 b(ecause)43 b(it)g(can)h(b)5
b(e)42 b(supp)5 b(o)-5 b(rted)44 b(only)g(in)f(an)h(ine\016cient)e(w)-5
b(a)g(y)-14 b(,)43 b(it)h(is)g(anyw)-5 b(a)g(y)608 1885
y(no)57 b(longer)h(recommended)e(to)i(use)f(it.)p Black
142 2272 a Fh(\017)p Black 83 w Fi(The)69 b(next)g(di\013erence)g(is)g
(in)g(the)g(\\Prima)-7 b(ry)68 b(Exp)-7 b(ression":)p
Black 359 2596 a Fh(\005)p Black 128 w Fi(Both)97 b(languages)h(p)7
b(ermit)97 b(numeric)g(and)h(string)f(lite-)592 2895
y(rals,)64 b(va)-7 b(riable)64 b(references,)g(exp)-7
b(ressions)65 b(in)f Fg(\(...\))p Fi(,)i(the)592 3195
y(context)82 b(item)g(\\)p Fg(.)p Fi(",)h(and)g(function)f(calls.)p
Black 359 3519 a Fh(\005)p Black 128 w Fi(X)-7 b(Query)61
b(p)7 b(ermits)61 b(in)g(addition)f(constructo)-7 b(rs)60
b(\(see)i(b)7 b(e-)592 3818 y(lo)-7 b(w\),)83 b(and)g(\\)p
Fg(ordered)p Fh(j)p Fg(unordered)111 b({)105 b Fh(h)p
Fg(Expression)t Fh(i)g Fg(})p Fi(".)p Black -283 4114
5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 31 30 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-31)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
299 52 4745 4 v 299 551 4 500 v 386 397 a Fj(Op)12 b(erato)-12
b(r)143 b(Precedences)i(\(1\))p 5041 551 V 299 554 4745
4 v 5044 555 67 440 v 366 621 4745 67 v Black Black 2
921 5405 5 v 0 1208 5 288 v 86 1138 a Fi(Prio)p 583 1208
V 165 w(Op)7 b(erato)-7 b(r)p 4576 1208 V 3071 w(Asso)7
b(c.)p 5402 1208 V 2 1213 5405 5 v 2 1238 V 0 1505 5
267 v 379 1434 a(1)p 583 1505 V 166 w Fg(,)83 b Fi(\(comma\))p
4576 1505 V 2876 w(left)p 5402 1505 V 0 1742 5 237 v
379 1671 a(2)p 583 1742 V 166 w Fg(:=)g Fi(\(assignment\))p
4576 1742 V 2381 w(right)p 5402 1742 V 0 1978 V 379 1908
a(3)p 583 1978 V 166 w Fg(for)p Fi(,)h Fg(some)p Fi(,)f
Fg(every)p Fi(,)i Fg(typeswitch)p Fi(,)h Fg(if)p 4576
1978 V 859 w Fi(left)p 5402 1978 V 0 2215 V 379 2144
a(4)p 583 2215 V 166 w Fg(or)p 4576 2215 V 3783 w Fi(left)p
5402 2215 V 0 2451 V 379 2381 a(5)p 583 2451 V 166 w
Fg(and)p 4576 2451 V 3678 w Fi(left)p 5402 2451 V 0 2688
V 379 2617 a(6)p 583 2688 V 166 w Fg(eq)p Fi(,)p Fg(ne)p
Fi(,)p Fg(lt)p Fi(,)p Fg(le)p Fi(,)p Fg(gt)p Fi(,)p Fg(ge)p
Fi(,)p Fg(=)p Fi(,)p Fg(!=)p Fi(,)p Fg(<)p Fi(,)p Fg(<=)p
Fi(,)p Fg(>)p Fi(,)p Fg(>=)p Fi(,)p Fg(is)q Fi(,)p Fg(<<)p
Fi(,)p Fg(>)q(>)p 4576 2688 V 190 w Fi(left)p 5402 2688
V 0 2925 V 379 2854 a(7)p 583 2925 V 166 w Fg(to)p 4576
2925 V 3783 w Fi(left)p 5402 2925 V 0 3161 V 379 3091
a(8)p 583 3161 V 166 w Fg(+)p Fi(,)d Fg(-)p 4576 3161
V 3631 w Fi(left)p 5402 3161 V 0 3398 V 379 3327 a(9)p
583 3398 V 166 w Fg(*)p Fi(,)g Fg(div)p Fi(,)g Fg(idiv)p
Fi(,)h Fg(mod)p 4576 3398 V 2381 w Fi(left)p 5402 3398
V 0 3634 V 255 3564 a(10)p 583 3634 V 166 w Fg(union)p
Fi(,)g Fg(|)p 4576 3634 V 3210 w Fi(left)p 5402 3634
V 2 3639 5405 5 v -47 3864 a Fo(\(continued)57 b(on)h(next)e(slide\))p
Black -283 4114 5977 9 v -283 4260 a(Stefan)g(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 32 31 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-32)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
299 52 4745 4 v 299 551 4 500 v 386 397 a Fj(Op)12 b(erato)-12
b(r)143 b(Precedences)i(\(2\))p 5041 551 V 299 554 4745
4 v 5044 555 67 440 v 366 621 4745 67 v -47 987 a Fo(\(continued)57
b(from)g(p)-5 b(revious)58 b(slide\))p Black Black 2
1151 5405 5 v 0 1439 5 288 v 86 1368 a Fi(Prio)p 583
1439 V 165 w(Op)7 b(erato)-7 b(r)p 4576 1439 V 3071 w(Asso)7
b(c.)p 5402 1439 V 2 1444 5405 5 v 2 1469 V 0 1705 5
237 v 255 1635 a(11)p 583 1705 V 166 w Fg(intersect)p
Fi(,)86 b Fg(except)p 4576 1705 V 2263 w Fi(left)p 5402
1705 V 0 1942 V 255 1871 a(12)p 583 1942 V 166 w Fg(instance)108
b(of)p 4576 1942 V 2835 w Fi(left)p 5402 1942 V 0 2178
V 255 2108 a(13)p 583 2178 V 166 w Fg(treat)f(as)p 4576
2178 V 3151 w Fi(left)p 5402 2178 V 0 2415 V 255 2344
a(14)p 583 2415 V 166 w Fg(castable)p 4576 2415 V 3153
w Fi(left)p 5402 2415 V 0 2652 V 255 2581 a(15)p 583
2652 V 166 w Fg(cast)p 4576 2652 V 3573 w Fi(left)p 5402
2652 V 0 2888 V 255 2818 a(16)p 583 2888 V 166 w Fg(-)83
b Fi(\(una)-7 b(ry\),)83 b Fg(+)g Fi(\(una)-7 b(ry\))p
4576 2888 V 1979 w(right)p 5402 2888 V 0 3125 V 255 3054
a(17)p 583 3125 V 166 w Fg(?)p Fi(,)83 b Fg(*)p Fi(,)g
Fg(+)g Fi(\(Occurrence)g(Indicato)-7 b(rs\))p 4576 3125
V 883 w(left)p 5402 3125 V 0 3361 V 255 3291 a(18)p 583
3361 V 166 w Fg(/)p Fi(,)83 b Fg(//)p 4576 3361 V 3526
w Fi(left)p 5402 3361 V 0 3598 V 255 3527 a(19)p 583
3598 V 166 w Fg([)106 b(])p Fi(,)83 b Fg(\()105 b(\))p
Fi(,)83 b Fg({})p 4576 3598 V 2848 w Fi(left)p 5402 3598
V 2 3603 5405 5 v -47 3862 a Fo(Only)57 b(di\013erences)g
(\(additions\))h(to)g(XP)-5 b(ath:)110 b Ff(:=)p Fo(,)74
b Ff(typeswitch)p Fo(.)p Black -283 4114 5977 9 v -283
4260 a(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
%%Page: (32,33,34,35) 9
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 33 32 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-33)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
336 52 4671 4 v 336 556 4 504 v 422 397 a Fd(typeswitch)p
Fj(-Exp)-12 b(ression)145 b(\(1\))p 5004 556 V 336 559
4671 4 v 5007 559 67 445 v 403 626 4671 67 v Black 142
1042 a Fh(\017)p Black 83 w Fi(The)62 b Fg(typeswitch)p
Fi(-exp)-7 b(ression)66 b(p)7 b(ermits)61 b(to)h(check)h(the)f(dy-)324
1319 y(namic)74 b(t)-7 b(yp)7 b(e)73 b(of)g(an)g(exp)-7
b(ression,)73 b(and)h(to)e(distinguish)h(dif-)324 1596
y(ferent)82 b(cases)h(based)g(on)g(this)f(t)-7 b(yp)7
b(e:)p Black Black 326 1926 a Fg(typeswitch\($cust/ad)q(dre)q(ss\))536
2163 y(case)107 b($a)f(as)g(element\(*,USAddr\))217 b(return)108
b($a/state)536 2400 y(case)f($a)f(as)g(element\(*,CanAddr)q(\))111
b(return)d($a/prov)536 2636 y(case)423 b(element\(*,GermanA)q(ddr)q(\))
111 b(return)d(\(\))536 2873 y(default)g(return)g(fn:error\("Unknown)k
(address)107 b(type"\))p Black 142 3268 a Fh(\017)p Black
83 w Fg(element\(*,USAddr\))100 b Fi(matches)94 b(any)g(non-nilled)g
(element)324 3545 y(no)7 b(de)83 b(with)f(t)-7 b(yp)7
b(e)83 b(annotation)f Fg(USAddr)p Fi(.)p Black Black
608 3803 a Fo(Or)58 b(a)f(t)-5 b(yp)5 b(e)57 b(derived)g(from)g(that.)h
(This)g(example)f(needs)f(schema)h(validation.)p Black
-283 4114 5977 9 v -283 4260 a(Stefan)f(Brass:)i(XML)f(und)g(Datenbank)
-5 b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 34 33 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-34)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
336 52 4671 4 v 336 556 4 504 v 422 397 a Fd(typeswitch)p
Fj(-Exp)-12 b(ression)145 b(\(2\))p 5004 556 V 336 559
4671 4 v 5007 559 67 445 v 403 626 4671 67 v Black 142
1042 a Fh(\017)p Black 83 w Fi(The)71 b(\014rst)f Fg(case)p
Fi(-clause)i(with)f(a)f(matching)h(t)-7 b(yp)7 b(e)70
b(is)h(selec-)324 1325 y(ted,)83 b(o)-7 b(r)82 b(the)g(default)g
(clause)i(if)e(non)h(matches.)p Black 142 1683 a Fh(\017)p
Black 83 w Fi(A)h(va)-7 b(riable)85 b(must)e(b)7 b(e)84
b(decla)-7 b(red)85 b(in)f(the)g Fg(case)i Fi(only)e(if)g(the)324
1966 y(value)96 b(of)f(the)h(o)-7 b(riginal)95 b(exp)-7
b(ression)96 b(is)f(needed)h(to)f(com-)324 2249 y(pute)83
b(the)f Fg(return)j Fi(value.)p Black Black 608 2518
a Fo(The)76 b(scop)5 b(e)76 b(of)g(this)h(va)-5 b(riable)77
b(decla)-5 b(ration)77 b(is)g(this)g(single)f(case.)g(Di\013erent)608
2694 y(cases)57 b(can)g(decla)-5 b(re)57 b(va)-5 b(riables)58
b(with)g(the)f(same)g(name.)p Black 142 3064 a Fh(\017)p
Black 83 w Fi(The)92 b(same)h(e\013ect)f(can)g(b)7 b(e)93
b(achieved)g(with)f(conditional)324 3347 y(exp)-7 b(ressions)83
b(\()p Fg(if)p Fi(\))i(and)d(\\)p Fg(instance)109 b(of)p
Fi(".)p Black Black 608 3616 a Fo(\\)p Ff(treat)74 b(as)p
Fo(")61 b(is)g(necessa)-5 b(ry)59 b(in)i(addition)h(to)f(use)f(the)h
(value)f(as)h(a)g(value)f(of)g(its)608 3792 y(real)e(t)-5
b(yp)5 b(e.)56 b(So)h(in)h(the)f(end,)g(the)g Ff(typeswitch)i
Fo(simpli\014es)f(the)f(exp)-5 b(ression.)p Black -283
4114 5977 9 v -283 4260 a(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 35 34 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-35)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
530 76 4283 4 v 530 480 4 405 v 616 397 a Fj(Constructo)-12
b(rs:)144 b(Overview)p 4810 480 V 530 483 4283 4 v 4813
483 67 345 v 596 550 4283 67 v Black 142 1042 a Fh(\017)p
Black 83 w Fi(An)63 b(imp)7 b(o)-7 b(rtant)63 b(di\013erence)g(b)7
b(et)-7 b(w)g(een)64 b(XP)-7 b(ath)63 b(and)h(X)-7 b(Que-)324
1330 y(ry)86 b(is)g(that)f(X)-7 b(Query)87 b(can)f(generate)f(new)i(no)
7 b(des,)86 b(XP)-7 b(ath)324 1619 y(can)83 b(only)g(select)g(no)7
b(des)83 b(from)e(given)i(do)7 b(cuments.)p Black 142
1983 a Fh(\017)p Black 83 w Fi(Creating)83 b(new)g(no)7
b(des)82 b(is)h(done)g(b)-7 b(y)83 b(constructo)-7 b(rs.)p
Black 142 2346 a Fh(\017)p Black 83 w Fi(There)82 b(a)-7
b(re)83 b(t)-7 b(w)g(o)83 b(t)-7 b(yp)7 b(es)82 b(of)h(constructo)-7
b(rs)81 b(in)i(X)-7 b(Query:)p Black 359 2660 a Fh(\005)p
Black 128 w Fi(Direct)103 b(constructo)-7 b(rs,)103 b(which)h(lo)7
b(ok)103 b(lik)-7 b(e)104 b(XML)g(text.)592 2949 y(There)82
b(e.g.)h(the)f(no)7 b(de)83 b(name)f(is)h(explicitly)g(given.)p
Black 359 3263 a Fh(\005)p Black 128 w Fi(Computed)89
b(constructo)-7 b(rs,)88 b(which)i(have)g(a)g(new)g(syn-)592
3552 y(tax,)79 b(and)h(p)7 b(ermit)78 b(to)h(compute)h(e.g.)f(the)g(no)
7 b(de)80 b(name)592 3841 y(b)-7 b(y)83 b(an)g(exp)-7
b(ression.)p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 36 35 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-36)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
513 52 4317 4 v 513 551 4 500 v 600 397 a Fj(Direct)143
b(Constructo)-12 b(rs)143 b(\(1\))p 4826 551 V 513 554
4317 4 v 4830 555 67 440 v 580 621 4317 67 v Black 142
1065 a Fh(\017)p Black 83 w Fi(A)115 b(direct)g(constructo)-7
b(r)114 b(lo)7 b(oks)115 b(lik)-7 b(e)116 b(XML)g(text)e(that)h(is)324
1352 y(directly)94 b(copied)h(to)e(the)h(output,)f(but)g(one)h(can)h
(emb)7 b(ed)324 1638 y(X)-7 b(Query)83 b(exp)-7 b(ressions)83
b(to)g(b)7 b(e)82 b(evaluated)h(in)g Fg({...})p Fi(.)p
Black 142 1999 a Fh(\017)p Black 83 w Fi(F)-7 b(o)g(r)83
b(example,)g(the)f(X)-7 b(Query)83 b(exp)-7 b(ression)p
Black Black 1257 2357 a Fg(1+)q(1={)q(1+)q(1}<)
q(/a>)324 2696 y Fi(is)83 b(evaluated)g(to)f Fg(1+1=2<)q(/a>)q Fi(.)p Black 142 3057 a Fh(\017)p
Black 83 w Fi(Direct)75 b(constructo)-7 b(rs)74 b(a)-7
b(re)75 b(pa)-7 b(rsed)76 b(b)-7 b(y)75 b(X)-7 b(Query)-21
b(,)76 b(they)f(a)-7 b(re)324 3344 y(not)82 b(copied)h(cha)-7
b(racter)83 b(b)-7 b(y)83 b(cha)-7 b(racter)82 b(to)g(the)g(output.)p
Black Black 608 3617 a Fo(The)62 b(internal)i(XDM)e(rep)-5
b(resentation)64 b(of)e(the)g(output)i(is)e(constructed,)g(thus)608
3794 y(e.g.)44 b(info)-5 b(rmation)46 b(ab)5 b(out)45
b(extra)g(whitespace/line)f(b)-5 b(reaks)45 b(inside)g(tags)g(is)g
(lost.)p Black -283 4114 5977 9 v -283 4260 a(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
%%Page: (36,37,38,39) 10
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 37 36 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-37)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
513 52 4317 4 v 513 551 4 500 v 600 397 a Fj(Direct)143
b(Constructo)-12 b(rs)143 b(\(2\))p 4826 551 V 513 554
4317 4 v 4830 555 67 440 v 580 621 4317 67 v Black 142
1065 a Fh(\017)p Black 83 w Fi(If)103 b(one)g(needs)g(curly)f(b)-7
b(races)103 b(\\)p Fg({)p Fi(")g(o)-7 b(r)102 b(\\)p
Fg(})p Fi(")h(in)g(the)f(data,)324 1355 y(one)83 b(must)f(double)h
(them:)f(\\)p Fg({{)p Fi(")h(o)-7 b(r)83 b(\\)p Fg(}})p
Fi(".)p Black Black 608 1634 a Fo(Alternatively)-14 b(,)57
b(one)g(can)g(use)g(cha)-5 b(racter)58 b(references:)d
Ff({)j Fo(and)g Ff(})p Fo(.)p Black 142 2011
a Fh(\017)p Black 83 w Fi(Because)95 b(the)f(direct)g(constructo)-7
b(r)94 b(only)g(mimics)h(XML,)324 2300 y(but)k(is)g(de\014ned)h(in)f
(the)g(X)-7 b(Query)99 b(gramma)-7 b(r,)99 b(there)f(is)i(a)324
2590 y(slight)110 b(di\013erence:)g(When)f(one)h(encloses)g(an)g
(attribute)324 2880 y(value)99 b(inside)e Fg(")p Fi(,)h(one)g(can)g
(use)g Fg("")g Fi(to)f(denote)h(the)f(cha-)324 3170 y(racter)82
b Fg(")h Fi(inside)g(the)g(string.)p Black Black 608
3448 a Fo(Co)-5 b(rresp)5 b(ondingly)-14 b(,)73 b(when)f(one)g
(encloses)f(it)i(in)g Ff(')p Fo(,)g(the)f(ap)5 b(ostrophe)73
b(is)g(writ-)608 3626 y(ten)56 b Ff('')p Fo(.)g(This)h(is)f(the)g(X)-5
b(Query/XP)g(ath)56 b(convention,)f(not)i(the)e(XML)g(conven-)608
3803 y(tion.)48 b(There)g(one)g(must)g(use)g(an)g(entit)-5
b(y)48 b(reference)e(o)-5 b(r)49 b(a)f(cha)-5 b(racter)49
b(reference.)p Black -283 4114 5977 9 v -283 4260 a(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 38 37 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-38)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
513 52 4317 4 v 513 551 4 500 v 600 397 a Fj(Direct)143
b(Constructo)-12 b(rs)143 b(\(3\))p 4826 551 V 513 554
4317 4 v 4830 555 67 440 v 580 621 4317 67 v Black 142
1065 a Fh(\017)p Black 83 w Fi(F)-7 b(urthermo)g(re,)90
b(entit)-7 b(y)91 b(references)g(and)g(cha)-7 b(racter)91
b(refe-)324 1359 y(rences)83 b(a)-7 b(re)83 b(expanded,)g(not)f(copied)
h(to)f(the)g(output:)p Black 359 1677 a Fh(\005)p Black
128 w Fi(Only)105 b(the)f(p)-7 b(rede\014ned)104 b(entities)g(\()p
Fg(<)p Fi(,)i Fg(>)p Fi(,)g Fg(&)p Fi(,)592
1971 y Fg(")p Fi(,)82 b Fg(')p Fi(\))g(can)e(b)7
b(e)80 b(used)g(in)g(entit)-7 b(y)80 b(references.)p
Black Black 875 2243 a Fo(It)72 b(might)g(b)5 b(e)70
b(that)i(the)f(output)h(serialization)i(uses)c(these)h(entit)-5
b(y)71 b(refe-)875 2421 y(rences)d(again)i(if)e(the)h(cha)-5
b(racter)69 b(itself)f(w)-5 b(ould)69 b(b)5 b(e)68 b(invalid)i(\(e.g.)e
Ff(")875 2599 y Fo(inside)61 b(a)f Ff(")p Fo(-delimited)g
(attribute)h(value\).)f(But)g(if)g(it)g(is)g(not)g(necessa)-5
b(ry)59 b(to)875 2777 y(use)e(the)h(entit)-5 b(y)57 b(reference,)e(it)j
(will)g(b)5 b(e)57 b(p)-5 b(rinted)58 b(in)g(expanded)e(fo)-5
b(rm.)p Black 359 3096 a Fh(\005)p Black 128 w Fi(In)71
b(the)f(same)g(w)-7 b(a)g(y)-21 b(,)72 b(cha)-7 b(racter)70
b(references)g(a)-7 b(re)71 b(expan-)592 3389 y(ded)83
b(\(e.g.,)g Fg(a)h Fi(is)f(replaced)g(b)-7 b(y)83
b(\\)p Fg(a)p Fi("\).)p Black Black 875 3661 a Fo(Again,)f(the)e
(output)i(must)f(of)g(course)f(b)5 b(e)80 b(valid)i(XML,)e(which)g
(might)875 3839 y(require)58 b(some)f(fo)-5 b(rm)58 b(of)f(escaping)g
(\(entit)-5 b(y)57 b(/)h(cha)-5 b(racter)57 b(references\).)p
Black -283 4114 5977 9 v -283 4260 a(Stefan)f(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 39 38 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-39)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
513 124 4317 4 v 513 623 4 500 v 600 469 a Fj(Direct)143
b(Constructo)-12 b(rs)143 b(\(4\))p 4826 623 V 513 626
4317 4 v 4830 626 67 440 v 580 693 4317 67 v Black 142
1137 a Fh(\017)p Black 83 w Fi(X)-7 b(Query)69 b(comments)g
Fg(\(:)106 b(...)h(:\))69 b Fi(cannot)g(b)7 b(e)69 b(used)g(in)g(the)
324 1453 y(direct)86 b(element)g(constructo)-7 b(r,)85
b(neither)h(in)g(the)g(tags)g(no)-7 b(r)324 1768 y(in)83
b(the)f(content)g(\(except)i(of)e(course)h(inside)g Fg({...})p
Fi(\).)p Black Black 608 2088 a Fo(In)62 b(the)g(tags)h(they)f(a)-5
b(re)62 b(a)h(syntax)f(erro)-5 b(r,)63 b(in)g(the)f(content)f(they)h(a)
-5 b(re)63 b(conside-)608 2270 y(red)i(as)h(text)e(data.)i(F)-5
b(o)g(rmally)-14 b(,)67 b(comments)d(can)h(app)5 b(ea)-5
b(r)66 b(everywhere)d(where)608 2453 y(\\igno)-5 b(rable)53
b(whitespace")e(can)g(app)5 b(ea)-5 b(r.)52 b(A)g(few)e(p)-5
b(ro)5 b(ductions)53 b(in)f(the)f(X)-5 b(Query)608 2636
y(gramma)g(r)74 b(a)-5 b(re)74 b(ma)-5 b(rk)g(ed)74 b(with)f
Ff(/*)h(ws:explicit)h(*/)p Fo(.)e(Inside)g(these)g(p)-5
b(ro)5 b(ducti-)608 2818 y(ons,)69 b(the)f(nonterminal)i
Ff(S)f Fo(\(kno)-5 b(wn)69 b(fo)-5 b(rm)69 b(the)g(XML)f(gramma)-5
b(r\))70 b(is)f(used)f(to)608 3001 y(ma)-5 b(rk)40 b(explicitly)f
(where)f(whitespace)h(is)g(allo)-5 b(w)g(ed.)40 b(This)g(nonterminal)h
(do)5 b(es)38 b(not)608 3184 y(match)53 b(the)g(X)-5
b(Query)53 b(comment.)f(The)i(p)-5 b(ro)5 b(ductions)54
b(fo)-5 b(r)53 b(the)g(direct)h(element)608 3366 y(constructo)-5
b(r)64 b(have)g(this)g(explicit)f(whitespace.)g(In)h(this)h(w)-5
b(a)g(y)63 b(they)h(a)-5 b(re)64 b(made)608 3549 y(mo)-5
b(re)64 b(compatible)h(with)f(the)g(real)h(XML)e(gramma)-5
b(r,)66 b(although)f(I)f(p)5 b(ersonally)608 3731 y(do)57
b(not)h(see)f(the)g(advantage)g(of)h(fo)-5 b(rbidding)58
b(comments)f(inside)g(tags.)p Black -283 4114 5977 9
v -283 4260 a(Stefan)f(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 40 39 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-40)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
513 59 4317 4 v 513 558 4 500 v 600 404 a Fj(Direct)143
b(Constructo)-12 b(rs)143 b(\(5\))p 4826 558 V 513 561
4317 4 v 4830 561 67 440 v 580 628 4317 67 v Black 142
1072 a Fh(\017)p Black 83 w Fi(Allo)-7 b(w)g(ed)91 b(o)7
b(ccurrences)90 b(of)h(emb)7 b(edded)90 b(X)-7 b(Query)91
b(exp)-7 b(res-)324 1387 y(sions)83 b(\()p Fg({...})p
Fi(\))i(inside)e(direct)g(element)f(constructo)-7 b(rs:)p
Black 359 1728 a Fh(\005)p Black 128 w Fi(The)70 b(element)h(name)f
(\(element)h(t)-7 b(yp)7 b(e\))71 b(and)f(the)g(attri-)592
2043 y(bute)f(names)h(must)e(b)7 b(e)70 b(given)g(explicitly)g(\(a)g
(QName\),)592 2359 y(and)83 b(cannot)f(b)7 b(e)83 b(computed)f(with)g
Fg({...})p Fi(.)p Black Black 875 2666 a Fo(If)61 b(one)f(w)-5
b(ants)61 b(to)g(compute)f(these,)g(one)g(must)h(use)f(the)h(computed)f
(ele-)875 2849 y(ment)d(constructo)-5 b(r)59 b(\(see)d(b)5
b(elo)-5 b(w\).)p Black 359 3189 a Fh(\005)p Black 128
w Fi(Emb)7 b(edded)119 b(X)-7 b(Query)119 b(exp)-7 b(ressions)119
b(\()p Fg({...})p Fi(\))i(can)e(b)7 b(e)592 3505 y(used)75
b(only)h(inside)f(the)g(attribute)f(value)i(\(inside)g
Fg("...")592 3820 y Fi(o)-7 b(r)82 b Fg('...')p Fi(\))j(and)e(in)g(the)
f(element)g(content.)p Black -283 4114 5977 9 v -283
4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
%%Page: (40,41,42,43) 11
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 41 40 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-41)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
513 70 4317 4 v 513 569 4 500 v 600 415 a Fj(Direct)143
b(Constructo)-12 b(rs)143 b(\(6\))p 4826 569 V 513 572
4317 4 v 4830 573 67 440 v 580 639 4317 67 v Black 142
1083 a Fh(\017)p Black 83 w Fi(If)79 b Fg({...})h Fi(is)e(used)g(in)h
(an)f(attribute)f(value,)i(the)f(construc-)324 1399 y(ted)83
b(attribute)e(value)i(is)g(computed)f(as)h(follo)-7 b(ws:)p
Black 359 1739 a Fh(\005)p Black 128 w Fi(The)103 b(exp)-7
b(ressions)104 b(inside)f Fg({...})i Fi(a)-7 b(re)103
b(evaluated)h(and)592 2054 y(atomization)81 b(is)i(applied)g(to)f(the)h
(result.)p Black 359 2395 a Fh(\005)p Black 128 w Fi(Thus,)k(one)g
(gets)g(a)g(sequence)h(of)f(atomic)g(values)h(fo)-7 b(r)592
2710 y(each)92 b Fg({...})p Fi(.)i(These)e(values)h(a)-7
b(re)92 b(converted)f(\(with)i(a)592 3026 y(cast\))83
b(to)f(strings,)g(and)h(concatenated)g(with)f(a)h(single)592
3341 y(space)g(b)7 b(et)-7 b(w)g(een)83 b(each)g(pair.)p
Black Black 875 3648 a Fo(A)-5 b(t)41 b(the)f(b)5 b(eginning)41
b(and)g(the)f(end)h(of)f(the)g(sequence,)f(no)h(space)g(is)h(inserted,)
875 3831 y(thus)58 b(the)f(empt)-5 b(y)57 b(sequence)f(gives)h(the)g
(empt)-5 b(y)57 b(string.)p Black -283 4114 5977 9 v
-283 4260 a(Stefan)f(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 42 41 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-42)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
513 97 4317 4 v 513 596 4 500 v 600 442 a Fj(Direct)143
b(Constructo)-12 b(rs)143 b(\(7\))p 4826 596 V 513 599
4317 4 v 4830 599 67 440 v 580 666 4317 67 v Black 142
1110 a Fh(\017)p Black 83 w Fi(Computation)82 b(of)g(attribute)g
(value,)h(continued:)p Black 359 1450 a Fh(\005)p Black
128 w Fi(Then)131 b(the)g(explicitly)h(given)g(cha)-7
b(racters)180 b(and)h(the)592 1766 y(strings)117 b(resulting)g(from)g
(each)h Fg({...})h Fi(a)-7 b(re)118 b(concate-)592 2081
y(nated)82 b(without)g(adding)h(spaces.)p Black 359 2422
a Fh(\005)p Black 128 w Fi(Example:)p Black Black 1391
2784 a Fg()592
3126 y Fi(is)83 b(evaluated)g(to)f Fg()
p Fi(.)p Black 359 3466 a Fh(\005)p Black 128 w Fi(If)76
b(the)g(attribute)f(name)h(is)h Fg(xml:id)p Fi(,)h(the)e(attribute)f
(va-)592 3782 y(lue)83 b(is)g(treated)e(sp)7 b(ecially)84
b(\(as)f(an)g(ID\).)p Black -283 4114 5977 9 v -283 4260
a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725
b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p Black
eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 43 42 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-43)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
513 96 4317 4 v 513 595 4 500 v 600 441 a Fj(Direct)143
b(Constructo)-12 b(rs)143 b(\(8\))p 4826 595 V 513 598
4317 4 v 4830 599 67 440 v 580 665 4317 67 v Black 142
1109 a Fh(\017)p Black 83 w Fi(The)109 b(content)f(of)h(a)g(direct)g
(element)g(constructo)-7 b(r)107 b(can)324 1425 y(contain)83
b(\(b)7 b(et)-7 b(w)g(een)83 b(sta)-7 b(rt)82 b(tag)g(and)h(end)f
(tag\):)p Black 359 1765 a Fh(\005)p Black 128 w Fi(Literal)h(text)f
(\(without)g(the)g(cha)-7 b(racters)83 b Fg(<)p Fi(,)g
Fg({)p Fi(,)g Fg(})p Fi(,)f Fg(&)p Fi(\),)p Black 359
2106 a Fh(\005)p Black 128 w Fi(entit)-7 b(y)82 b(references)h(fo)-7
b(r)82 b(the)g(\014ve)h(p)-7 b(rede\014ned)83 b(entities,)p
Black 359 2446 a Fh(\005)p Black 128 w Fi(cha)-7 b(racter)82
b(references,)p Black 359 2786 a Fh(\005)p Black 128
w Fi(CD)-7 b(A)-21 b(T)g(A)83 b(sections:)g Fg()p
Fi(,)p Black 359 3127 a Fh(\005)p Black 128 w Fi(enclosed)g(exp)-7
b(ressions:)83 b Fg({...})p Fi(,)p Black 359 3467 a Fh(\005)p
Black 128 w Fi(other)56 b(direct)g(constructo)-7 b(rs)55
b(\(fo)-7 b(r)56 b(element,)h(comment,)592 3783 y(and)83
b(p)-7 b(ro)7 b(cessing)82 b(instruction)g(no)7 b(des\).)p
Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)
g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 44 43 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-44)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
513 52 4317 4 v 513 551 4 500 v 600 397 a Fj(Direct)143
b(Constructo)-12 b(rs)143 b(\(9\))p 4826 551 V 513 554
4317 4 v 4830 555 67 440 v 580 621 4317 67 v Black 142
1042 a Fh(\017)p Black 83 w Fi(Even)93 b(va)-7 b(riable)93
b(references)f(a)-7 b(re)92 b(not)g(interp)-7 b(reted)91
b(inside)324 1321 y(the)71 b(content)f(\(o)-7 b(r)71
b(attribute)e(value\))j(of)e(a)h(direct)g(element)324
1599 y(constructo)-7 b(r:)78 b(The)g(\\)p Fg($)p Fi("-sign)h(is)g
(treated)e(as)i(literal)f(text.)p Black 142 1953 a Fh(\017)p
Black 83 w Fi(F)-7 b(o)g(r)83 b(example)p Black Black
994 2280 a Fg(for)106 b($i)g(in)h(\(1,)f(2,)g(3\))g(return)i($i)
324 2611 y Fi(gives)p Black Black 2416 2800 a Fg($i)2416
3036 y($i)2416 3273 y($i)p Black 142 3573
a Fh(\017)p Black 83 w Fi(Inside)87 b(the)g(constructo)-7
b(r,)85 b(one)i(must)e(write)i Fg({$i})h Fi(to)e(get)324
3852 y(the)d(value)g(of)f(the)h(va)-7 b(riable)83 b Fg($i)p
Fi(.)p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
%%Page: (44,45,46,47) 12
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 45 44 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-45)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
406 52 4531 4 v 406 551 4 500 v 493 397 a Fj(Direct)143
b(Constructo)-12 b(rs)143 b(\(10\))p 4933 551 V 406 554
4531 4 v 4937 555 67 440 v 473 621 4531 67 v Black 142
1055 a Fh(\017)p Black 83 w Fi(A)90 b(sequence)g(of)g(whitespace)g(cha)
-7 b(racters)89 b(\(e.g.)h(spaces,)324 1341 y(line)84
b(b)-7 b(reaks\))83 b(within)g(the)g(content)f(of)h(a)g(direct)g
(element)324 1626 y(constructo)-7 b(r)72 b(is)h(considered)h(\\b)7
b(ounda)-7 b(ry)72 b(whitespace")i(if)324 1912 y(it)83
b(is)f(delimited)h(on)g(b)7 b(oth)82 b(sides)g(b)-7 b(y)p
Black 359 2222 a Fh(\005)p Black 128 w Fi(the)70 b(sta)-7
b(rt)69 b(o)-7 b(r)70 b(end)g(of)g(the)f(content)h(\(i.e.)g(the)g(sta)
-7 b(rt)69 b(tag)592 2507 y(o)-7 b(r)72 b(end)g(tag)f(of)h(the)g
(direct)f(element)h(constructo)-7 b(r\),)71 b(o)-7 b(r)p
Black 359 2818 a Fh(\005)p Black 128 w Fi(and)104 b(enclosed)h(direct)f
(constructo)-7 b(r)104 b(\(e.g.)g(sta)-7 b(rt)104 b(and)592
3103 y(end)83 b(tags)f(of)g(direct)h(element)f(constructo)-7
b(rs\),)82 b(o)-7 b(r)p Black 359 3413 a Fh(\005)p Black
128 w Fi(an)83 b(enclosed)g(exp)-7 b(ression)83 b Fg({...})p
Fi(.)p Black Black 875 3672 a Fo(Space)54 b(cha)-5 b(racters)55
b(generated)f(b)-5 b(y)54 b(cha)-5 b(racter)55 b(references,)e(CD)-5
b(A)-14 b(T)g(A)54 b(sec-)875 3849 y(tions,)k(o)-5 b(r)58
b(enclosed)f(exp)-5 b(ressions)57 b(do)g(not)h(count)f(as)h(whitespace)
f(here.)p Black -283 4114 5977 9 v -283 4260 a(Stefan)f(Brass:)i(XML)f
(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 46 45 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-46)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
406 52 4531 4 v 406 551 4 500 v 493 397 a Fj(Direct)143
b(Constructo)-12 b(rs)143 b(\(11\))p 4933 551 V 406 554
4531 4 v 4937 555 67 440 v 473 621 4531 67 v Black 142
1042 a Fh(\017)p Black 83 w Fi(Bounda)-7 b(ry)82 b(whitespace)h(is)p
Black 359 1350 a Fh(\005)p Black 128 w Fi(eliminated)97
b(if)g(the)g(b)7 b(ounda)-7 b(ry)97 b(whitespace)g(p)7
b(olicy)98 b(in)592 1633 y(the)82 b(static)g(context)h(is)f(\\)p
Fg(strip)p Fi(",)p Black 359 1941 a Fh(\005)p Black 128
w Fi(and)119 b(it)h(is)f(copied)h(to)f(content)g(of)g(the)g(construced)
592 2225 y(element)86 b(no)7 b(de)85 b(if)h(the)f(b)7
b(ounda)-7 b(ry)85 b(whitespace)h(p)7 b(olicy)592 2508
y(is)83 b(\\)p Fg(preserve)p Fi(".)p Black 142 2866 a
Fh(\017)p Black 83 w Fi(The)g(b)7 b(ounda)-7 b(ry)82
b(whitespace)h(p)7 b(olicy)83 b(can)g(b)7 b(e)83 b(set)f(with)h(a)324
3149 y(decla)-7 b(ration)83 b(in)g(the)f(p)-7 b(rolog:)p
Black Black 1205 3482 a Fg(declare)108 b(boundary-space)i(preserve;)p
Black 142 3841 a Fh(\017)p Black 83 w Fi(The)83 b(default)f(is)h
(implementation-de\014ned.)p Black -283 4114 5977 9 v
-283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 47 46 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-47)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
406 52 4531 4 v 406 551 4 500 v 493 397 a Fj(Direct)143
b(Constructo)-12 b(rs)143 b(\(12\))p 4933 551 V 406 554
4531 4 v 4937 555 67 440 v 473 621 4531 67 v Black 142
1018 a Fh(\017)p Black 83 w Fi(Exercise:)59 b(Ho)-7 b(w)60
b(do)7 b(es)58 b(this)h(X)-7 b(Query)58 b(exp)-7 b(ression)60
b(lo)7 b(ok)58 b(lik)-7 b(e)324 1293 y(without)82 b(the)h(b)7
b(ounda)-7 b(ry)82 b(whitespace?)p Black Black 572 1577
a Fg()994 1764 y()106 b(xy)g()994 2000 y()g({"xy"})i()
994 2237 y()e( )i()e()994
2473 y(\(:)g(Be)g(careful)i(here!)f(:\))572 2685 y()p
Black 142 2985 a Fh(\017)p Black 83 w Fi(The)119 b(example)h(sho)-7
b(ws)120 b(also)f(a)g(direct)g(comment)g(con-)324 3260
y(structo)-7 b(r.)p Black Black 608 3515 a Fo(One)54
b(cannot)h(use)g(enclosed)f(exp)-5 b(ressions)54 b Ff({...})i
Fo(in)f(a)g(direct)g(comment)f(con-)608 3690 y(structo)-5
b(r.)40 b(One)e(must)h(write)g(the)f(comment)g(explicitly)-14
b(.)38 b(But)h(there)g(is)g(of)f(course)608 3864 y(also)58
b(a)g(computed)e(comment)h(constructo)-5 b(r)58 b(\(see)e(b)5
b(elo)-5 b(w\).)p Black -283 4114 5977 9 v -283 4260
a(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725
b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p Black
eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 48 47 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-48)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
406 52 4531 4 v 406 551 4 500 v 493 397 a Fj(Direct)143
b(Constructo)-12 b(rs)143 b(\(13\))p 4933 551 V 406 554
4531 4 v 4937 555 67 440 v 473 621 4531 67 v Black 142
1065 a Fh(\017)p Black 83 w Fi(The)68 b(content)f(of)h(a)g(direct)g
(element)g(constructo)-7 b(r)66 b(is)j(eva-)324 1363
y(luated)83 b(to)f(a)h(sequence)g(of)f(no)7 b(des)83
b(as)g(follo)-7 b(ws:)p Black 359 1686 a Fh(\005)p Black
128 w Fi(Each)99 b(consecutive)g(sequence)g(of)g(literal)f(cha)-7
b(racters)592 1984 y(\(including)115 b(cha)-7 b(racters)115
b(from)e(entit)-7 b(y/cha)g(racter)114 b(re-)592 2282
y(ferences)123 b(and)h(CD)-7 b(A)-21 b(T)g(A)124 b(sections\))f
(evaluates)h(to)f(a)592 2581 y(single)83 b(text)f(no)7
b(de.)p Black 359 2904 a Fh(\005)p Black 128 w Fi(Each)89
b(nested)g(direct)g(constructo)-7 b(r)88 b(is)h(evaluated,)g(re-)592
3202 y(sulting)82 b(in)h(a)g(new)g(no)7 b(de.)p Black
Black 875 3481 a Fo(The)58 b(pa)-5 b(rent)58 b(p)-5 b(rop)5
b(ert)-5 b(y)57 b(of)g(this)h(new)f(no)5 b(de)57 b(is)g(set)g(to)h(the)
f(element)f(no)5 b(de)875 3660 y(that)78 b(is)f(currently)f(b)5
b(eing)77 b(constructed.)f(The)g(standa)-5 b(rd)78 b(also)g(explains)
875 3839 y(ho)-5 b(w)58 b(the)f Ff(base-uri)p Fo(-p)-5
b(rop)5 b(ert)-5 b(y)60 b(is)d(set)g(\(see)g(Section)f(3.7.1.3\).)p
Black -283 4114 5977 9 v -283 4260 a(Stefan)g(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
%%Page: (48,49,50,51) 13
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 49 48 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-49)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
406 52 4531 4 v 406 551 4 500 v 493 397 a Fj(Direct)143
b(Constructo)-12 b(rs)143 b(\(14\))p 4933 551 V 406 554
4531 4 v 4937 555 67 440 v 473 621 4531 67 v Black 142
1030 a Fh(\017)p Black 83 w Fi(Evaluation)66 b(of)g(content)g(of)g(a)g
(direct)f(element)i(construc-)324 1304 y(to)-7 b(r,)82
b(continued:)p Black 359 1604 a Fh(\005)p Black 128 w
Fi(Each)74 b(enclosed)h(exp)-7 b(ression)75 b Fg({...})h
Fi(is)e(evaluated)g(to)g(a)592 1879 y(sequence)83 b(of)g(items.)p
Black 359 2178 a Fh(\005)p Black 128 w Fi(F)-7 b(o)g(r)65
b(each)g(subsequence)h(of)f(adjacent)g(atomic)f(values,)592
2453 y(a)75 b(single)g(text)f(no)7 b(de)75 b(is)g(constructed,)e
(containing)i(the)592 2728 y(values)103 b(converted)g(to)f(strings)g
(with)g(a)h(single)g(space)592 3003 y(inserted)82 b(b)7
b(et)-7 b(w)g(een)83 b(each)g(pair.)p Black 359 3302
a Fh(\005)p Black 128 w Fi(F)-7 b(o)g(r)62 b(each)g(no)7
b(de)62 b(in)f(the)h(sequence)g(returned)f(b)-7 b(y)62
b Fg({...})p Fi(,)592 3577 y(a)88 b(new)g(cop)-7 b(y)89
b(is)f(made)g(of)g(this)f(no)7 b(de)88 b(and)g(the)g(entire)592
3852 y(subtree)82 b(b)7 b(elo)-7 b(w)83 b(it.)f(\(see)i(details)e(b)7
b(elo)-7 b(w\).)p Black -283 4114 5977 9 v -283 4260
a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725
b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p Black
eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 50 49 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-50)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
406 52 4531 4 v 406 551 4 500 v 493 397 a Fj(Direct)143
b(Constructo)-12 b(rs)143 b(\(15\))p 4933 551 V 406 554
4531 4 v 4937 555 67 440 v 473 621 4531 67 v Black 142
1018 a Fh(\017)p Black 83 w Fi(Eval.)83 b(of)g(content)f(of)g(direct)g
(element)h(constr.,)f(cont.:)p Black 359 1334 a Fh(\005)p
Black 128 w Fi(A)g(do)7 b(cument)82 b(no)7 b(de)83 b(is)g(replaced)g(b)
-7 b(y)83 b(its)f(children.)p Black 359 1651 a Fh(\005)p
Black 128 w Fi(No)-7 b(w)91 b(there)f(might)g(b)7 b(e)91
b(again)g(adjacent)g(text)f(no)7 b(des,)592 1942 y(which)83
b(a)-7 b(re)83 b(merged)f(into)g(a)h(single)g(text)f(no)7
b(de.)p Black 142 2308 a Fh(\017)p Black 83 w Fi(It)70
b(is)g(p)7 b(ermitted)69 b(that)f(the)i(resulting)f(sequence)i
(contains)324 2600 y(attribute)82 b(no)7 b(des,)82 b(but)g(only)h(at)f
(the)h(very)f(b)7 b(eginning.)p Black 142 2966 a Fh(\017)p
Black 83 w Fi(These)115 b(b)7 b(ecome)115 b(attributes)f(of)h(the)f
(constructed)h(ele-)324 3258 y(ment)79 b(no)7 b(des)80
b(\(in)f(addition)g(to)g(the)g(attributes)f(explicitly)324
3549 y(sp)7 b(eci\014ed)70 b(in)g(the)f(direct)g(element)h(constructo)
-7 b(r\),)68 b(the)h(re-)324 3841 y(maining)83 b(no)7
b(des)83 b(b)7 b(ecome)83 b(its)f(children.)p Black -283
4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 51 50 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-51)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
406 52 4531 4 v 406 551 4 500 v 493 397 a Fj(Direct)143
b(Constructo)-12 b(rs)143 b(\(16\))p 4933 551 V 406 554
4531 4 v 4937 555 67 440 v 473 621 4531 67 v Black 142
1018 a Fh(\017)p Black 83 w Fi(The)55 b(construction)g(and)g(cop)-7
b(ying)56 b(of)f(no)7 b(des)55 b(is)g(in\015uenced)324
1298 y(b)-7 b(y)83 b(the)g(construction)e(mo)7 b(de,)83
b(which)g(can)g(b)7 b(e:)p Black 359 1603 a Fh(\005)p
Black 128 w Fg(strip)p Fi(:)109 b(a)e(new)g(do)7 b(cument)107
b(is)g(constructed)f(without)592 1884 y(the)64 b(info)-7
b(rmation)64 b(generated)g(only)h(b)-7 b(y)65 b(the)g(validation.)p
Black Black 875 2135 a Fo(So)81 b(the)g(new)g(no)5 b(de)80
b(as)i(w)-5 b(ell)81 b(as)g(the)g(copied)g(element)f(no)5
b(des)80 b(receive)875 2310 y(the)d(t)-5 b(yp)5 b(e)77
b Ff(xs:untyped)p Fo(,)i(and)e(copied)g(attribute)i(no)5
b(des)76 b(a)-5 b(re)78 b(treated)f(as)875 2486 y Ff(xs:untypedAtomic)p
Fo(.)69 b(Prop)5 b(erties)66 b Ff(nilled)p Fo(,)h Ff(is-id)p
Fo(,)g(and)g Ff(is-idrefs)g Fo(a)-5 b(re)67 b(all)875
2661 y(set)f(to)g(false)f(\(except)f(fo)-5 b(r)66 b(attribute)h(no)5
b(des)66 b(called)f Ff(xml:id)p Fo(\).)i(All)f(t)-5 b(yp)5
b(ed)875 2837 y(values)57 b(sto)-5 b(red)58 b(in)g(the)f(o)-5
b(riginal)60 b(no)5 b(des)56 b(a)-5 b(re)58 b(converted)f(to)g
(strings.)p Black 359 3142 a Fh(\005)p Black 128 w Fg(preserve)p
Fi(:)82 b(info)-7 b(rmation)79 b(from)f(schema-validation)i(of)592
3422 y(the)i(o)-7 b(riginal)83 b(do)7 b(cument)82 b(is)h(p)-7
b(reserved.)p Black Black 875 3673 a Fo(The)84 b(new)f(no)5
b(de)83 b(gets)g(the)g(t)-5 b(yp)5 b(e)83 b Ff(xs:anyType)p
Fo(,)i(but)f(all)g(copied)f(no)5 b(des)875 3849 y(retain)59
b(their)e(o)-5 b(riginal)60 b(t)-5 b(yp)5 b(e.)56 b(Prop)5
b(erties)58 b(lik)-5 b(e)58 b Ff(nilled)g Fo(a)-5 b(re)58
b(copied.)p Black -283 4114 5977 9 v -283 4260 a(Stefan)e(Brass:)i(XML)
f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 52 51 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-52)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
406 52 4531 4 v 406 551 4 500 v 493 397 a Fj(Direct)143
b(Constructo)-12 b(rs)143 b(\(17\))p 4933 551 V 406 554
4531 4 v 4937 555 67 440 v 473 621 4531 67 v Black 142
994 a Fh(\017)p Black 83 w Fi(Another)90 b(pa)-7 b(rameter)90
b(is)g(the)h(cop)-7 b(y-namespaces)91 b(mo)7 b(de.)324
1284 y(It)83 b(contains)f(t)-7 b(w)g(o)83 b(comp)7 b(onents:)p
Black 359 1599 a Fh(\005)p Black 128 w Fg(preserve)72
b Fi(means)c(that)g(the)g(in-scop)7 b(e)69 b(namespaces)g(of)592
1889 y(the)82 b(o)-7 b(riginal)83 b(no)7 b(de)83 b(a)-7
b(re)82 b(copied)h(to)f(its)h(cop)-7 b(y)-21 b(.)p Black
Black 875 2155 a Ff(no-preserve)p Fo(:)82 b(only)d(namespaces)g(used)g
(in)g(the)h(element)e(name)h(o)-5 b(r)80 b(its)875 2333
y(attributes)54 b(\(i.e.)f(the)f(necessa)-5 b(ry)52 b(namespaces\))g(a)
-5 b(re)53 b(copied.)f(But)h(if)g(then)875 2510 y(the)60
b(t)-5 b(yp)5 b(ed)60 b(value)g(of)g(the)g(element)f(o)-5
b(r)61 b(one)e(of)h(its)h(attributes)g(is)g(of)e(t)-5
b(yp)5 b(e)875 2688 y Ff(QName)59 b Fo(o)-5 b(r)58 b
Ff(NOTATION)g Fo(\(\\namespace)f(sensitive"\),)g(an)g(erro)-5
b(r)59 b(o)5 b(ccurs.)p Black 359 3003 a Fh(\005)p Black
128 w Fg(inherit)116 b Fi(means)d(that)f(in-scop)7 b(e)113
b(namespaces)h(from)592 3293 y(the)g(constructed)f(no)7
b(de)113 b(a)-7 b(re)114 b(inherited)g(to)f(its)h(con-)592
3583 y(tents)82 b(\(the)h(copied)g(no)7 b(des\).)p Black
Black 875 3849 a Fo(P)-5 b(ossibly)58 b(overridden)g(b)-5
b(y)57 b(namespaces)f(copied)h(from)h(o)-5 b(riginal)59
b(no)5 b(de.)p Black -283 4114 5977 9 v -283 4260 a(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
%%Page: (52,53,54,55) 14
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 53 52 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-53)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
406 77 4531 4 v 406 576 4 500 v 493 422 a Fj(Direct)143
b(Constructo)-12 b(rs)143 b(\(18\))p 4933 576 V 406 579
4531 4 v 4937 580 67 440 v 473 646 4531 67 v Black 142
1090 a Fh(\017)p Black 83 w Fi(The)64 b(follo)-7 b(wing)65
b(example)f(sho)-7 b(ws)65 b(that)e(no)7 b(des)64 b(a)-7
b(re)64 b(indeed)324 1406 y(copied,)83 b(getting)f(a)h(new)g(identit)-7
b(y:)p Black Black 783 1713 a Fg(let)107 b($x)f(:=)g()783
1949 y(let)h($y)f(:=)g({$x})783 2186 y(let)h($z)f(:=)g($y/a)783
2423 y(return)i(if\($x)f(is)f($z\))h(then)f("yes")i(else)e("no")p
Black 142 2794 a Fh(\017)p Black 83 w Fg(let)67 b Fi(is)f(a)f(clause)h
(of)g(the)f(FL)-28 b(W)-7 b(OR-exp)g(ression)67 b(that)e(binds)324
3110 y(a)83 b(va)-7 b(riable)83 b(to)f(the)h(sequence)g(on)g(the)f
(right)g(hand)g(side.)p Black 142 3500 a Fh(\017)p Black
83 w Fi(The)c(result)g(is)h Fg("no")p Fi(:)h(Although)e
Fg($z)h Fi(is)g Fg()h Fi(constructed)324 3816 y(from)i
Fg($x)p Fi(,)h(it)g(has)f(a)h(new)g(identit)-7 b(y)-21
b(.)p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 54 53 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-54)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
148 52 5047 4 v 148 551 4 500 v 234 397 a Fj(Computed)144
b(Constructo)-12 b(rs)143 b(\(1\))p 5192 551 V 148 554
5047 4 v 5195 555 67 440 v 214 621 5047 67 v Black 142
1065 a Fh(\017)p Black 83 w Fi(A)68 b(computed)f(constructo)-7
b(r)66 b(sta)-7 b(rts)67 b(with)g(a)h(k)-7 b(eyw)g(o)g(rd)69
b(that)324 1355 y(indicates)83 b(the)f(t)-7 b(yp)7 b(e)83
b(of)f(no)7 b(de)83 b(to)f(b)7 b(e)83 b(constructed:)324
1646 y Fg(element)p Fi(,)147 b Fg(attribute)p Fi(,)g
Fg(text)p Fi(,)e Fg(processing-instruct)q(ion)q Fi(,)324
1936 y Fg(comment)p Fi(,)160 b Fg(document)p Fi(.)p Black
142 2301 a Fh(\017)p Black 83 w Fi(F)-7 b(o)g(r)110 b(no)7
b(de)109 b(t)-7 b(yp)7 b(es)109 b(with)h(a)f(name)h(\(element,)f
(attribute,)324 2591 y(PI\),)100 b(a)f(name)g(sp)7 b(eci\014cation)100
b(follo)-7 b(ws.)99 b(This)g(can)g(b)7 b(e)100 b(an)324
2881 y(explicitly)108 b(given)g(QName)h(o)-7 b(r)107
b(an)g(enclosed)h(exp)-7 b(ression)324 3172 y Fg({...})85
b Fi(\(\\name)e(exp)-7 b(ression)83 b(of)f(the)h(constructo)-7
b(r"\).)p Black 142 3537 a Fh(\017)p Black 83 w Fi(Next,)119
b(the)f(content)f(is)i(de\014ned)g(b)-7 b(y)118 b(an)h(exp)-7
b(ression)119 b(in)324 3827 y Fg({...})85 b Fi(\(\\content)d(exp)-7
b(ression"\).)p Black -283 4114 5977 9 v -283 4260 a
Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725
b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p Black
eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 55 54 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-55)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
148 58 5047 4 v 148 558 4 500 v 234 403 a Fj(Computed)144
b(Constructo)-12 b(rs)143 b(\(2\))p 5192 558 V 148 561
5047 4 v 5195 561 67 440 v 214 627 5047 67 v Black 142
1119 a Fh(\017)p Black 83 w Fi(E.g.)83 b(the)f(X)-7 b(Query)83
b(exp)-7 b(ression)p Black Black 1363 1450 a Fg(element)108
b(STUDENT)g({)1784 1686 y(element)g(SID)f({)e(101)i(})1784
1923 y(element)h(FIRST)f({)f("Ann")h(})1784 2160 y(element)h(LAST)212
b({)106 b("Smith")i(})1363 2396 y(})324 2718 y Fi(gives)p
Black Black 1731 3002 a Fg()2153 3238 y(101)2153
3475 y(Ann)2153 3712 y(Smith)1731
3948 y()p Black -283 4114 5977 9 v -283 4260
a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725
b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p Black
eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 56 55 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-56)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
148 52 5047 4 v 148 551 4 500 v 234 397 a Fj(Computed)144
b(Constructo)-12 b(rs)143 b(\(3\))p 5192 551 V 148 554
5047 4 v 5195 555 67 440 v 214 621 5047 67 v Black 142
1032 a Fh(\017)p Black 83 w Fi(One)83 b(can)g(also)g(compute)f(the)h
(element)f(\(t)-7 b(yp)7 b(e\))84 b(name:)p Black Black
836 1355 a Fg(element)108 b({)e(concat\("S",)j("ID"\))e(})f({)g(100+1)h
(})p Black 142 1706 a Fh(\017)p Black 83 w Fi(A)-7 b(tomization)81
b(is)i(applied)g(to)f(the)h(name)f(exp)-7 b(ression.)p
Black Black 608 1962 a Fo(afterw)i(a)g(rds)42 b(it)f(must)h(b)5
b(e)40 b(of)h(t)-5 b(yp)5 b(e)40 b Ff(xs:QName)p Fo(,)j
Ff(xs:string)p Fo(,)f(o)-5 b(r)42 b Ff(xs:untypedAtomic)p
Fo(.)p Black 142 2324 a Fh(\017)p Black 83 w Fi(Otherwise,)67
b(the)g(p)-7 b(ro)7 b(cessing)67 b(is)f(done)h(as)g(fo)-7
b(r)67 b(direct)f(con-)324 2599 y(structo)-7 b(rs.)p
Black Black 608 2854 a Fo(Esp)5 b(ecially)-14 b(,)78
b(if)i(the)f(result)h(of)f(evaluating)h(the)g(content)f(exp)-5
b(ression)79 b(of)g(an)608 3029 y(element)47 b(constructo)-5
b(r)48 b(sta)-5 b(rts)50 b(with)e(attribute)h(no)5 b(des,)47
b(these)h(a)-5 b(re)48 b(assigned)g(to)608 3203 y(the)57
b(constructed)g(element)f(no)5 b(de.)p Black 142 3565
a Fh(\017)p Black 83 w Fi(If)83 b(the)g(content)f(exp)-7
b(ression)84 b(is)f(missing,)g(the)f(content)h(is)324
3841 y(empt)-7 b(y)-21 b(.)83 b(One)g(must)f(still)h(write)f
Fg({})i Fi(in)e(this)h(case.)p Black -283 4114 5977 9
v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
%%Page: (56,57,58,59) 15
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 57 56 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-57)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
148 52 5047 4 v 148 551 4 500 v 234 397 a Fj(Computed)144
b(Constructo)-12 b(rs)143 b(\(4\))p 5192 551 V 148 554
5047 4 v 5195 555 67 440 v 214 621 5047 67 v Black 142
1042 a Fh(\017)p Black 83 w Fi(F)-7 b(o)g(r)77 b(attribute,)e(text,)g
(comment,)h(and)h(PI)f(constructo)-7 b(rs,)324 1328 y(atomization)108
b(is)g(applied)h(to)f(the)g(result)f(of)i(evaluating)324
1614 y(the)83 b(content)f(exp)-7 b(ression.)p Black 142
1975 a Fh(\017)p Black 83 w Fi(The)112 b(resulting)f(atomic)g(values)i
(a)-7 b(re)112 b(cast)f(into)g(strings)324 2261 y(and)78
b(concatenated)f(with)h(a)f(single)h(space)g(inserted)f(b)7
b(et-)324 2547 y(w)-7 b(een)84 b(each)f(pair)f(\(empt)-7
b(y)83 b(sequence)g Fh(!)g Fi(empt)-7 b(y)82 b(string\).)p
Black 142 2908 a Fh(\017)p Black 83 w Fi(F)-7 b(o)g(r)77
b(constructed)e(attribute)g(no)7 b(des)76 b(the)g(t)-7
b(yp)7 b(e)76 b(annotati-)324 3194 y(on)83 b(is)g Fg(xs:untypedAtomic)p
Fi(.)p Black 142 3554 a Fh(\017)p Black 83 w Fi(Constructed)105
b(text)g(no)7 b(des)106 b(a)-7 b(re)106 b(automatically)g(deleted)324
3841 y(when)83 b(their)f(text)h(is)f(the)h(empt)-7 b(y)82
b(string.)p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 58 57 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-58)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1777 154 1789 4 v 1777 558 4 405 v 1864 475 a Fj(Overview)p
3563 558 V 1777 561 1789 4 v 3566 561 67 345 v 1844 628
1789 67 v Black Black 690 1343 a Fi(1.)83 b(Intro)7 b(duction)690
1887 y(2.)83 b(Basic)f(Syntax,)h(Constructo)-7 b(rs)690
2445 y(3.)83 b(FLO)-7 b(WR-Exp)g
0 setlinecap
(ressions)2705 2389 y
save /setgray { pop } def
2705 2389 a @beginspecial @setspecial
0.99626401 0.99626401 scale 0.79999 setlinewidth 261.2973 0 moveto
261.2973 9.86255 lineto 0 11.04584 -8.95416 20 -20 20 rcurveto 0 29.86255
lineto -241.2973 29.86255 lineto -11.04584 0 -20 -8.95416 -20 -20 rcurveto
-261.2973 0 lineto -261.2973 -9.86255 lineto 0 -11.04584 8.95416 -20
20 -20 rcurveto 0 -29.86255 lineto 241.2973 -29.86255 lineto 11.04584
0 20 8.95416 20 20 rcurveto 261.2973 0 lineto stroke
@endspecial 2705
2389 a
restore
2705 2389 a 690 3002 a Fi(4.)83 b(Examples,)g(Compa)-7
b(rison)83 b(with)f(SQL)690 3560 y(5.)h(Prolog,)f(F)-7
b(unctions)p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 59 58 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-59)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
443 52 4458 4 v 443 551 4 500 v 529 397 a Fj(FL)-48 b(W)-12
b(OR-Exp)g(ressions)144 b(\(1\))p 4897 551 V 443 554
4458 4 v 4900 555 67 440 v 509 621 4458 67 v Black 142
1018 a Fh(\017)p Black 83 w Fi(An)117 b(imp)7 b(o)-7
b(rtant)116 b(construct)g(of)h(X)-7 b(Query)117 b(a)-7
b(re)118 b(FL)-28 b(W)-7 b(OR-)324 1304 y(exp)g(ressions)83
b(\(p)-7 b(ronounced)83 b(\\Flo)-7 b(w)g(er-exp)g(ressions"\):)p
Black Black 1177 1578 a Fg(for)84 b($)p Fh(h)p Fi(va)-7
b(r)p Fh(i)83 b Fg(in)g Fh(h)p Fi(Exp)-7 b(rSingle)p
Fh(i)p Fg(,)83 b Fi(.)41 b(.)h(.)1177 1831 y Fg(let)84
b($)p Fh(h)p Fi(va)-7 b(r)p Fh(i)83 b Fg(:=)g Fh(h)p
Fi(Exp)-7 b(rSingle)p Fh(i)p Fg(,)83 b Fi(.)41 b(.)h(.)1177
2085 y Fg(where)85 b Fh(h)p Fi(Exp)-7 b(rSingle)p Fh(i)1177
2338 y Fi([)p Fg(stable)p Fi(])107 b Fg(order)h(by)83
b Fh(h)p Fi(OrderSp)7 b(ecList)p Fh(i)1177 2591 y Fg(return)85
b Fh(h)p Fi(Exp)-7 b(rSingle)p Fh(i)p Black 142 2891
a(\017)p Black 83 w Fi(One)73 b(can)f(use)g Fg(for)i
Fi(and)e Fg(let)h Fi(multiple)f(times)f(in)i(a)-7 b(rbitra)g(ry)324
3177 y(o)g(rder.)82 b(A)-7 b(t)82 b(least)h(one)g(of)f(the)g(t)-7
b(w)g(o)83 b(is)g(required.)p Black Black 608 3450 a
Fo(Exp)-5 b(rSingle)57 b(is)h(an)g(X)-5 b(Query)57 b(exp)-5
b(ression)57 b(without)h(the)f(\\)p Ff(,)p Fo(")h(outside)f
Ff(\(...\))p Fo(.)p Black 142 3824 a Fh(\017)p Black
83 w Fg(where)85 b Fi(and)d Fg(order)107 b(by)84 b Fi(a)-7
b(re)83 b(optional.)p Black -283 4114 5977 9 v -283 4260
a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725
b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p Black
eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 60 59 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-60)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
443 52 4458 4 v 443 551 4 500 v 529 397 a Fj(FL)-48 b(W)-12
b(OR-Exp)g(ressions)144 b(\(2\))p 4897 551 V 443 554
4458 4 v 4900 555 67 440 v 509 621 4458 67 v Black 142
1136 a Fh(\017)p Black 83 w Fi(The)74 b(exp)-7 b(ressions)75
b(in)f(the)f Fg(for)j Fi(and)e Fg(let)h Fi(clauses)g(a)-7
b(re)74 b(eva-)324 1412 y(luted)83 b(to)f(p)-7 b(ro)7
b(duce)82 b(a)h(sequence.)p Black Black 608 1669 a Fo(In)51
b(case)f(of)g(the)g Ff(for)i Fo(clause,)e(this)h(is)g(called)g(the)f
(\\binding)i(sequence")d(fo)-5 b(r)51 b(the)608 1844
y(va)-5 b(riable.)p Black 142 2208 a Fh(\017)p Black
83 w Fi(The)119 b Fg(for)p Fi(-clause)g(iterates)f(over)h(the)f
(elements)h(of)f(se-)324 2484 y(quence,)83 b(e.g.)p Black
Black 889 2810 a Fg(for)106 b($i)g(in)g(\(1,)h(2,)f(3\))g(return)h
({$i})324 3136 y Fi(gives)p Black Black 2469 3349
a Fg(1)2469 3586 y(2)2469 3822 y(3)p
Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)
g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
%%Page: (60,61,62,63) 16
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 61 60 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-61)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
443 190 4458 4 v 443 689 4 500 v 529 535 a Fj(FL)-48
b(W)-12 b(OR-Exp)g(ressions)144 b(\(3\))p 4897 689 V
443 692 4458 4 v 4900 692 67 440 v 509 759 4458 67 v
Black 142 1274 a Fh(\017)p Black 83 w Fi(In)117 b(contrast,)e(the)i
Fg(let)p Fi(-clause)h(assigns)e(the)h(entire)f(se-)324
1589 y(quence)83 b(to)g(the)f(va)-7 b(riable,)83 b(e.g.)p
Black Black 889 1954 a Fg(let)106 b($i)g(:=)g(\(1,)h(2,)f(3\))g(return)
h({$i})324 2320 y Fi(gives)p Black Black 2258
2589 a Fg(1)g(2)f(3)p Black Black 608 2935 a Fo(Here)60
b(the)h(sequence)f(of)g(atomic)i(values)e(is)i(mapp)5
b(ed)61 b(to)g(a)g(single)h(text)e(no)5 b(de)608 3118
y(as)58 b(explained)f(ab)5 b(ove)56 b(fo)-5 b(r)58 b(the)f(constructo)
-5 b(rs.)58 b(But)g(e.g.)608 3300 y Ff(let)74 b($i)f(:=)h(\(,)g
(,)g(\))g(return)g({$i})608 3483 y Fo(gives)401
b Ff()p Fo(.)608 3666 y(In)57 b(contrast,)h
Ff(for)g Fo(gives)401 b Ff()p
Fo(.)p Black -283 4114 5977 9 v -283 4260 a(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 62 61 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-62)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
443 52 4458 4 v 443 551 4 500 v 529 397 a Fj(FL)-48 b(W)-12
b(OR-Exp)g(ressions)144 b(\(4\))p 4897 551 V 443 554
4458 4 v 4900 555 67 440 v 509 621 4458 67 v Black 142
1018 a Fh(\017)p Black 83 w Fi(Semantically)-21 b(,)70
b(it)g(mak)-7 b(es)70 b(no)f(di\013erence)h(whether)g(sever-)324
1316 y(al)75 b(va)-7 b(riables)74 b(a)-7 b(re)74 b(b)7
b(ound)74 b(in)g(a)g(single)h Fg(for)p Fi(/)p Fg(let)p
Fi(-clause,)h(o)-7 b(r)324 1615 y(whether)83 b(the)f(k)-7
b(eyw)g(o)g(rd)83 b(is)g(rep)7 b(eated)82 b(each)h(time.)p
Black Black 608 1907 a Fo(This)58 b(is)g(of)f(course)g(the)g(same)g
(rule)h(as)f(fo)-5 b(r)58 b(the)f Ff(for)p Fo(-exp)-5
b(ressions)58 b(in)g(XP)-5 b(ath.)p Black 142 2293 a
Fh(\017)p Black 83 w Fi(F)e(o)g(r)83 b(instance,)p Black
Black 1099 2568 a Fg(for)107 b($i)f(in)g(\('a',)h('b'\),)g($j)f(in)h
(\(1,)f(2\))1099 2805 y(return)i(element)g({$i})f({$j})324
3127 y Fi(is)83 b(equivalent)g(to:)p Black Black 1521
3434 a Fg(for)106 b($i)g(in)g(\('a',)i('b'\))1521 3671
y(for)e($j)g(in)g(\(1,)h(2\))1521 3907 y(return)g(element)h({$i})f({)f
($j)g(})p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 63 62 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-63)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
443 112 4458 4 v 443 612 4 500 v 529 457 a Fj(FL)-48
b(W)-12 b(OR-Exp)g(ressions)144 b(\(5\))p 4897 612 V
443 615 4458 4 v 4900 615 67 440 v 509 681 4458 67 v
Black 142 1102 a Fh(\017)p Black 83 w Fi(Both)112 b(of)h(the)g(ab)7
b(ove)113 b(queries)h(p)-7 b(ro)7 b(duce)113 b(the)f(follo)-7
b(wing)324 1417 y(result)82 b(\(if)h(o)-7 b(rdering)83
b(mo)7 b(de)82 b(is)h Fg(ordered)p Fi(,)i(see)e(b)7 b(elo)-7
b(w\):)p Black Black 2469 1738 a Fg(1)2469 1975
y(2)2469 2212 y(1)2469 2448 y(2)p
Black 142 2820 a Fh(\017)p Black 83 w Fi(This)96 b(\014ts)g(w)-7
b(ell)98 b(with)e(the)g(nested)h Fg(for)p Fi(-lo)7 b(ops:)97
b(F)-7 b(o)g(r)96 b(each)324 3135 y(value)83 b(of)e(the)g(va)-7
b(riable)83 b Fg($i)f Fi(in)g(the)f(outer)g(fo)-7 b(r)81
b(lo)7 b(op)82 b(\(each)324 3451 y(element)107 b(name\),)g(the)f(inner)
g(fo)-7 b(r)106 b(lo)7 b(op)106 b(\(over)h Fg($j)p Fi(\))h(\(the)324
3766 y(element)83 b(content\))f(is)h(rep)7 b(eated)82
b(once.)p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 64 63 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-64)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
443 52 4458 4 v 443 551 4 500 v 529 397 a Fj(FL)-48 b(W)-12
b(OR-Exp)g(ressions)144 b(\(6\))p 4897 551 V 443 554
4458 4 v 4900 555 67 440 v 509 621 4458 67 v Black 142
1042 a Fh(\017)p Black 83 w Fi(Thus,)80 b(the)f(sequence)i(in)f(which)g
(va)-7 b(riables)80 b(a)-7 b(re)80 b(decla)-7 b(red)324
1320 y(in)83 b(the)f Fg(for)p Fi(-clause)i(is)f(imp)7
b(o)-7 b(rtant.)p Black Black 608 1582 a Fo(In)60 b(contrast,)h(in)f
(SQL)g(the)g(sequence)e(of)i(va)-5 b(riable)61 b(decla)-5
b(rations)62 b(under)e Ff(FROM)608 1757 y Fo(is)d(semantically)h(not)g
(imp)5 b(o)-5 b(rtant.)p Black 142 2123 a Fh(\017)p Black
83 w Fi(If)73 b(one)g(exchanges)h(the)e(t)-7 b(w)g(o)73
b(va)-7 b(riable)73 b(decla)-7 b(rations,)73 b(i.e.)p
Black Black 1099 2379 a Fg(for)107 b($j)f(in)g(\(1,)g(2\),)h($i)f(in)g
(\('a',)h('b'\))1099 2615 y(return)h(element)g({$i})f({$j})324
2937 y Fi(the)83 b(output)e(is)i(p)-7 b(ro)7 b(duced)83
b(in)f(a)h(di\013erent)f(o)-7 b(rder:)p Black Black 2469
3245 a Fg(1)2469 3481 y(1)2469 3718 y(2)2469
3955 y(2)p Black -283 4114 5977 9 v -283 4260
a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725
b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p Black
eop end
PStoPSsaved restore
%%Page: (64,65,66,67) 17
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 65 64 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-65)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
443 52 4458 4 v 443 551 4 500 v 529 397 a Fj(FL)-48 b(W)-12
b(OR-Exp)g(ressions)144 b(\(7\))p 4897 551 V 443 554
4458 4 v 4900 555 67 440 v 509 621 4458 67 v Black 142
1042 a Fh(\017)p Black 83 w Fi(T)-21 b(ogether,)113 b(the)f
Fg(for)j Fi(and)e Fg(let)h Fi(clauses)g(p)-7 b(ro)7 b(duce)113
b(a)g(se-)324 1331 y(quence)87 b(of)e(va)-7 b(riable)87
b(assignments)e(\(mapping)h(each)h(va-)324 1620 y(riable)c(to)f(a)h
(value,)g(i.e.)g(an)f(XDM)h(sequence\).)p Black 142 1984
a Fh(\017)p Black 83 w Fi(The)119 b(X)-7 b(Query)120
b(standa)-7 b(rd)118 b(uses)i(the)f(w)-7 b(o)g(rd)119
b(\\tuple")g(in-)324 2274 y(stead)83 b(of)f(\\va)-7 b(riable)83
b(assignment".)p Black Black 608 2552 a Fo(I)74 b(consider)g(that)h
(unfo)-5 b(rtunate,)75 b(b)5 b(ecause)73 b(it)h(mak)-5
b(es)74 b(the)g(compa)-5 b(rison)75 b(with)608 2729 y(SQL)56
b(mo)-5 b(re)57 b(di\016cult)g(\(where)f(each)h(va)-5
b(riable)58 b(is)f(b)5 b(ound)57 b(to)g(a)h(\\tuple"\).)f(The)608
2907 y(standa)-5 b(rd)80 b(uses)e(the)h(w)-5 b(o)g(rd)79
b(\\va)-5 b(riable)79 b(binding")h(fo)-5 b(r)79 b(the)f(asso)5
b(ciation)80 b(b)5 b(et-)608 3084 y(w)-5 b(een)66 b(a)h(single)g(va)-5
b(riable)68 b(and)f(its)g(value.)f(A)h(\\tuple")g(consists)g(of)g(\\va)
-5 b(riable)608 3261 y(bindings".)60 b(Of)g(course,)f(it)h(is)g(fo)-5
b(rmally)60 b(true,)g(that)g(a)h(tuple)e(is)h(the)g(generali-)608
3439 y(zation)f(of)f(pair,)h(triple,)g(and)g(so)f(on,)g(and)h(here)f
(several)f(\\va)-5 b(riable)60 b(bindings")608 3616 y(a)-5
b(re)57 b(combined)f(\(a)h(tuple)f(can)h(also)g(b)5 b(e)56
b(seen)g(as)g(a)h(mapping)h(from)e(names)g(to)608 3794
y(values,)42 b(which)h(\014ts)g(here,)f(to)5 b(o,)43
b(but)h(usually)f(the)g(names)g(a)-5 b(re)43 b(column)g(names\).)p
Black -283 4114 5977 9 v -283 4260 a(Stefan)56 b(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 66 65 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-66)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
443 52 4458 4 v 443 551 4 500 v 529 397 a Fj(FL)-48 b(W)-12
b(OR-Exp)g(ressions)144 b(\(8\))p 4897 551 V 443 554
4458 4 v 4900 555 67 440 v 509 621 4458 67 v Black 142
1042 a Fh(\017)p Black 83 w Fi(The)67 b(sequence)h(of)e(va)-7
b(riable)68 b(assignments)f(generated)f(b)-7 b(y)324
1328 y Fg(for)p Fi(/)p Fg(let)85 b Fi(is)e(called)g(\\tuple)g(stream")e
(in)i(the)f(standa)-7 b(rd.)p Black 142 1689 a Fh(\017)p
Black 83 w Fi(There)56 b(is)g(a)g(pa)-7 b(rameter)55
b(called)h(\\o)-7 b(rdering)56 b(mo)7 b(de",)55 b(which)324
1975 y(can)83 b(b)7 b(e)83 b(\\)p Fg(ordered)p Fi(")i(o)-7
b(r)82 b(\\)p Fg(unordered)p Fi(".)p Black Black 608
2248 a Fo(This)58 b(pa)-5 b(rameter)58 b(is)g(explained)f(in)h(detail)g
(on)f(Slide)3852 2248 y
SDict begin H.S end
3852 2248 a Black Fo(7-80)p Black
4168 2157 a
SDict begin H.R end
4168 2157 a 4168 2248 a
SDict begin [/Color [1 0 0]/H /I/Border [0 0 1]BorderArrayPatch/Subtype
/Link/Dest (Doc-Start) cvn H.B /ANN pdfmark end
4168 2248 a 57 w
Fo(and)h(follo)-5 b(wing.)p Black 142 2621 a Fh(\017)p
Black 83 w Fi(If)114 b(the)f(o)-7 b(rdering)113 b(mo)7
b(de)113 b(is)h Fg(ordered)p Fi(,)h(X)-7 b(Query)114
b(gua)-7 b(ran-)324 2907 y(tees)91 b(that)e(the)h(tuple)g(stream)g(is)g
(in)h(the)f(sequence)h(that)324 3193 y(co)-7 b(rresp)7
b(onds)83 b(to)f(the)g(nested)h Fg(for)p Fi(-lo)7 b(ops)83
b(\(see)g(ab)7 b(ove\).)p Black 142 3554 a Fh(\017)p
Black 83 w Fi(Then)69 b(the)h(do)7 b(cument)68 b(o)-7
b(rder)69 b(of)h(the)f(o)-7 b(riginal)69 b(do)7 b(cument)324
3841 y(is)83 b(retained)f(in)h(the)f(output)g(of)g(the)h(query)-21
b(.)p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 67 66 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-67)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
443 52 4458 4 v 443 551 4 500 v 529 397 a Fj(FL)-48 b(W)-12
b(OR-Exp)g(ressions)144 b(\(9\))p 4897 551 V 443 554
4458 4 v 4900 555 67 440 v 509 621 4458 67 v Black 142
1042 a Fh(\017)p Black 83 w Fi(Next,)71 b(the)f Fg(where)p
Fi(-clause)i(acts)f(as)f(a)h(\014lter)e(on)i(the)f(\\tuple)324
1339 y(stream")82 b(\(sequence)i(of)e(va)-7 b(riable)83
b(assignments\).)p Black 142 1711 a Fh(\017)p Black 83
w Fi(F)-7 b(o)g(r)115 b(each)g(va)-7 b(riable)115 b(assignment,)f(the)g
(exp)-7 b(ression)115 b(un-)324 2009 y(der)71 b Fg(where)h
Fi(is)f(evaluated,)g(and)g(its)f(e\013ective)h(b)7 b(o)g(olean)71
b(va-)324 2306 y(lue)83 b(is)g(determined.)p Black 142
2678 a Fh(\017)p Black 83 w Fi(If)68 b(it)f(is)g(false,)h(the)f(va)-7
b(riable)68 b(assignment)f(is)h(deleted)g(from)324 2975
y(the)83 b(sequence.)p Black Black 608 3266 a Fo(I.e.)45
b(the)h(remaining)h(sequence)d(of)i(va)-5 b(riable)47
b(assignments)f(contains)h(only)f(tho-)608 3445 y(se)79
b(va)-5 b(riable)81 b(assignments)g(fo)-5 b(r)80 b(which)g(the)g
Ff(where)p Fo(-condition)h(is)g(true.)f(The)608 3624
y(va)-5 b(riable)60 b(assignments)g(remain)g(in)g(the)g(same)f
(relative)h(o)-5 b(rder)60 b(in)g(which)f(they)608 3803
y(w)-5 b(ere)57 b(generated)g(b)-5 b(y)57 b(the)g Ff(for)h
Fo(and)g Ff(let)p Fo(-clauses.)p Black -283 4114 5977
9 v -283 4260 a(Stefan)e(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 68 67 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-68)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
336 52 4673 4 v 336 551 4 500 v 422 397 a Fj(FL)-48 b(W)-12
b(OR-Exp)g(ressions)144 b(\(10\))p 5004 551 V 336 554
4673 4 v 5008 555 67 440 v 402 621 4673 67 v Black 142
1042 a Fh(\017)p Black 83 w Fi(Because)67 b(the)g(e\013ective)g(b)7
b(o)g(olean)66 b(value)i(is)f(automatical-)324 1324 y(ly)103
b(determined,)e(one)h(can)g(easily)h(check)f(the)g(existence)324
1606 y(of)83 b(a)f(no)7 b(de:)p Black Black 889 1886
a Fg(for)106 b($s)g(in)g(//STUDENT)889 2122 y(where)h
(//RESULT[SID=$s/SID)112 b(and)107 b(CAT='H'])889 2359
y(return)g($s/LAST)324 2647 y Fi(\(students)83 b(who)f(submitted)g(at)g
(least)h(one)g(homew)-7 b(o)g(rk\).)p Black Black 608
2914 a Fo(Rememb)5 b(er)54 b(that)i(the)e(e\013ective)g(b)5
b(o)g(olean)55 b(value)f(of)h(a)g(sequence)f(that)h(sta)-5
b(rts)608 3090 y(with)52 b(a)g(no)5 b(de)52 b(is)g(true,)g(whereas)f
(the)h(e\013ective)e(b)5 b(o)g(olean)52 b(value)g(of)g(the)f(empt)-5
b(y)608 3266 y(sequence)82 b(is)h(false.)g(Other)h(p)5
b(ossible)83 b(cases)g(a)-5 b(re)84 b(singleton)g(sequences)e(of)608
3442 y(b)5 b(o)g(olean)55 b(t)-5 b(yp)5 b(e,)54 b(of)g(string)i(t)-5
b(yp)5 b(e)55 b(including)g Ff(anyURI)h Fo(and)g Ff(untypedAtomic)h
Fo(\(only)608 3618 y(the)f(empt)-5 b(y)56 b(string)h(is)g(considered)f
(false\),)g(and)h(of)f(numeric)g(t)-5 b(yp)5 b(e)56 b(\(only)h(NaN)608
3794 y(and)h(0)f(a)-5 b(re)58 b(treated)g(as)f(false\).)g(In)h(all)g
(other)f(cases,)g(a)h(t)-5 b(yp)5 b(e)56 b(erro)-5 b(r)59
b(o)5 b(ccurs.)p Black -283 4114 5977 9 v -283 4260 a(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
%%Page: (68,69,70,71) 18
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 69 68 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-69)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
336 52 4673 4 v 336 551 4 500 v 422 397 a Fj(FL)-48 b(W)-12
b(OR-Exp)g(ressions)144 b(\(11\))p 5004 551 V 336 554
4673 4 v 5008 555 67 440 v 402 621 4673 67 v Black 142
1042 a Fh(\017)p Black 83 w Fi(The)69 b Fg(where)p Fi(-clause)j(is)d
(optional.)g(As)g(in)g(SQL,)h(it)f(defaults)324 1336
y(to)83 b(\\)p Fg(true)p Fi(")h(\(no)f(va)-7 b(riable)83
b(assignments)f(a)-7 b(re)83 b(deleted\).)p Black 142
1704 a Fh(\017)p Black 83 w Fi(If)93 b(an)g(\\)p Fg(order)107
b(by)p Fi(")94 b(clause)f(is)g(sp)7 b(eci\014ed,)93 b(the)g(remaining)
324 1998 y(sequence)84 b(of)e(va)-7 b(riable)83 b(assignments)g(is)f
(then)h(so)-7 b(rted.)p Black Black 608 2283 a Fo(The)57
b Ff(order)74 b(by)p Fo(-clause)58 b(is)g(explained)f(on)g(Slide)3562
2283 y
SDict begin H.S end
3562 2283 a Black Fo(7-86)p Black 3878 2193 a
SDict begin H.R end
3878 2193 a 3878 2283 a
SDict begin [/Color [1 0 0]/H /I/Border [0 0 1]BorderArrayPatch/Subtype
/Link/Dest (Doc-Start) cvn H.B /ANN pdfmark end
3878 2283 a 57 w Fo(and)h(follo)-5
b(wing.)p Black 142 2665 a Fh(\017)p Black 83 w Fi(The)103
b(last)h(step)f(is)h(the)f Fg(return)p Fi(-clause)j(\(required\):)d(F)
-7 b(o)g(r)324 2959 y(each)101 b(va)-7 b(riable)100 b(assignment,)f
(the)h Fg(return)p Fi(-exp)-7 b(ression)102 b(is)324
3253 y(evaluated,)135 b(and)f(the)g(resulting)f(item)h(sequences)h(a)-7
b(re)324 3547 y(concatenated)85 b(in)g(the)f(o)-7 b(rder)84
b(given)i(b)-7 b(y)85 b(the)f(current)g(se-)324 3841
y(quence)f(of)g(va)-7 b(riable)83 b(assignments.)p Black
-283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 70 69 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-70)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
336 128 4673 4 v 336 627 4 500 v 422 473 a Fj(FL)-48
b(W)-12 b(OR-Exp)g(ressions)144 b(\(12\))p 5004 627 V
336 630 4673 4 v 5008 630 67 440 v 402 697 4673 67 v
Black 142 1141 a Fh(\017)p Black 83 w Fi(The)95 b(length)f(of)g(the)h
(result)f(sequence)h(can)g(di\013er)g(from)324 1456 y(the)68
b(numb)7 b(er)67 b(of)h(va)-7 b(riable)68 b(assignments)f(considered,)h
(b)7 b(e-)324 1772 y(cause)102 b(the)g Fg(return)p Fi(-exp)-7
b(ression)103 b(can)f(evaluate)g(to)f(a)h(se-)324 2087
y(quence)83 b(of)g(a)-7 b(rbitra)g(ry)82 b(length)g(\(0,)h(1,)f(o)-7
b(r)83 b(mo)-7 b(re\).)p Black 142 2478 a Fh(\017)p Black
83 w Fi(In)111 b(the)g(follo)-7 b(wing)111 b(query)-21
b(,)111 b(there)f(is)h(one)g(va)-7 b(riable)112 b(assi-)324
2793 y(gnment)97 b(p)7 b(er)98 b(SQL)g(exercise)h(\(2\),)f(but)f(the)g
(output)g(se-)324 3109 y(quence)70 b(contains)g(one)f(entry)g(p)7
b(er)69 b(solution)g(\(5)59 b(=)g(2)24 b(+)g(3\):)p Black
Black 678 3477 a Fg(for)106 b($e)g(in)g(//EXERCISE[TOPIC=)q('SQ)q(L')q
(])678 3713 y(return)h(//RESULT[CAT=$e/C)q(AT)112 b(and)106
b(ENO=$e/ENO])p Black -283 4114 5977 9 v -283 4260 a
Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725
b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p Black
eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 71 70 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-71)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
336 52 4673 4 v 336 551 4 500 v 422 397 a Fj(FL)-48 b(W)-12
b(OR-Exp)g(ressions)144 b(\(13\))p 5004 551 V 336 554
4673 4 v 5008 555 67 440 v 402 621 4673 67 v Black 142
1018 a Fh(\017)p Black 83 w Fi(All)124 b(sub)7 b(exp)-7
b(ressions)125 b(of)e(the)h(FL)-28 b(W)-7 b(OR-exp)g(ression)126
b(a)-7 b(re)324 1296 y(\\Exp)g(rSingle",)100 b(thus)f(the)h(op)7
b(erato)-7 b(r)99 b(\\)p Fg(,)p Fi(")h(fo)-7 b(r)99 b(sequence)324
1574 y(concatenation)83 b(can)g(b)7 b(e)82 b(used)h(only)g(inside)g
Fg(\(...\))p Fi(.)p Black 142 1927 a Fh(\017)p Black
83 w Fi(The)71 b(entire)g(FL)-28 b(W)-7 b(OR-exp)g(ression)72
b(has)f(a)g(higher)g(p)-7 b(rio)g(rit)g(y)324 2204 y(than)83
b(the)f(comma)g(op)7 b(erato)-7 b(r,)82 b(thus)p Black
Black 1521 2483 a Fg(for)106 b($i)g(in)g(\(1,)h(2,)f(3\))1521
2720 y(return)h()g({$i})g(,)g()324 3018 y
Fi(is)83 b(not)f(a)h(syntax)g(erro)-7 b(r,)81 b(but)h(returns)p
Black Black 2469 3278 a Fg(1)2469 3515 y(2)2469
3751 y(3)2469 3988 y()p Black -283 4114 5977
9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 72 71 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-72)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
336 52 4673 4 v 336 551 4 500 v 422 397 a Fj(FL)-48 b(W)-12
b(OR-Exp)g(ressions)144 b(\(14\))p 5004 551 V 336 554
4673 4 v 5008 555 67 440 v 402 621 4673 67 v Black 142
1042 a Fh(\017)p Black 83 w Fi(If)73 b(one)g(uses)g(constructo)-7
b(rs)71 b(under)h Fg(return)p Fi(,)j(all)e(no)7 b(des)73
b(a)-7 b(re)324 1337 y(new)83 b(\(entire)g(subtrees)f(a)-7
b(re)83 b(copied\).)p Black 142 1707 a Fh(\017)p Black
83 w Fi(If)103 b(one)g(uses)g(only)g(standa)-7 b(rd)102
b(XP)-7 b(ath-exp)g(ressions)102 b(\(e.g.)324 2002 y(va)-7
b(riable)83 b(names\),)g(no)g(cop)-7 b(ying)83 b(is)g(done.)p
Black Black 608 2289 a Fo(This)43 b(also)g(necessa)-5
b(ry)41 b(fo)-5 b(r)43 b(the)f(compatibilit)-5 b(y)43
b(with)g(XP)-5 b(ath,)43 b(which)f(has)h(simple)608 2468
y Ff(for)p Fo(-lo)5 b(ops)58 b(and)g(never)f(constructs)g(new)g(no)5
b(des)57 b(\(only)g(new)g(sequences\).)p Black 142 2850
a Fh(\017)p Black 83 w Fi(F)-7 b(o)g(r)83 b(example,)g(the)f(follo)-7
b(wing)83 b(returns)f Fg("yes")p Fi(:)p Black Black 783
3174 a Fg(let)107 b($x)f(:=)g(\(\))783 3410 y(let)h($y)f(:=)g
(\(for)h($x1)f(in)g($x)g(return)i($x1\))783 3647 y(let)f($z)f(:=)g
(\(for)h($x2)f(in)g($x)g(return)i($x2\))783 3884 y(return)g(if\($y)f
(is)f($z\))h(then)f("yes")i(else)e("no")p Black -283
4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
%%Page: (72,73,74,75) 19
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 73 72 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-73)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
591 148 4161 4 v 591 647 4 500 v 678 493 a Fd(for)p Fj(-Clause:)144
b(Details)f(\(1\))p 4748 647 V 591 650 4161 4 v 4752
651 67 440 v 658 717 4161 67 v Black 142 1232 a Fh(\017)p
Black 83 w Fi(The)108 b(scop)7 b(e)108 b(of)g(a)g(va)-7
b(riable)108 b(decla)-7 b(red)108 b(with)g Fg(for)h Fi(o)-7
b(r)108 b Fg(let)324 1548 y Fi(extends)e(from)f(the)g(p)7
b(oint)105 b(just)g(after)g(the)g(binding)h(ex-)324 1863
y(p)-7 b(ression)81 b(\(which)h(de\014nes)f(the)f(values)h(fo)-7
b(r)80 b(the)h(va)-7 b(riable\))324 2178 y(to)83 b(the)f(end)h(of)f
(the)g(FL)-28 b(W)-7 b(OR-exp)g(ression.)p Black 142
2569 a Fh(\017)p Black 83 w Fi(Thus,)97 b(the)g(va)-7
b(riable)98 b(can)f(already)h(b)7 b(e)97 b(used)g(in)h(binding)324
2884 y(exp)-7 b(ressions)82 b(fo)-7 b(r)80 b(other)g(va)-7
b(riables)81 b(decla)-7 b(red)81 b(later)f(in)h(the)324
3200 y(same)i Fg(for)p Fi(-clause:)p Black Black 414
3575 a Fg(for)107 b($s)f(in)g(//STUDENT,)j($r)d(in)g(//RESULT[SID=$s/S)
q(ID])414 3811 y(return)i(element)g(solved)f({$s/LAST,)i($r/CAT,)f
($r/ENO})p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 74 73 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-74)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
591 52 4161 4 v 591 551 4 500 v 678 397 a Fd(for)p Fj(-Clause:)144
b(Details)f(\(2\))p 4748 551 V 591 554 4161 4 v 4752
555 67 440 v 658 621 4161 67 v Black 142 1136 a Fh(\017)p
Black 83 w Fi(This)111 b(rule)g(fo)-7 b(r)111 b(the)g(scop)7
b(e)111 b(of)g(va)-7 b(riables)112 b(\014ts)f(with)g(the)324
1413 y(equivalence)84 b(with)f(nested)f Fg(for)p Fi(-lo)7
b(ops.)p Black 142 1764 a Fh(\017)p Black 83 w Fi(It)66
b(di\013ers)f(from)f(SQL:)i(There)g(the)f(va)-7 b(riable)66
b(decla)-7 b(rations)324 2040 y(in)74 b(the)g Fg(FROM)p
Fi(-clause)i(a)-7 b(re)74 b(conceptually)g(done)g(in)g(pa)-7
b(rallel.)p Black Black 608 2298 a Fo(Thus,)52 b(one)f(cannot)h(use)f
(a)g(tuple)h(va)-5 b(riable)52 b(in)g(a)g(sub)5 b(query)51
b(later)h(in)g(the)f(same)608 2472 y Ff(FROM)p Fo(-clause.)39
b(This)h(gives)e(the)g(query)h(optimizer)g(mo)-5 b(re)39
b(freedom)f(to)h(determine)608 2647 y(the)57 b(join)h(o)-5
b(rder.)p Black 142 3011 a Fh(\017)p Black 83 w Fi(It)96
b(is)f(legal)h(\(but)f(bad)h(st)-7 b(yle\))96 b(to)f(decla)-7
b(re)96 b(several)g(va)-7 b(ria-)324 3287 y(bles)90 b(with)f(the)g
(same)g(name)h(in)f(a)g(FL)-28 b(W)-7 b(OR-exp)g(ression:)324
3564 y(Each)112 b(new)f(decla)-7 b(ration)110 b(shado)-7
b(ws)111 b(the)g(p)-7 b(reviously)111 b(de-)324 3841
y(cla)-7 b(red)83 b(va)-7 b(riable)82 b(fo)-7 b(r)82
b(the)f(rest)h(of)f(the)h Fg(FLWOR)p Fi(-exp)-7 b(ression.)p
Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)
g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 75 74 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-75)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
591 52 4161 4 v 591 551 4 500 v 678 397 a Fd(for)p Fj(-Clause:)144
b(Details)f(\(3\))p 4748 551 V 591 554 4161 4 v 4752
555 67 440 v 658 621 4161 67 v Black 142 1042 a Fh(\017)p
Black 83 w Fi(One)102 b(can)f(de\014ne)h(a)f(\\p)7 b(ositional)101
b(va)-7 b(riable")102 b(asso)7 b(ciated)324 1316 y(with)83
b(a)g(va)-7 b(riable)83 b(decla)-7 b(red)83 b(in)f(a)h
Fg(for)p Fi(-clause,)h(e.g.)p Black Black 836 1624 a
Fg(for)106 b($s)g(at)h($i)f(in)g(//STUDENT)836 1860 y(return)h(element)
h(STUD)f({)1995 2097 y(attribute)i(ID)d({$i},)1995 2333
y($s/concat\(LAST,)111 b(",)106 b(",)g(FIRST\))1573 2570
y(})p Black 142 2942 a Fh(\017)p Black 83 w Fg($i)79
b Fi(contains)g(the)f(p)7 b(osition)78 b(of)g(the)g(current)g(value)h
(fo)-7 b(r)78 b Fg($s)324 3216 y Fi(in)71 b(the)f(binding)g(sequence,)h
(i.e.)g(the)f(value)g(of)h Fg(//STUDENT)p Fi(.)p Black
142 3566 a Fh(\017)p Black 83 w Fi(P)-7 b(ositions)120
b(a)-7 b(re)121 b(counted)g(from)f Fg(1)p Fi(.)h(The)f(result)h(of)f
(the)324 3841 y(query)83 b(is)g(sho)-7 b(wn)83 b(on)f(the)h(next)f
(slide.)p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 76 75 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-76)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
591 71 4161 4 v 591 571 4 500 v 678 416 a Fd(for)p Fj(-Clause:)144
b(Details)f(\(4\))p 4748 571 V 591 574 4161 4 v 4752
574 67 440 v 658 640 4161 67 v Black 142 1084 a Fh(\017)p
Black 83 w Fi(In)107 b(the)f(example,)h(the)g(p)7 b(ositional)106
b(va)-7 b(riable)107 b(is)f(used)h(to)324 1400 y(generate)83
b(new)g(unique)g(IDs)g(fo)-7 b(r)82 b(the)g(students:)p
Black Black 1047 1731 a Fg(Smith,)j(Ann)1047
1967 y(Jones,)j(Michael)1047 2204
y(Turner,)j(Richard)1047 2441 y(Brown,)j(Maria)p Black 142 2836 a Fh(\017)p
Black 83 w Fi(Other)83 b(applications)f(of)h(p)7 b(ositional)82
b(va)-7 b(riables)83 b(include:)p Black 359 3176 a Fh(\005)p
Black 128 w Fi(First-n)f(queries)h(\(see)g(b)7 b(elo)-7
b(w\).)p Black 359 3517 a Fh(\005)p Black 128 w Fi(Sampling:)119
b(E.g.)h(tak)-7 b(e)119 b(only)h(every)g(10-th)f(student:)592
3832 y Fg($i)106 b(mod)h(10)f(=)f(1)p Black -283 4114
5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
%%Page: (76,77,78,79) 20
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 77 76 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-77)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
591 52 4161 4 v 591 551 4 500 v 678 397 a Fd(for)p Fj(-Clause:)144
b(Details)f(\(5\))p 4748 551 V 591 554 4161 4 v 4752
555 67 440 v 658 621 4161 67 v Black 142 994 a Fh(\017)p
Black 83 w Fi(It)74 b(is)h(also)f(p)7 b(ossible)75 b(to)f(decla)-7
b(re)75 b(a)f(t)-7 b(yp)7 b(e)74 b(fo)-7 b(r)74 b(the)g(va)-7
b(riable:)p Black Black 520 1254 a Fg(for)106 b($p)g(as)g(xs:decimal)
1363 1491 y(in)g(//RESULT[CAT='H')111 b(and)c(ENO=1]/POINTS)520
1728 y(return)g($p)f(div)h(10)p Black 142 2027 a Fh(\017)p
Black 83 w Fi(As)71 b(I)h(understand)f(the)g(standa)-7
b(rd,)71 b(this)g(is)h(a)f(t)-7 b(yp)7 b(e)71 b(asserti-)324
2303 y(on)h(\(lik)-7 b(e)74 b(\\)p Fg(treat)107 b(as)p
Fi("\),)73 b(so)f(it)g(should)g(give)g(an)g(erro)-7 b(r)72
b(here)324 2579 y(\(an)83 b(element)g(no)7 b(de)83 b(is)f(not)h(a)f
(decimal)h(value\).)p Black Black 608 2835 a Fo(T)-14
b(yp)5 b(e)56 b(assertions)i(might)g(b)5 b(e)57 b(necessa)-5
b(ry)56 b(to)i(p)5 b(ermit)58 b(static)f(t)-5 b(yp)5
b(e)57 b(checking.)p Black 142 3198 a Fh(\017)p Black
83 w Fi(AltovaXML)75 b(complains)f(only)g(if)g(it)g(cannot)g(convert)g
(the)324 3474 y(value)84 b(to)e(the)g(required)g(t)-7
b(yp)7 b(e)83 b(\(treats)f(it)g(as)h(t)-7 b(yp)7 b(e)82
b(cast\).)p Black 142 3824 a Fh(\017)p Black 83 w Fi(P)-7
b(ositional)82 b(va)-7 b(riables)83 b(alw)-7 b(a)g(ys)84
b(have)f(t)-7 b(yp)7 b(e)83 b Fg(xs:integer)p Fi(.)p
Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)
g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 78 77 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-78)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
591 52 4161 4 v 591 551 4 500 v 678 397 a Fd(for)p Fj(-Clause:)144
b(Details)f(\(6\))p 4748 551 V 591 554 4161 4 v 4752
555 67 440 v 658 621 4161 67 v Black 142 1018 a Fh(\017)p
Black 83 w Fi(The)87 b Fg(for)p Fi(-clause)h(consists)f(of)g(a)h
(comma-sepa)-7 b(rated)86 b(list)324 1304 y(of)113 b(one)g(o)-7
b(r)112 b(mo)-7 b(re)113 b(va)-7 b(riable)113 b(decla)-7
b(rations,)113 b(each)g(consi-)324 1590 y(sting)83 b(of:)p
Black 359 1900 a Fh(\005)p Black 128 w Fi(The)f(name)h(of)f(the)h(va)-7
b(riable)83 b(\(sta)-7 b(rting)82 b(with)g(\\)p Fg($)p
Fi("\),)p Black 359 2211 a Fh(\005)p Black 128 w Fi(optionally)-21
b(,)100 b(a)f(t)-7 b(yp)7 b(e)100 b(decla)-7 b(ration,)99
b(consisting)h(of)f(the)592 2497 y(k)-7 b(eyw)g(o)g(rd)83
b(\\)p Fg(as)p Fi(")h(and)e(a)h(sequence)g(t)-7 b(yp)7
b(e,)p Black Black 875 2757 a Fo(In)46 b(the)g Ff(for)p
Fo(-clause,)g(the)g(o)5 b(ccurrence)44 b(indicato)-5
b(rs)47 b Ff(?)p Fo(,)f Ff(+)p Fo(,)g Ff(*)g Fo(a)-5
b(re)46 b(not)g(relevant)875 2933 y(b)5 b(ecause)57 b(the)g(va)-5
b(riable)58 b(is)g(b)5 b(ound)57 b(to)h(single)f(sequence)f(elements.)p
Black 359 3244 a Fh(\005)p Black 128 w Fi(optionally)-21
b(,)75 b(a)h(p)7 b(ositional)74 b(va)-7 b(riable)76 b(decla)-7
b(ration,)75 b(con-)592 3530 y(sisting)c(of)h(the)f(k)-7
b(eyw)g(o)g(rd)72 b(\\)p Fg(at)p Fi(")g(and)g(a)g(va)-7
b(riable)72 b(name,)p Black 359 3841 a Fh(\005)p Black
128 w Fi(the)82 b(k)-7 b(eyw)g(o)g(rd)84 b(\\)p Fg(in)p
Fi(",)f(and)f(an)h(\\Exp)-7 b(rSingle".)p Black -283
4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 79 78 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-79)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
936 76 3471 4 v 936 480 4 405 v 1023 397 a Fd(let)p Fj(-Clause:)144
b(Details)p 4403 480 V 936 483 3471 4 v 4407 483 67 345
v 1003 550 3471 67 v Black 142 1065 a Fh(\017)p Black
83 w Fi(The)87 b Fg(let)p Fi(-clause)h(consists)f(of)g(a)h(comma-sepa)
-7 b(rated)86 b(list)324 1355 y(of)c(one)f(o)-7 b(r)81
b(mo)-7 b(re)82 b(va)-7 b(riable)81 b(decla)-7 b(rations)82
b(with)f(a)h(slightly)324 1646 y(di\013erent)c(syntax)f(than)h(under)g
Fg(for)h Fi(\(to)f(emphasize)g(that)324 1936 y(the)83
b(entire)f(sequence)h(is)g(b)7 b(ound)82 b(to)h(the)f(va)-7
b(riable\):)p Black 359 2251 a Fh(\005)p Black 128 w
Fi(Name)83 b(of)f(the)h(va)-7 b(riable)83 b(\(sta)-7
b(rting)82 b(with)g(\\)p Fg($)p Fi("\),)p Black 359 2566
a Fh(\005)p Black 128 w Fi(optionally)-21 b(,)100 b(a)f(t)-7
b(yp)7 b(e)100 b(decla)-7 b(ration,)99 b(consisting)h(of)f(the)592
2856 y(k)-7 b(eyw)g(o)g(rd)83 b(\\)p Fg(as)p Fi(")h(and)e(a)h(sequence)
g(t)-7 b(yp)7 b(e,)p Black 359 3172 a Fh(\005)p Black
128 w Fi(the)82 b(symb)7 b(ol)83 b(\\)p Fg(:=)p Fi(",)g(and)g(an)f
(\\Exp)-7 b(rSingle".)p Black 142 3537 a Fh(\017)p Black
83 w Fi(Of)63 b(course,)f(p)7 b(ositional)62 b(va)-7
b(riables)63 b(mak)-7 b(e)63 b(no)g(sense)f(in)h(the)324
3827 y Fg(let)p Fi(-clause)84 b(\(and)f(a)-7 b(re)83
b(therefo)-7 b(re)82 b(not)g(p)7 b(ermitted\).)p Black
-283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 80 79 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-80)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
906 52 3531 4 v 906 551 4 500 v 992 397 a Fj(Ordering)144
b(Mo)12 b(de)143 b(\(1\))p 4434 551 V 906 554 3531 4
v 4437 555 67 440 v 973 621 3531 67 v Black 142 1018
a Fh(\017)p Black 83 w Fi(The)89 b(o)-7 b(rdering)89
b(mo)7 b(de)89 b(has)h(an)f(imp)7 b(o)-7 b(rtant)88 b(in\015uence)i(on)
324 1307 y(the)83 b(semantics)f(of)h(X)-7 b(Query)83
b(exp)-7 b(ressions:)p Black 359 1621 a Fh(\005)p Black
128 w Fi(If)123 b(it)g(is)g Fg(ordered)p Fi(,)i(the)e(sequence)h(of)e
(va)-7 b(riable)124 b(assi-)592 1910 y(gnments)82 b(constructed)g(b)-7
b(y)83 b Fg(for)p Fi(/)p Fg(let)i Fi(is)d(as)h(ab)7 b(ove.)p
Black Black 875 2176 a Fo(I.e.)61 b(it)g(co)-5 b(rresp)5
b(onds)62 b(to)f(nested)f(lo)5 b(ops)62 b(in)f(the)g(o)-5
b(rder)62 b(o)-5 b(r)62 b(va)-5 b(riable)62 b(decla-)875
2353 y(rations,)d(and)f(resp)5 b(ects)56 b(the)h(do)5
b(cument)57 b(o)-5 b(rder.)p Black 359 2667 a Fh(\005)p
Black 128 w Fi(If)91 b(it)g(is)g(uno)-7 b(rdered,)91
b(the)f(implementation)h(has)g(mo)-7 b(re)592 2956 y(freedom)105
b(fo)-7 b(r)105 b(query)h(optimization:)e(Esp)7 b(ecially)-21
b(,)107 b(the)592 3246 y(sequence)k(of)f(va)-7 b(riable)111
b(assignments)f(generated)g(b)-7 b(y)592 3535 y Fg(for)60
b Fi(and)f Fg(let)h Fi(is)f(in)f(an)h(implementation-de\014ned)f(o)-7
b(rder)592 3824 y(\(unless)83 b(the)g Fg(order)107 b(by)83
b Fi(clause)g(is)g(used\).)p Black -283 4114 5977 9 v
-283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
%%Page: (80,81,82,83) 21
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 81 80 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-81)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
906 149 3531 4 v 906 648 4 500 v 992 494 a Fj(Ordering)144
b(Mo)12 b(de)143 b(\(2\))p 4434 648 V 906 651 3531 4
v 4437 651 67 440 v 973 718 3531 67 v Black 142 1162
a Fh(\017)p Black 83 w Fi(But)89 b(the)h(consequences)h(of)f(o)-7
b(rdering)89 b(mo)7 b(de)90 b Fg(unordered)324 1477 y
Fi(a)-7 b(re)83 b(even)g(mo)-7 b(re)83 b(drastic,)f(b)7
b(ecause)p Black 359 1818 a Fh(\005)p Black 128 w Fi(in)90
b(XP)-7 b(ath)89 b(exp)-7 b(ressions,)90 b(do)7 b(cument)90
b(o)-7 b(rder)89 b(do)7 b(es)90 b(not)592 2133 y(have)83
b(to)f(b)7 b(e)83 b(resp)7 b(ected,)p Black 359 2474
a Fh(\005)p Black 128 w Fi(thus)109 b(selecting)h(sp)7
b(eci\014c)110 b(p)7 b(ositions)109 b(b)7 b(ecomes)110
b(mo)-7 b(re)592 2789 y(o)g(r)82 b(less)h(meaningless)g
(\(nondeterministic\).)p Black 359 3130 a Fh(\005)p Black
128 w Fi(E.g.)f Fg(/a/b[1])i Fi(gives)e(any)g Fg(b)p
Fi(-child)g(of)f Fg(a)p Fi(,)h(not)f(necessa-)592 3445
y(rily)i(the)f(\014rst.)p Black Black 875 3752 a Fo(But)42
b Ff(/a/b[3])h Fo(is)g(non-empt)-5 b(y)42 b(only)f(if)h(there)g(a)-5
b(re)42 b(at)g(least)h(three)e Ff(b)p Fo(-children.)p
Black -283 4114 5977 9 v -283 4260 a(Stefan)56 b(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 82 81 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-82)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
906 52 3531 4 v 906 551 4 500 v 992 397 a Fj(Ordering)144
b(Mo)12 b(de)143 b(\(3\))p 4434 551 V 906 554 3531 4
v 4437 555 67 440 v 973 621 3531 67 v Black 142 1065
a Fh(\017)p Black 83 w Fi(Thus,)94 b(o)-7 b(rdering)93
b(mo)7 b(de)94 b Fg(unordered)k Fi(is)c(not)f(only)i(a)f(que-)324
1349 y(stion)88 b(of)f(the)g(output)g(sequence,)h(but)f(can)h(mo)7
b(dify)88 b(also)324 1632 y(the)83 b(selected)g(values.)p
Black Black 608 1901 a Fo(Actually)-14 b(,)62 b(that)h(is)g(not)g(so)g
(astonishing,)h(b)5 b(ecause)61 b(the)h(a)-5 b(rbitra)g(ry)65
b(nesting)e(of)608 2077 y(X)-5 b(Query)41 b(exp)-5 b(ressions)41
b(means)h(that)g(as)g(so)5 b(on)42 b(as)g(one)f(allo)-5
b(ws)42 b(a)g(di\013erent)g(result)608 2253 y(sequence)73
b(in)i(FL)-19 b(W)-5 b(OR-exp)g(ressions,)75 b(one)g(could)g(anyw)-5
b(a)g(y)75 b(get)g(an)g(entirely)608 2429 y(di\013erent)39
b(result)g(fo)-5 b(r)39 b(the)f(entire)h(query)-14 b(,)37
b(not)i(only)g(a)g(p)5 b(ermutation.)39 b(Everything)608
2606 y(in)50 b(X)-5 b(Query)50 b(is)g(a)h(sequence,)d(and)j(the)e
(exact)h(o)-5 b(rder)50 b(matters)h(in)f(many)g(places.)p
Black 142 2976 a Fh(\017)p Black 83 w Fi(When)82 b(one)g(uses)h(the)f
(XP)-7 b(ath)81 b(function)h Fg(unordered\(...\))324
3260 y Fi(only)74 b(at)e(this)h(single)g(p)7 b(oint)73
b(an)g(a)-7 b(rbitra)g(ry)72 b(p)7 b(ermutation)72 b(is)324
3543 y(allo)-7 b(w)g(ed)72 b(\(not)e(everywhere)h(inside)g(as)g(with)f
(the)g(o)-7 b(rdering)324 3827 y(mo)7 b(de\).)83 b(E.g.)g(p)7
b(ositions)82 b(inside)h(remain)f(meaningful.)p Black
-283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 83 82 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-83)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
906 52 3531 4 v 906 551 4 500 v 992 397 a Fj(Ordering)144
b(Mo)12 b(de)143 b(\(4\))p 4434 551 V 906 554 3531 4
v 4437 555 67 440 v 973 621 3531 67 v Black 142 1042
a Fh(\017)p Black 83 w Fi(Whether)113 b(the)g(nondeterminism)f(is)i
(bad,)f(dep)7 b(ends)114 b(on)324 1327 y(the)78 b(data)g(\(it)h(might)f
(have)g(b)7 b(een)79 b(b)7 b(etter)77 b(to)h(decla)-7
b(re)79 b(this)324 1612 y(in)k(the)f(schema)h(instead)g(of)f(in)h(the)f
(query\):)p Black 359 1922 a Fh(\005)p Black 128 w Fi(If,)104
b(e.g.,)g(the)g(data)g(a)-7 b(re)104 b(a)g(dump)g(from)g(a)g
(relational)592 2207 y(database,)82 b(the)h(o)-7 b(rder)82
b(of)g(the)h(ro)-7 b(ws)82 b(is)h(meaningless.)p Black
Black 875 2466 a Fo(It)55 b(only)g(o)5 b(ccurs)54 b(b)5
b(ecause)53 b(the)i(data)g(must)g(b)5 b(e)54 b(written)h(to)g(a)g
(\014le)f(in)h(some)875 2642 y(o)-5 b(rder.)45 b(The)f(p)-5
b(roblem)44 b(is)g(that)h(XML)d(p)5 b(ermits)44 b(to)g(use)g(this)g(o)
-5 b(rder)45 b(and)f(that)875 2819 y(XML)i(mak)-5 b(es)46
b(the)g(imp)-5 b(ression)47 b(that)g(the)e(o)-5 b(rder)47
b(might)g(mean)f(something.)p Black 359 3129 a Fh(\005)p
Black 128 w Fi(Then)103 b(nob)7 b(o)g(dy)103 b(w)-7 b(ould)104
b(use)g(p)7 b(ositions)103 b(in)h(the)f(query)592 3414
y(o)-7 b(r)82 b(other)g(constructs)g(that)g(dep)7 b(end)82
b(on)h(the)f(o)-7 b(rder.)p Black Black 875 3672 a Fo(And)55
b(one)g(do)5 b(es)54 b(not)h(w)-5 b(ant)56 b(to)f(pa)-5
b(y)55 b(a)g(p)-5 b(rice)55 b(fo)-5 b(r)55 b(getting)g(a)h(sp)5
b(eci\014c)53 b(o)-5 b(rder)875 3849 y(if)58 b(that)g(o)-5
b(rder)58 b(is)f(anyw)-5 b(a)g(y)58 b(irrelevant.)p Black
-283 4114 5977 9 v -283 4260 a(Stefan)e(Brass:)i(XML)f(und)g(Datenbank)
-5 b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 84 83 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-84)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
906 52 3531 4 v 906 551 4 500 v 992 397 a Fj(Ordering)144
b(Mo)12 b(de)143 b(\(5\))p 4434 551 V 906 554 3531 4
v 4437 555 67 440 v 973 621 3531 67 v Black 142 1042
a Fh(\017)p Black 83 w Fi(The)64 b(o)-7 b(rdering)64
b(mo)7 b(de)64 b(is)h(pa)-7 b(rt)63 b(of)h(the)g(static)g(context)g
(and)324 1318 y(b)7 b(e)83 b(set)f(in)h(the)f(p)-7 b(rolog,)83
b(e.g.)p Black Black 1626 1622 a Fg(declare)108 b(ordering)g(ordered)
324 1925 y Fi(and)83 b(lo)7 b(cally)83 b(inside)g(the)g(query)f(with)h
(the)f(exp)-7 b(ressions)p Black 359 2226 a Fh(\005)p
Black 128 w Fg(ordered)108 b({...})p Fi(,)84 b(and)p
Black Black 875 2472 a Fo(I.e.)57 b(fo)-5 b(r)58 b(evaluating)g(\\)p
Ff(...)p Fo(",)g(the)f(o)-5 b(rdering)58 b(mo)5 b(de)57
b(is)h(set)f(to)g(\\)p Ff(ordered)p Fo(".)p Black 359
2774 a Fh(\005)p Black 128 w Fg(unordered)109 b({...})p
Fi(.)p Black Black 875 3019 a Fo(Note)57 b(the)h(di\013erence)e(to)i
Ff(unordered\(...\))p Fo(,)i(the)d(XP)-5 b(ath)58 b(function.)p
Black 142 3370 a Fh(\017)p Black 83 w Fi(The)83 b(default)f(value)h(is)
g(implementation-de\014ned.)p Black Black 608 3628 a
Fo(This)i(seems)f(unfo)-5 b(rtunate,)86 b(b)5 b(ecause)84
b(it)h(immediately)g(causes)f(p)5 b(o)-5 b(rtabilit)g(y)608
3803 y(p)g(roblems:)58 b(The)f(o)-5 b(rdering)58 b(mo)5
b(de)57 b(is)h(imp)5 b(o)-5 b(rtant)59 b(fo)-5 b(r)57
b(nea)-5 b(rly)58 b(every)e(query)-14 b(.)p Black -283
4114 5977 9 v -283 4260 a(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
%%Page: (84,85,86,87) 22
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 85 84 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-85)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
906 52 3531 4 v 906 551 4 500 v 992 397 a Fj(Ordering)144
b(Mo)12 b(de)143 b(\(6\))p 4434 551 V 906 554 3531 4
v 4437 555 67 440 v 973 621 3531 67 v Black 142 1042
a Fh(\017)p Black 83 w Fi(E.g.)81 b(supp)7 b(ose)80 b(that)g(the)h
(homew)-7 b(o)g(rk)80 b(results)h(a)-7 b(re)80 b(sto)-7
b(red)324 1331 y(in)106 b(the)g(do)7 b(cument)105 b(in)h(o)-7
b(rder)105 b(of)g(submission)h(\(i.e.)g(new)324 1620
y(entries)83 b(a)-7 b(re)82 b(alw)-7 b(a)g(ys)84 b(app)7
b(ended)83 b(at)f(the)g(end\).)p Black 142 1984 a Fh(\017)p
Black 83 w Fi(If)95 b(one)g(w)-7 b(ants)95 b(to)g(p)-7
b(rint)94 b(all)i(student)e(names)h(in)g(the)g(se-)324
2273 y(quence)89 b(in)e(which)i(they)e(submitted)g(Homew)-7
b(o)g(rk)88 b(1,)g(this)324 2563 y(can)83 b(b)7 b(e)83
b(done)g(as)f(follo)-7 b(ws:)p Black Black 836 2842 a
Fg(ordered)108 b({)1257 3079 y(for)f($r)f(in)g(//RESULT,)j($s)d(in)g
(//STUDENT)1257 3316 y(where)i($r/CAT)f(=)f('H')g(and)h($r/ENO)g(=)f(1)
1890 3552 y(and)g($r/SID)i(=)d($s/SID)1257 3789 y(return)j($s/LAST)836
3978 y(})p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 86 85 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-86)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
870 185 3603 4 v 870 689 4 504 v 957 530 a Fd(order)182
b(by)143 b Fj(Clause)h(\(1\))p 4469 689 V 870 692 3603
4 v 4473 692 67 445 v 937 759 3603 67 v Black 142 1198
a Fh(\017)p Black 83 w Fi(With)107 b(the)h Fg(order)f(by)h
Fi(clause,)h(one)e(can)h(so)-7 b(rt)107 b(the)h(tuple)324
1513 y(stream)56 b(\(va)-7 b(riable)57 b(assignments\))f(generated)f(b)
-7 b(y)57 b Fg(for)p Fi(/)p Fg(let)p Fi(.)p Black Black
608 1833 a Fo(After)80 b(passing)i(the)f(\014lter)g(of)f(the)h
Ff(where)p Fo(-clause)g(and)h(b)5 b(efo)-5 b(re)80 b(the)g
Ff(return)p Fo(-)608 2016 y(clause)57 b(is)h(evaluated.)p
Black 142 2418 a Fh(\017)p Black 83 w Fi(This)97 b(is)g(done)g(b)-7
b(y)97 b(de\014ning)g(one)g(o)-7 b(r)97 b(mo)-7 b(re)96
b(exp)-7 b(ressions,)324 2734 y(the)83 b(values)g(of)f(which)h(a)-7
b(re)83 b(used)g(fo)-7 b(r)82 b(so)-7 b(rting,)82 b(e.g.)p
Black Black 414 3065 a Fg(for)107 b($s)f(in)g(//STUDENT,)j($r)d(in)g
(//RESULT[SID=$s/S)q(ID])414 3301 y(where)i($r/CAT)f(=)f('H')g(and)h
($r/ENO)g(=)f(1)414 3538 y(order)i(by)e($r/POINTS)414
3775 y(return)i($s/LAST)p Black -283 4114 5977 9 v -283
4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 87 86 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-87)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
870 52 3603 4 v 870 556 4 504 v 957 397 a Fd(order)182
b(by)143 b Fj(Clause)h(\(2\))p 4469 556 V 870 559 3603
4 v 4473 559 67 445 v 937 626 3603 67 v Black 142 1103
a Fh(\017)p Black 83 w Fi(Mo)-7 b(re)119 b(sp)7 b(eci\014cally)-21
b(,)119 b(the)f(exp)-7 b(ression\(s\))119 b(a)-7 b(re)118
b(evaluated)324 1383 y(fo)-7 b(r)121 b(each)g(va)-7 b(riable)121
b(assignment,)g(and)g(atomization)f(is)324 1663 y(applied.)p
Black Black 608 1926 a Fo(After)50 b(that,)i(each)e(exp)-5
b(ression)51 b(must)g(return)h(a)f(sequence)e(of)i(length)g
Fe(\024)40 b Fo(1)51 b(\(fo)-5 b(r)608 2102 y(a)42 b(given)g(va)-5
b(riable)43 b(assignment\),)f(i.e.)f(a)i(single)f(value)g(o)-5
b(r)42 b(the)g(empt)-5 b(y)42 b(sequence.)608 2277 y(Otherwise)57
b(\(longer)h(sequence\))d(a)j(t)-5 b(yp)5 b(e)57 b(erro)-5
b(r)58 b(o)5 b(ccurs.)p Black 142 2645 a Fh(\017)p Black
83 w Fi(V)-7 b(alues)76 b(of)f(t)-7 b(yp)7 b(e)76 b Fg(untypedAtomic)k
Fi(a)-7 b(re)76 b(treated)f(as)h Fg(string)p Fi(.)p Black
142 3000 a Fh(\017)p Black 83 w Fi(Then)g(the)f(values)i(of)f(each)g
(exp)-7 b(ression)76 b(\(fo)-7 b(r)76 b(all)g(va)-7 b(riable)324
3280 y(assignments\))60 b(must)g(b)7 b(e)59 b(compa)-7
b(rable:)60 b(The)g(compa)-7 b(rison)324 3560 y(is)92
b(done)f(with)g(the)f(op)7 b(erato)-7 b(r)91 b Fg(gt)g
Fi(of)g(the)g(least)g(common)324 3841 y(sup)7 b(ert)-7
b(yp)7 b(e)83 b(that)e(has)i(such)g(an)g(op)7 b(erato)-7
b(r.)p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 88 87 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-88)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
870 52 3603 4 v 870 556 4 504 v 957 397 a Fd(order)182
b(by)143 b Fj(Clause)h(\(3\))p 4469 556 V 870 559 3603
4 v 4473 559 67 445 v 937 626 3603 67 v Black 142 1065
a Fh(\017)p Black 83 w Fi(Supp)7 b(ose)91 b(that)g Fc(n)g
Fi(exp)-7 b(ressions)92 b(a)-7 b(re)91 b(used)h(as)g(so)-7
b(rt)90 b(crite-)324 1349 y(ria,)109 b(and)g(the)f(values)h(fo)-7
b(r)109 b(va)-7 b(riable)109 b(assignment)f Fh(A)i Fi(a)-7
b(re)324 1632 y(\()p Fc(x)539 1673 y Fb(1)647 1632 y
Fc(;)35 b(:)f(:)h(:)g(;)f(x)1234 1657 y Fa(n)1345 1632
y Fi(\),)81 b(and)h(fo)-7 b(r)80 b(va)-7 b(riable)82
b(assignment)f Fh(B)5 b Fi(,)82 b(the)f(va-)324 1915
y(lues)i(a)-7 b(re)83 b(\()p Fc(y)1377 1956 y Fb(1)1485
1915 y Fc(;)35 b(:)f(:)h(:)g(;)f(y)2057 1940 y Fa(n)2168
1915 y Fi(\).)p Black 142 2273 a Fh(\017)p Black 83 w
Fi(Then)88 b Fh(A)h Fi(comes)f(after)g Fh(B)93 b Fi(in)88
b(the)g(so)-7 b(rt)88 b(o)-7 b(rder)88 b(if)g(there)g(is)324
2557 y Fc(i)59 b Fh(2)g(f)p Fi(1)p Fc(;)35 b(:)f(:)h(:)g(;)f(n)p
Fh(g)83 b Fi(such)g(that:)p Black 359 2865 a Fh(\005)p
Black 128 w Fi(neither)f Fc(x)1489 2906 y Fa(j)1632 2865
y Fc(>)58 b(y)1958 2906 y Fa(j)2126 2865 y Fi(no)-7 b(r)82
b Fc(y)2636 2906 y Fa(j)2780 2865 y Fc(>)58 b(x)3121
2906 y Fa(j)3288 2865 y Fi(fo)-7 b(r)82 b Fc(j)70 b Fi(=)59
b(1)p Fc(;)34 b(:)h(:)g(:)f(;)h(i)47 b Fh(\000)f Fi(1,)p
Black 359 3173 a Fh(\005)p Black 128 w Fc(x)711 3214
y Fa(i)833 3173 y Fc(>)58 b(y)1159 3214 y Fa(i)1224 3173
y Fi(.)p Black Black 608 3441 a Fo(I.e.)64 b(the)g(result)i(of)e(the)h
(\014rst)g(exp)-5 b(ression)64 b(has)i(highest)f(p)-5
b(rio)g(rit)g(y)-14 b(,)66 b(the)e(second)608 3617 y(exp)-5
b(ression)45 b(decides)f(the)h(relative)g(o)-5 b(rder)46
b(of)f(t)-5 b(w)g(o)46 b(va)-5 b(riable)46 b(assignments)f(when)608
3794 y(the)54 b(values)f(of)h(the)g(\014rst)g(exp)-5
b(ression)54 b(a)-5 b(re)54 b(equal/uncompa)-5 b(rable,)55
b(and)g(so)f(on.)p Black -283 4114 5977 9 v -283 4260
a(Stefan)i(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725
b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p Black
eop end
PStoPSsaved restore
%%Page: (88,89,90,91) 23
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 89 88 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-89)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
870 116 3603 4 v 870 620 4 504 v 957 460 a Fd(order)182
b(by)143 b Fj(Clause)h(\(4\))p 4469 620 V 870 623 3603
4 v 4473 623 67 445 v 937 689 3603 67 v Black 142 1129
a Fh(\017)p Black 83 w Fi(F)-7 b(o)g(r)99 b(each)f(exp)-7
b(ression,)99 b(one)f(can)h(sp)7 b(ecify)98 b Fg(ascending)k
Fi(o)-7 b(r)324 1444 y Fg(descending)p Fi(:)p Black 359
1785 a Fh(\005)p Black 128 w Fg(ascending)79 b Fi(is)c(the)h(default:)e
(The)i(least)f(value)h(is)g(listed)592 2100 y(at)82 b(the)g(b)7
b(eginning,)83 b(the)f(greatest)g(at)g(the)h(end.)p Black
359 2440 a Fh(\005)p Black 128 w Fg(descending)100 b
Fi(selects)d(the)f(inverse)h(o)-7 b(rder:)96 b(The)h(maxi-)592
2756 y(mum)j(value)g(is)g(listed)g(\014rst,)f(and)h(then)f
(successively)592 3071 y(smaller)83 b(values,)g(until)f(the)g(minimum)g
(value.)p Black 142 3462 a Fh(\017)p Black 83 w Fi(The)100
b(abb)-7 b(reviations)100 b Fg(asc)h Fi(and)e Fg(desc)j
Fi(kno)-7 b(wn)100 b(from)f(SQL)324 3777 y(a)-7 b(re)83
b(not)f(supp)7 b(o)-7 b(rted)82 b(in)h(X)-7 b(Query)-21
b(.)p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 90 89 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-90)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
870 52 3603 4 v 870 556 4 504 v 957 397 a Fd(order)182
b(by)143 b Fj(Clause)h(\(5\))p 4469 556 V 870 559 3603
4 v 4473 559 67 445 v 937 626 3603 67 v Black 142 1065
a Fh(\017)p Black 83 w Fi(Another)122 b(di\013erence)g(to)g(SQL)h(is)f
(that)g(X)-7 b(Query)123 b(do)7 b(es)324 1344 y(not)71
b(require)g(that)f(the)h(values)h(used)f(fo)-7 b(r)71
b(so)-7 b(rting)70 b(a)-7 b(re)72 b(also)324 1623 y(p)-7
b(rinted.)p Black Black 608 1884 a Fo(Ho)i(w)g(ever,)52
b(mo)5 b(dern)53 b(SQL)f(DBMS)h(do)g(not)g(actually)h(have)e(this)i
(requirement.)p Black 142 2251 a Fh(\017)p Black 83 w
Fi(F)-7 b(o)g(r)83 b(each)g(column,)g(one)f(can)h(sp)7
b(ecify)p Black 359 2554 a Fh(\005)p Black 128 w Fg(empty)107
b(greatest)p Fi(:)61 b(The)c(empt)-7 b(y)57 b(sequence)i(is)e(listed)h
(last)592 2833 y(in)83 b(ascending)g(o)-7 b(rder)82 b(\(\014rst)g(in)h
(descending)g(o)-7 b(rder\).)p Black Black 875 3082 a
Fo(And)48 b(NaN)f(comes)f(immediately)h(b)5 b(efo)-5
b(re)46 b(the)h(empt)-5 b(y)46 b(sequence)f(in)j(ascen-)875
3258 y(ding)58 b(o)-5 b(rder)58 b(\(immediately)f(after)h(it)g(in)f
(descending)g(o)-5 b(rder\).)p Black 359 3562 a Fh(\005)p
Black 128 w Fg(empty)107 b(least)p Fi(:)83 b(The)e(empt)-7
b(y)82 b(sequence)g(comes)f(\014rst)g(in)592 3841 y(ascending)i(o)-7
b(rder,)82 b(last)g(in)h(descending)g(o)-7 b(rder.)p
Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)
g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 91 90 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-91)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
870 52 3603 4 v 870 556 4 504 v 957 397 a Fd(order)182
b(by)143 b Fj(Clause)h(\(6\))p 4469 556 V 870 559 3603
4 v 4473 559 67 445 v 937 626 3603 67 v Black 142 1065
a Fh(\017)p Black 83 w Fi(Thus,)119 b(the)g Fg(order)107
b(by)120 b Fi(clause)g(consists)f(of)g(a)g(comma-)324
1361 y(sepa)-7 b(rated)97 b(list)h(of)f(one)g(o)-7 b(r)97
b(mo)-7 b(re)97 b(\\o)-7 b(rder)97 b(sp)7 b(ecs",)97
b(each)324 1657 y(of)83 b(which)g(consists)f(of)p Black
359 1977 a Fh(\005)p Black 128 w Fi(an)h(\\Exp)-7 b(rSingle")82
b(\(values)i(used)f(fo)-7 b(r)82 b(so)-7 b(rting\),)p
Black 359 2298 a Fh(\005)p Black 128 w Fi(optionally)-21
b(,)109 b(one)g(of)g(the)f(k)-7 b(eyw)g(o)g(rds)110 b(\\)p
Fg(ascending)p Fi(")i(o)-7 b(r)592 2594 y(\\)p Fg(descending)p
Fi(",)p Black 359 2915 a Fh(\005)p Black 128 w Fi(optionally)-21
b(,)97 b(one)h(of)f(the)f(phrases)i(\\)p Fg(empty)107
b(greatest)p Fi(")592 3210 y(o)-7 b(r)82 b(\\)p Fg(empty)107
b(least)p Fi(",)p Black 359 3531 a Fh(\005)p Black 128
w Fi(optionally)-21 b(,)86 b(the)f(k)-7 b(eyw)g(o)g(rd)87
b(\\)p Fg(collation)p Fi(")i(and)c(an)h(URI)592 3827
y(literal)c(\(this)h(de\014nes)g(the)f(so)-7 b(rt)82
b(o)-7 b(rder)82 b(fo)-7 b(r)82 b(strings\).)p Black
-283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 92 91 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-92)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
870 225 3603 4 v 870 729 4 504 v 957 570 a Fd(order)182
b(by)143 b Fj(Clause)h(\(7\))p 4469 729 V 870 732 3603
4 v 4473 733 67 445 v 937 799 3603 67 v Black 142 1309
a Fh(\017)p Black 83 w Fi(Finally)-21 b(,)106 b(instead)g(of)f(\\)p
Fg(order)i(by)p Fi(",)f(one)f(can)h(also)f(write)324
1625 y(\\)p Fg(stable)j(order)f(by)p Fi(".)p Black 142
2015 a Fh(\017)p Black 83 w Fi(This)62 b(means)h(that)e(if)h(the)g(so)
-7 b(rt)62 b(criteria)f(give)i(no)f(decision,)324 2331
y(the)79 b(o)-7 b(riginal)79 b(o)-7 b(rder)78 b(of)g(the)h(va)-7
b(riable)79 b(assignments)f(must)324 2646 y(b)7 b(e)80
b(k)-7 b(ept)79 b(\(derived)h(from)f(the)g(do)7 b(cument)79
b(o)-7 b(rder)79 b(and)g(the)324 2962 y(sequence/nesting)k(of)g
Fg(for)p Fi(-lo)7 b(ops\).)p Black 142 3352 a Fh(\017)p
Black 83 w Fi(Of)65 b(course,)f(if)g(an)h Fg(order)107
b(by)65 b Fi(clause)g(is)g(sp)7 b(eci\014ed,)64 b(this)g(ta-)324
3667 y(k)-7 b(es)56 b(p)-7 b(recedence)56 b(over)f(the)g(o)-7
b(rdering)55 b(mo)7 b(de)55 b(\\)p Fg(unordered)p Fi(")-17
b(.)p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
%%Page: (92,93,94,95) 24
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 93 92 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-93)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
870 52 3603 4 v 870 556 4 504 v 957 397 a Fd(order)182
b(by)143 b Fj(Clause)h(\(8\))p 4469 556 V 870 559 3603
4 v 4473 559 67 445 v 937 626 3603 67 v Black 142 1065
a Fh(\017)p Black 83 w Fi(Strings)55 b(a)-7 b(re)56 b(so)-7
b(rted)56 b(di\013erently)f(from)h(numb)7 b(ers,)55 b(e.g.)h(the)324
1346 y(string)82 b Fg("12")i Fi(comes)f(b)7 b(efo)-7
b(re)83 b(the)f(string)g Fg("9")p Fi(.)p Black Black
608 1609 a Fo(Already)57 b(the)g(\014rst)h(cha)-5 b(racter)58
b(is)g(di\013erent)g(and)f(decides)g(the)g(so)-5 b(rt)58
b(o)-5 b(rder.)p Black 142 1977 a Fh(\017)p Black 83
w Fi(If)132 b(one)f(uses)h(a)g(do)7 b(cument)131 b(without)g(schema,)g
(o)-7 b(r)132 b(an)324 2257 y(X)-7 b(Query)74 b(system)f(without)g
(validation,)g(the)h(t)-7 b(yp)7 b(e)73 b(of)g(\(at-)324
2538 y(tribute)82 b(o)-7 b(r)82 b(element\))h(values)h(is)e
Fg(untypedAtomic)p Fi(.)p Black 142 2893 a Fh(\017)p
Black 83 w Fi(This)h(is)f(converted)h(to)f Fg(string)j
Fi(fo)-7 b(r)82 b(compa)-7 b(rison.)p Black 142 3248
a Fh(\017)p Black 83 w Fi(Thus,)69 b(\\)p Fg(order)108
b(by)e($r/POINTS)p Fi(")73 b(will)d(not)f(w)-7 b(o)g(rk.)70
b(One)h(has)324 3528 y(to)83 b(write)131 b(\\)p Fg(order)108
b(by)e(number\($r/POINTS\))p Fi(".)p Black Black 608
3792 a Fo(Alternative:)57 b Ff(xs:integer\(...\))p Fo(.)p
Black -283 4114 5977 9 v -283 4260 a(Stefan)f(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 94 93 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-94)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1777 154 1789 4 v 1777 558 4 405 v 1864 475 a Fj(Overview)p
3563 558 V 1777 561 1789 4 v 3566 561 67 345 v 1844 628
1789 67 v Black Black 690 1343 a Fi(1.)83 b(Intro)7 b(duction)690
1887 y(2.)83 b(Basic)f(Syntax,)h(Constructo)-7 b(rs)690
2445 y(3.)83 b(FLO)-7 b(WR-Exp)g(ressions)690 3002 y(4.)83
b(Examples,)g(Compa)-7 b(rison)83 b(with)f
0 setlinecap
(SQL)2705 2947
y
save /setgray { pop } def
2705 2947 a @beginspecial @setspecial
0.99626401 0.99626401 scale 0.79999 setlinewidth 261.2973 0 moveto
261.2973 9.86255 lineto 0 11.04584 -8.95416 20 -20 20 rcurveto 0 29.86255
lineto -241.2973 29.86255 lineto -11.04584 0 -20 -8.95416 -20 -20 rcurveto
-261.2973 0 lineto -261.2973 -9.86255 lineto 0 -11.04584 8.95416 -20
20 -20 rcurveto 0 -29.86255 lineto 241.2973 -29.86255 lineto 11.04584
0 20 8.95416 20 20 rcurveto 261.2973 0 lineto stroke
@endspecial
2705 2947 a
restore
2705 2947 a 690 3560 a Fi(5.)h(Prolog,)f(F)-7
b(unctions)p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 95 94 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-95)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
509 65 4326 4 v 509 564 4 500 v 595 410 a Fj(Example)144
b(Do)12 b(cument)144 b(\(1\))p 4831 564 V 509 567 4326
4 v 4834 568 67 440 v 575 634 4326 67 v Black Black -46
923 2985 5 v -49 1173 5 250 v 1024 1103 a Fg(STUDENTS)p
2934 1173 V -46 1178 2985 5 v -46 1203 V -49 1453 5 250
v Black 37 1382 a(SID)p Black 37 1405 317 6 v 433 1453
5 250 v 167 w(FIRST)p 1337 1453 V 379 w(LAST)p 2135 1453
V 431 w(EMAIL)p 2934 1453 V -46 1458 2985 5 v -49 1708
5 250 v 37 1637 a(101)p 433 1708 V 167 w(Ann)p 1337 1708
V 589 w(Smith)p 2135 1708 V 466 w Fh(\001)35 b(\001)f(\001)p
2934 1708 V -49 1928 5 237 v 37 1857 a Fg(102)p 433 1928
V 167 w(Michael)p 1337 1928 V 169 w(Jones)p 2135 1928
V 273 w(\(null\))p 2934 1928 V -49 2148 V 37 2077 a(103)p
433 2148 V 167 w(Richard)p 1337 2148 V 169 w(Turner)p
2135 2148 V 361 w Fh(\001)h(\001)f(\001)p 2934 2148 V
-49 2368 V 37 2297 a Fg(104)p 433 2368 V 167 w(Maria)p
1337 2368 V 379 w(Brown)p 2135 2368 V 466 w Fh(\001)h(\001)f(\001)p
2934 2368 V -46 2373 2985 5 v -46 2634 V -49 2884 5 250
v 971 2813 a Fg(EXERCISES)p 2934 2884 V -46 2889 2985
5 v -46 2914 V -49 3163 5 250 v Black 37 3093 a(CAT)p
Black 37 3116 317 6 v 433 3163 5 250 v Black 167 w(ENO)p
Black 519 3116 317 6 v 916 3163 5 250 v 167 w(TOPIC)p
2241 3163 V 800 w(MAXPT)p 2934 3163 V -46 3168 2985 5
v -49 3418 5 250 v 37 3348 a(H)p 433 3418 V 588 w(1)p
916 3418 V 166 w(Rel.)107 b(Algeb.)p 2241 3418 V 484
w(10)p 2934 3418 V -49 3638 5 237 v 37 3568 a(H)p 433
3638 V 588 w(2)p 916 3638 V 166 w(SQL)p 2241 3638 V 1326
w(10)p 2934 3638 V -49 3858 V 37 3788 a(M)p 433 3858
V 588 w(1)p 916 3858 V 166 w(SQL)p 2241 3858 V 1326 w(14)p
2934 3858 V -46 3863 2985 5 v 3208 923 2248 5 v 3206
1173 5 250 v 3962 1103 a(RESULTS)p 5451 1173 V 3208 1178
2248 5 v 3208 1203 V 3206 1453 5 250 v Black 3291 1382
a(SID)p Black 3291 1405 317 6 v 3688 1453 5 250 v Black
168 w(CAT)p Black 3774 1405 317 6 v 4170 1453 5 250 v
Black 167 w(ENO)p Black 4256 1405 317 6 v 4652 1453 5
250 v 167 w(POINTS)p 5451 1453 V 3208 1458 2248 5 v 3206
1708 5 250 v 3291 1637 a(101)p 3688 1708 V 168 w(H)p
4170 1708 V 587 w(1)p 4652 1708 V 588 w(10)p 5451 1708
V 3206 1928 5 237 v 3291 1857 a(101)p 3688 1928 V 168
w(H)p 4170 1928 V 587 w(2)p 4652 1928 V 694 w(8)p 5451
1928 V 3206 2148 V 3291 2077 a(101)p 3688 2148 V 168
w(M)p 4170 2148 V 587 w(1)p 4652 2148 V 588 w(12)p 5451
2148 V 3206 2368 V 3291 2297 a(102)p 3688 2368 V 168
w(H)p 4170 2368 V 587 w(1)p 4652 2368 V 694 w(9)p 5451
2368 V 3206 2588 V 3291 2517 a(102)p 3688 2588 V 168
w(H)p 4170 2588 V 587 w(2)p 4652 2588 V 694 w(9)p 5451
2588 V 3206 2808 V 3291 2737 a(102)p 3688 2808 V 168
w(M)p 4170 2808 V 587 w(1)p 4652 2808 V 588 w(10)p 5451
2808 V 3206 3028 V 3291 2957 a(103)p 3688 3028 V 168
w(H)p 4170 3028 V 587 w(1)p 4652 3028 V 694 w(5)p 5451
3028 V 3206 3248 V 3291 3177 a(103)p 3688 3248 V 168
w(M)p 4170 3248 V 587 w(1)p 4652 3248 V 694 w(7)p 5451
3248 V 3208 3253 2248 5 v Black -283 4114 5977 9 v -283
4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 96 95 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-96)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
509 61 4326 4 v 509 560 4 500 v 595 406 a Fj(Example)144
b(Do)12 b(cument)144 b(\(2\))p 4831 560 V 509 563 4326
4 v 4834 564 67 440 v 575 630 4326 67 v Black 142 1041
a Fh(\017)p Black 83 w Fi(V)-7 b(ersion)57 b(1)g(\(data)g(in)f
(elements,)h(structured)f(b)-7 b(y)57 b(relation\):)p
Black Black 625 1385 a Fg()625 1622 y()836
1859 y()1047 2095 y()1257 2332 y(101)1257
2569 y(Ann)1257 2805 y(Smith)1047
3042 y()1047 3262 y(...)836 3498 y()836
3718 y(...)625 3955 y()p Black -283 4114
5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
%%Page: (96,97,98,99) 25
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 97 96 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-97)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1051 52 3241 4 v 1051 551 4 500 v 1138 397 a Fj(Simple)144
b(Query)f(\(1\))p 4288 551 V 1051 554 3241 4 v 4292 555
67 440 v 1118 621 3241 67 v Black 142 1018 a Fh(\017)p
Black 83 w Fi(Print)82 b(all)h(homew)-7 b(o)g(rk)82 b(results)g(of)h
(student)f(101:)p Black Black 528 1341 a Fg(SELECT)107
b(ENO,)g(POINTS)528 1578 y(FROM)317 b(RESULTS)528 1814
y(WHERE)212 b(CAT)107 b(=)f('H')g(AND)h(SID)f(=)g(101)p
3970 1160 1283 5 v 3968 1397 5 237 v 4053 1326 a(ENO)p
4450 1397 V 168 w(POINTS)p 5248 1397 V 3970 1402 1283
5 v 3970 1427 V 3968 1663 5 237 v 4264 1593 a(1)p 4450
1663 V 588 w(10)p 5248 1663 V 3968 1900 V 4264 1829 a(2)p
4450 1900 V 693 w(8)p 5248 1900 V 3970 1905 1283 5 v
Black 142 2134 a Fh(\017)p Black 83 w Fi(Solution)82
b(1)h(in)f(X)-7 b(Query:)p Black Black 836 2465 a Fg({)1257
2701 y(for)107 b($r)f(in)g(/GRADES-DB/RESULTS)q(/RE)q(SU)q(LT)1257
2938 y(where)i($r/CAT)f(=)f('H')g(and)h($r/SID)g(=)f(101)1257
3175 y(return)i({$r/ENO,)i($r/POINTS})836 3411
y(})p Black Black 608 3699 a Fo(Whereas)70
b(the)h(result)h(table)f(structure)g(in)h(SQL)e(is)h(\014xed,)f(there)g
(a)-5 b(re)72 b(many)608 3874 y(w)-5 b(a)g(ys)57 b(to)h(structure)g
(the)f(output)h(in)g(XML.)e(The)h(query)g(has)h(to)g(sp)5
b(ecify)55 b(this.)p Black -283 4114 5977 9 v -283 4260
a(Stefan)h(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725
b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p Black
eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 98 97 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-98)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1051 52 3241 4 v 1051 551 4 500 v 1138 397 a Fj(Simple)144
b(Query)f(\(2\))p 4288 551 V 1051 554 3241 4 v 4292 555
67 440 v 1118 621 3241 67 v Black 142 1018 a Fh(\017)p
Black 83 w Fi(Result:)p Black Black 1468 1250 a Fg()1890
1470 y()2311 1674 y(1)2311 1894 y(10)1890 2114 y()1890 2334 y()2311 2537 y(2)2311
2757 y(8)1890 2977 y()1468 3197
y()p Black Black 608 3507 a Fo(Of)84 b(course,)h(the)f(line)
h(b)-5 b(reaks)86 b(and)f(indentation)h(dep)5 b(end)84
b(on)h(the)g(output)608 3685 y(serialization.)47 b(This)f(is)g(the)f
(result)h(of)f(BaseX.)f(AltovaXML)h(b)-5 b(y)45 b(default)h(writes)608
3862 y(everything)53 b(in)h(one)f(line,)h(but)g Ff(/oi)73
b(yes)54 b Fo(\(\\outputindent"\))h(gives)e(the)h(ab)5
b(ove.)p Black -283 4114 5977 9 v -283 4260 a(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 99 98 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4933 b(7-99)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1051 52 3241 4 v 1051 551 4 500 v 1138 397 a Fj(Simple)144
b(Query)f(\(3\))p 4288 551 V 1051 554 3241 4 v 4292 555
67 440 v 1118 621 3241 67 v Black 142 1055 a Fh(\017)p
Black 83 w Fi(Solution)107 b(2)g(\(p)-7 b(redicate)108
b(under)f Fg(for)i Fi(instead)e(of)g Fg(where)p Fi(-)324
1342 y(clause,)83 b(requires)g(few)-7 b(er)83 b(va)-7
b(riable)83 b(references\):)p Black Black 414 1663 a
Fg({)836 1900 y(for)106 b($r)g(in)h(//RESULT[CAT)i(=)d('H')h
(and)f(SID)h(=)e(101])836 2136 y(return)i({$r/ENO,)j
($r/POINTS})414 2373 y(})p Black 142
2758 a Fh(\017)p Black 83 w Fi(Solution)82 b(3)h(\(with)g(context)f
(instead)g(of)h(va)-7 b(riable\):)p Black Black 889 3079
a Fg({)1310 3316 y(//RESULT[CAT)110 b(=)c('H')g(and)g(SID)h
(=)f(101]/)1731 3553 y({ENO,)j(POINTS})889 3789
y(})p Black -283 4114 5977 9 v -283 4260 a
Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725
b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p Black
eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 100 99 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-100)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1051 52 3241 4 v 1051 551 4 500 v 1138 397 a Fj(Simple)144
b(Query)f(\(4\))p 4288 551 V 1051 554 3241 4 v 4292 555
67 440 v 1118 621 3241 67 v Black 142 1042 a Fh(\017)p
Black 83 w Fi(The)91 b(last)g(example)g(sho)-7 b(ws)91
b(that)f(the)h(use)g(of)g(construc-)324 1318 y(to)-7
b(rs)74 b(is)h(not)f(limited)h(to)f(the)g Fg(return)p
Fi(-clause)j(of)e(FL)-28 b(W)-7 b(OR-)324 1594 y(exp)g(ressions.)p
Black 142 1945 a Fh(\017)p Black 83 w Fi(In)73 b(the)e(gramma)-7
b(r,)71 b(constructo)-7 b(rs)71 b(a)-7 b(re)72 b(\\Prima)-7
b(ry)72 b(Exp)-7 b(res-)324 2221 y(sions",)74 b(i.e.)g(on)f(the)g(same)
h(level)h(as)e(datat)-7 b(yp)7 b(e)74 b(literals)f(o)-7
b(r)324 2498 y(va)g(riable)83 b(references.)p Black Black
608 2783 a
SDict begin H.S end
608 2783 a Black -29 x Fo([https://www.w3.o)-5
b(rg/TR/xquery/#nt-bnf)12 b(])p Black 3692 2649 a
SDict begin H.R end
3692
2649 a 3692 2754 a
SDict begin [/H /I/Border [0 0 1]BorderArrayPatch/Color [0 1 1]/Action
<>/Subtype
/Link H.B /ANN pdfmark end
3692 2754 a 608 2929 a Fo(As)63 b(in)h(XP)-5
b(ath,)65 b(a)f(\\StepExp)-5 b(r")63 b(in)h(a)g(path)h(exp)-5
b(ression)63 b(can)h(not)g(only)f(b)5 b(e)63 b(an)608
3104 y(\\AxisStep",)51 b(but)h(also)g(a)g(\\FilterExp)-5
b(r",)54 b(which)d(is)h(a)g(\\Prima)-5 b(ryExp)g(r")54
b(optio-)608 3279 y(nally)c(follo)-5 b(w)g(ed)50 b(b)-5
b(y)50 b(p)-5 b(redicates.)49 b(This)i(again)g(sho)-5
b(ws)49 b(why)h(the)f(gramma)-5 b(r)51 b(rules)608 3454
y(of)63 b(XP)-5 b(ath)64 b(had)g(to)g(b)5 b(e)62 b(rep)5
b(eated)63 b(in)h(the)f(X)-5 b(Query)63 b(gramma)-5 b(r:)65
b(Constructo)-5 b(rs)608 3628 y(in)58 b(p)-5 b(rima)g(ry)59
b(exp)-5 b(ressions)58 b(a)-5 b(re)59 b(new)e(in)h(X)-5
b(Query)-14 b(,)57 b(but)i(this)f(has)h(consequences)608
3803 y(fo)-5 b(r)58 b(standa)-5 b(rd)59 b(path)f(exp)-5
b(ressions.)p Black -283 4114 5977 9 v -283 4260 a(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
%%Page: (100,101,102,103) 26
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 101 100 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-101)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
-47 52 5438 4 v -47 551 4 500 v 39 397 a Fj(Problem)127
b(with)f(Namespaces)j(\(1\))p 5387 551 V -47 554 5438
4 v 5390 555 67 440 v 19 621 5438 67 v Black 142 1042
a Fh(\017)p Black 83 w Fi(Input)83 b(do)7 b(cument)82
b(with)g(link)h(to)f(XML)i(Schema:)p Black Black 414
1349 a Fg()p Black 142 2122 a Fh(\017)p Black 83 w Fi(The)84
b(namespace)g(de\014nition)g(fo)-7 b(r)83 b Fg(xsi)i
Fi(implicitly)f(applies)324 2399 y(to)f(all)f(element)h(no)7
b(des)83 b(of)f(the)g(input)h(do)7 b(cument.)p Black
142 2752 a Fh(\017)p Black 83 w Fi(Since)123 b(the)g
Fg(ENO)h Fi(and)f Fg(POINTS)p Fi(-no)7 b(des)124 b(a)-7
b(re)123 b(copied)h(from)324 3030 y(the)e(input)g(do)7
b(cument,)121 b(each)h(such)h(no)7 b(de)122 b(sho)-7
b(ws)122 b(this)324 3307 y(namespace)84 b(explicitly)f(in)g(the)f
(output,)f(e.g.)p Black Black 1099 3586 a Fg(1<)q(ENO)q(>)1099 3822 y(10)q()p Black -283 4114
5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 102 101 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-102)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
-47 52 5438 4 v -47 551 4 500 v 39 397 a Fj(Problem)127
b(with)f(Namespaces)j(\(2\))p 5387 551 V -47 554 5438
4 v 5390 555 67 440 v 19 621 5438 67 v Black 142 1018
a Fh(\017)p Black 83 w Fi(It)83 b(should)f(b)7 b(e)83
b(p)7 b(ossible)83 b(to)f(avoid)h(this)f(as)h(follo)-7
b(ws:)p Black Black 362 1302 a Fg(declare)108 b(copy-namespaces)j
(no-preserve,)e(no-inherit;)362 1538 y({)783
1767 y(for)e($r)f(in)g(//RESULT[CAT)k(=)105 b('H')i(and)f(SID)h(=)f
(101])783 1995 y(return)i({$r/ENO,)i($r/POINTS})362
2223 y(})p Black Black 608 2517 a Ff(inherit)60
b Fo(o)-5 b(r)60 b Ff(no-inherit)h Fo(is)f(actually)g(not)f(imp)5
b(o)-5 b(rtant)61 b(fo)-5 b(r)60 b(this)f(task,)h(but)g(the)608
2693 y(syntax)i(fo)-5 b(rces)63 b(one)f(to)h(sp)5 b(ecify)62
b(it)h(together)g(with)g Ff(no-preserve)p Fo(.)i(The)e(stan-)608
2868 y(da)-5 b(rd)77 b(sa)-5 b(ys:)75 b(\\If)h Ff(copy-namespaces)i
Fo(mo)5 b(de)75 b(sp)5 b(eci\014es)74 b Ff(no-preserve)p
Fo(,)k(the)d(new)608 3044 y(cop)-5 b(y)62 b(retains)i(only)f(those)g
(in-scop)5 b(e)63 b(namespaces)g(of)g(the)g(o)-5 b(riginal)65
b(element)608 3219 y(that)58 b(a)-5 b(re)58 b(used)f(in)h(the)f(names)g
(of)g(the)g(element)g(and)g(its)h(attributes.")p Black
142 3586 a Fh(\017)p Black 83 w Fi(But)78 b(neither)g(BaseX)g(no)-7
b(r)79 b(AltovaXML)g(remove)g(the)f(na-)324 3865 y(mespace)83
b(decla)-7 b(rations.)p Black -283 4114 5977 9 v -283
4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 103 102 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-103)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
-47 52 5438 4 v -47 551 4 500 v 39 397 a Fj(Problem)127
b(with)f(Namespaces)j(\(3\))p 5387 551 V -47 554 5438
4 v 5390 555 67 440 v 19 621 5438 67 v Black 142 1112
a Fh(\017)p Black 83 w Fi(If)63 b(one)g(sp)7 b(eci\014es)63
b(this)g(namespace)g(in)g(the)g(outer)f(element)324 1406
y(of)94 b(the)g(query)-21 b(,)94 b(the)f(output)g(serialization)h(do)7
b(es)94 b(not)f(re-)324 1700 y(p)7 b(eat)83 b(it)f(in)h(each)g(copied)g
(element:)p Black Black 414 2007 a Fg({)836 2481 y(for)d($r)g(in)h(//RESULT[CAT)i(=)d('H')h(and)f
(SID)h(=)e(101])836 2717 y(return)i({$r/ENO,)j($r/POINTS})414
2954 y(})p Black Black 608 3268 a Fo(No)-5
b(w)50 b(the)h(namespace)e(is)i(decla)-5 b(red)50 b(fo)-5
b(r)51 b(all)g(no)5 b(des)50 b(in)h(the)f(output)i(do)5
b(cument,)608 3447 y(so)79 b(when)g(the)g(no)5 b(des)79
b(from)g(the)g(input)h(do)5 b(cument)78 b(a)-5 b(re)80
b(copied,)f(they)f(a)-5 b(re)608 3625 y(in)81 b(scop)5
b(e)80 b(of)g(the)h(namespace)f(decla)-5 b(ration,)82
b(and)f(it)g(is)g(not)h(necessa)-5 b(ry)79 b(to)608 3803
y(explicitly)57 b(rep)5 b(eat)57 b(the)g(inherited)h(decla)-5
b(ration.)p Black -283 4114 5977 9 v -283 4260 a(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 104 103 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-104)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
-47 52 5438 4 v -47 551 4 500 v 39 397 a Fj(Problem)127
b(with)f(Namespaces)j(\(4\))p 5387 551 V -47 554 5438
4 v 5390 555 67 440 v 19 621 5438 67 v Black 142 1018
a Fh(\017)p Black 83 w Fi(A)82 b(solution)f(is)h(to)f(construct)g(new)h
(element)g(no)7 b(des)82 b(with)324 1296 y(the)h(same)f(name)h(and)g
(the)f(same)h(contents:)p Black Black 414 1575 a Fg({)836
1812 y(for)106 b($r)g(in)h(//RESULT[CAT)i(=)d('H')h(and)f(SID)h(=)e
(101])836 2049 y(return)1257 2285 y()1679 2522 y
({data\($r/ENO\)})q()q(ENO)q(>)1679 2758 y({data\($r/PO)
q(IN)q(TS\))q(})q(PO)q(INT)q(S>)1257 2995 y()414
3232 y(})p Black Black 608 3524 a Fo(With)72
b(the)h(same)f(query)g(structure,)g(one)g(could)h(also)g(generate)e(an)
i(HTML)608 3699 y(table:)81 b(Replace)h Ff(STUD_101)g
Fo(b)5 b(ei)81 b Ff(table)p Fo(,)i Ff(HW)e Fo(b)-5 b(y)82
b Ff(tr)p Fo(,)f(and)h(the)f(new)g Ff(ENO)h Fo(and)608
3874 y Ff(POINTS)58 b Fo(tags)g(b)-5 b(y)57 b Ff(td)p
Fo(.)h(One)f(could)g(even)f(add)i(a)g(headline.)p Black
-283 4114 5977 9 v -283 4260 a(Stefan)e(Brass:)i(XML)f(und)g(Datenbank)
-5 b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
%%Page: (104,105,106,107) 27
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 105 104 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-105)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1797 128 1749 4 v 1797 627 4 500 v 1884 472 a Fj(Joins)143
b(\(1\))p 3542 627 V 1797 630 1749 4 v 3546 630 67 440
v 1864 697 1749 67 v Black 142 1212 a Fh(\017)p Black
83 w Fi(\\Print)77 b(the)i(names)f(of)h(all)f(students)g(who)h(have)g
(at)f(least)324 1527 y(9)83 b(p)7 b(oints)82 b(in)g(b)7
b(oth,)81 b(Homew)-7 b(o)g(rk)83 b(1)f(and)h(Homew)-7
b(o)g(rk)83 b(2":)p Black Black 730 1858 a Fg(SELECT)108
b(S.FIRST,)g(S.LAST)730 2095 y(FROM)318 b(STUDENTS)108
b(S,)e(RESULTS)i(H1,)f(RESULTS)h(H2)730 2331 y(WHERE)213
b(S.SID)107 b(=)f(H1.SID)i(AND)e(S.SID)h(=)f(H2.SID)730
2568 y(AND)423 b(H1.CAT)108 b(=)d('H')i(AND)f(H1.ENO)i(=)e(1)730
2804 y(AND)423 b(H2.CAT)108 b(=)d('H')i(AND)f(H2.ENO)i(=)e(2)730
3041 y(AND)423 b(H2.POINTS)109 b(>=)d(9)g(AND)g(H2.POINTS)j(>=)d(9)p
2091 3276 1600 5 v 2089 3513 5 237 v 2174 3442 a(FIRST)p
2992 3513 V 379 w(LAST)p 3685 3513 V 2091 3518 1600 5
v 2091 3543 V 2089 3779 5 237 v 2174 3709 a(Michael)p
2992 3779 V 169 w(Jones)p 3685 3779 V 2091 3784 1600
5 v Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 106 105 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-106)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1797 52 1749 4 v 1797 551 4 500 v 1884 397 a Fj(Joins)143
b(\(2\))p 3542 551 V 1797 554 1749 4 v 3546 555 67 440
v 1864 621 1749 67 v Black 142 921 a Fh(\017)p Black
83 w Fi(X)-7 b(Query:)p Black Black 625 1229 a Fg({)625
1465 y(for)317 b($s)212 b(in)106 b(//STUDENT,)1257 1702
y($h1)h(in)f(//RESULT,)j($h2)d(in)g(//RESULT)625 1938
y(where)h($s/SID)h(=)e($h1/SID)i(and)e($s/SID)i(=)d($h2/SID)625
2175 y(and)317 b($h1/CAT)108 b(=)e('H')g(and)h($h1/ENO)h(=)e(1)625
2412 y(and)317 b($h2/CAT)108 b(=)e('H')g(and)h($h2/ENO)h(=)e(2)625
2648 y(and)317 b($h1/POINTS)109 b(>=)d(9)g(and)h($h2/POINTS)i(>=)d(9)
625 2885 y(return)i(
)625 3358
y(})p Black Black 608 3671 a Ff(Query)74 b(Result:)g()
1925 3830 y(
)1632
3988 y()p Black -283 4114 5977 9 v -283 4260
a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725
b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p Black
eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 107 106 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-107)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1797 205 1749 4 v 1797 705 4 500 v 1884 550 a Fj(Joins)143
b(\(3\))p 3542 705 V 1797 708 1749 4 v 3546 708 67 440
v 1864 774 1749 67 v Black 142 1195 a Fh(\017)p Black
83 w Fi(One)80 b(can)f(move)h(pa)-7 b(rts)78 b(of)h(the)g(condition)g
(to)g(p)-7 b(redicates)324 1510 y(in)83 b(the)f Fg(for)p
Fi(-clause:)p Black Black 520 1861 a Fg({)520
2098 y(for)317 b($s)211 b(in)107 b(//STUDENT,)1152 2334
y($h1)f(in)h(//RESULT[CAT)i(=)d('H')h(and)f(ENO)h(=)e(1],)1152
2571 y($h2)h(in)h(//RESULT[CAT)i(=)d('H')h(and)f(ENO)h(=)e(2])520
2807 y(where)i($s/SID)h(=)d($h1/SID)j(and)f($s/SID)g(=)f($h2/SID)520
3044 y(and)317 b($h1/POINTS)109 b(>=)d(9)g(and)g($h2/POINTS)j(>=)e(9)
520 3281 y(return)g(
)520 3754 y(})p
Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)
g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 108 107 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-108)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1797 52 1749 4 v 1797 551 4 500 v 1884 397 a Fj(Joins)143
b(\(4\))p 3542 551 V 1797 554 1749 4 v 3546 555 67 440
v 1864 621 1749 67 v Black 142 994 a Fh(\017)p Black
83 w Fi(One)88 b(can)g(put)f(the)h(entire)f Fg(where)p
Fi(-condition)i(into)e(p)-7 b(redi-)324 1277 y(cates)67
b(in)f(the)g Fg(for)p Fi(-clause)h(\(simila)-7 b(r)67
b(to)f(joins)g(under)g Fg(FROM)p Fi(\):)p Black Black
520 1598 a Fg({)520 1835 y(for)106 b($s)212 b(in)106
b(//STUDENT,)941 2071 y($h1)h(in)f(//RESULT[CAT)k(=)105
b('H'])i([ENO)g(=)f(1])2522 2308 y([SID)h(=)e($s/SID])2522
2544 y([POINTS)j(>=)e(9],)941 2781 y($h2)h(in)f(//RESULT[CAT)k(=)105
b('H')i(and)f(ENO)h(=)f(2)f(and)2627 3018 y(SID)i(=)e($s/SID)j(and)2627
3254 y(POINTS)g(>=)e(9])520 3491 y(return)h(
)520
3964 y(})p Black -283 4114 5977 9 v -283 4260
a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725
b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p Black
eop end
PStoPSsaved restore
%%Page: (108,109,110,111) 28
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 109 108 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-109)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1797 52 1749 4 v 1797 551 4 500 v 1884 397 a Fj(Joins)143
b(\(5\))p 3542 551 V 1797 554 1749 4 v 3546 555 67 440
v 1864 621 1749 67 v Black 142 1018 a Fh(\017)p Black
83 w Fi(An)63 b(XML)i(do)7 b(cument)63 b(that)f(directly)i(co)-7
b(rresp)7 b(onds)63 b(to)g(the)324 1294 y(table)113 b(structure)f(of)h
(a)g(relational)f(database)h(do)7 b(es)113 b(not)324
1570 y(mak)-7 b(e)83 b(optimal)g(use)f(of)h(XML's)g(tree)f(structure.)p
Black 142 1921 a Fh(\017)p Black 83 w Fi(If)120 b(the)f
Fg(RESULT)j Fi(elements)e(of)f(a)h(student)f(w)-7 b(ere)120
b(nested)324 2198 y(inside)83 b(the)f Fg(STUDENT)i Fi(element,)e(one)g
(w)-7 b(ould)83 b(not)e(need)i(an)324 2474 y(explicit)g(join)g(on)g
Fg(SID)p Fi(:)p Black Black 678 2781 a Fg(for)106 b($s)212
b(in)106 b(//STUDENT,)1099 3018 y($h1)h(in)f($s/RESULT[CAT)k(=)c('H'])h
([ENO)f(=)g(1])2785 3254 y([number\(POINTS\))111 b(>=)106
b(9],)1099 3491 y($h2)h(in)f($s/RESULT[CAT)k(=)c('H'])h([ENO)f(=)g(2])
2785 3728 y([number\(POINTS\))111 b(>=)106 b(9])678 3964
y(...)p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 110 109 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-110)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
336 75 4671 4 v 336 575 4 500 v 422 420 a Fj(Numeric)145
b(Compa)-12 b(risons)144 b(\(1\))p 5004 575 V 336 578
4671 4 v 5007 578 67 440 v 403 644 4671 67 v Black 142
1088 a Fh(\017)p Black 83 w Fi(Who)89 b(has)g(at)g(least)g(as)h(many)f
(p)7 b(oints)88 b(fo)-7 b(r)89 b(Homew)-7 b(o)g(rk)90
b(1)324 1404 y(as)83 b(Student)f(101?)p Black Black 572
1755 a Fg({)572 1991 y(for)318 b($s)106 b(in)g(//STUDENT,)1205
2228 y($x)g(in)g(//RESULT[CAT='H')111 b(and)c(ENO=1],)1205
2464 y($y)f(in)g(//RESULT[CAT='H')111 b(and)c(ENO=1])572
2701 y(where)h($x/SID)f(=)f($s/SID)i(and)e($s/SID)i(!=)e(101)572
2938 y(and)318 b($y/SID)107 b(=)f(101)572 3174 y(and)318
b(number\($x/POINTS\))111 b(>=)106 b(number\($y/POINTS\))572
3411 y(return)i(
)572 3884 y(})p
Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)
g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 111 110 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-111)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
336 52 4671 4 v 336 551 4 500 v 422 397 a Fj(Numeric)145
b(Compa)-12 b(risons)144 b(\(2\))p 5004 551 V 336 554
4671 4 v 5007 555 67 440 v 403 621 4671 67 v Black 142
1042 a Fh(\017)p Black 83 w Fi(If)101 b(the)g(do)7 b(cument)100
b(is)h(not)g(validated,)g(attribute)e(values)324 1316
y(and)91 b(values)h(of)f(elements)g(with)g(simple)g(content)g(a)-7
b(re)91 b(of)324 1590 y(t)-7 b(yp)7 b(e)83 b Fg(untypedAtomic)p
Fi(.)p Black 142 1939 a Fh(\017)p Black 83 w Fi(When)94
b(the)f(compa)-7 b(rison)94 b(is)g(done)g(with)f(a)h(value)h(of)e(nu-)
324 2213 y(meric)77 b(t)-7 b(yp)7 b(e)76 b(\(e.g.)h(a)f(constant)g(as)h
(in)f(ea)-7 b(rlier)77 b(examples\),)324 2487 y(a)83
b(numeric)g(compa)-7 b(rison)82 b(is)h(done.)p Black
Black 608 2740 a Fo(The)57 b Ff(untypedAtomic)j Fo(value)d(is)h
(converted)e(to)h(the)h(mo)-5 b(re)57 b(sp)5 b(eci\014c)56
b(t)-5 b(yp)5 b(e.)p Black 142 3101 a Fh(\017)p Black
83 w Fi(If)87 b(t)-7 b(w)g(o)86 b Fg(untypedATomic)91
b Fi(values)c(a)-7 b(re)86 b(compa)-7 b(red,)86 b(a)g(string)324
3375 y(compa)-7 b(rison)83 b(is)g(done.)p Black Black
608 3629 a Fo(T)-14 b(o)62 b(get)g(a)g(numeric)g(compa)-5
b(rison,)63 b(one)e(must)h(use)g Ff(number\(...\))i Fo(on)e(at)g(least)
608 3803 y(one)57 b(side)g(of)g(the)g(compa)-5 b(rison.)p
Black -283 4114 5977 9 v -283 4260 a(Stefan)56 b(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 112 111 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-112)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
993 141 3358 4 v 993 641 4 500 v 1079 486 a Fj(NOT)143
b(EXISTS)g(\(1\))p 4347 641 V 993 644 3358 4 v 4350 644
67 440 v 1059 710 3358 67 v Black 142 1225 a Fh(\017)p
Black 83 w Fi(\\Print)81 b(the)h(names)g(of)g(all)h(students)e(who)h
(have)h(not)f(y)-7 b(et)324 1541 y(submitted)82 b(a)h(homew)-7
b(o)g(rk":)p Black Black 889 1844 a Fg(SELECT)107 b(S.FIRST,)h(S.LAST)
889 2081 y(FROM)317 b(STUDENTS)108 b(S)889 2317 y(WHERE)212
b(NOT)107 b(EXISTS\(SELECT)j(*)2783 2554 y(FROM)320 b(RESULTS)108
b(R)2783 2791 y(WHERE)215 b(R.SID)107 b(=)f(S.SID)2783
3027 y(AND)425 b(R.CAT)107 b(=)f('H'\))p 2196 3262 1389
5 v 2194 3499 5 237 v 2279 3428 a(FIRST)p 2887 3499 V
168 w(LAST)p 3580 3499 V 2196 3504 1389 5 v 2196 3529
V 2194 3766 5 237 v 2279 3695 a(Maria)p 2887 3766 V 168
w(Brown)p 3580 3766 V 2196 3770 1389 5 v Black -283 4114
5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
%%Page: (112,113,114,115) 29
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 113 112 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-113)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
993 52 3358 4 v 993 551 4 500 v 1079 397 a Fj(NOT)143
b(EXISTS)g(\(2\))p 4347 551 V 993 554 3358 4 v 4350 555
67 440 v 1059 621 3358 67 v Black 142 1136 a Fh(\017)p
Black 83 w Fi(Note)75 b(that)g Fg(not\(...\))k Fi(computes)c(the)g
(e\013ective)h(b)7 b(o)g(olean)324 1440 y(value)122 b(of)g(its)f(a)-7
b(rgument,)121 b(and)g(thus)g(can)h(b)7 b(e)122 b(used)f(to)324
1745 y(check)84 b(fo)-7 b(r)82 b(existence)h(of)f(a)h(no)7
b(de:)p Black Black 625 2072 a Fg({)625 2308
y(for)107 b($s)f(in)g(//STUDENT)625 2545 y(where)h(not\(//RESULT[SID=)q
($s/)q(SID)112 b(and)107 b(CAT='H']\))625 2782 y(return)h(
)625 3255 y(})p Black Black 608 3600 a Ff(Query)74
b(Result:)g()1925 3759 y(
)
1632 3918 y()p Black -283 4114 5977 9 v -283
4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 114 113 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-114)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
993 52 3358 4 v 993 551 4 500 v 1079 397 a Fj(NOT)143
b(EXISTS)g(\(3\))p 4347 551 V 993 554 3358 4 v 4350 555
67 440 v 1059 621 3358 67 v Black 142 1065 a Fh(\017)p
Black 83 w Fi(Instead)83 b(of)f Fg(not\(...\))k Fi(one)d(can)f(also)h
(use)p Black Black 730 1393 a Fg(count\(//[RESULT[S)q(ID=)q($s)q(/SI)q
(D][)q(CA)q(T=')q(H'])q(\))112 b(=)105 b(0)p Black Black
608 1682 a Fo(F)-5 b(o)g(r)58 b(sequences)e(of)h(no)5
b(des,)57 b(this)h(is)g(equivalent)f(\(not)g(fo)-5 b(r)58
b(atomic)g(values\).)p Black 142 2048 a Fh(\017)p Black
83 w Fi(One)83 b(can)g(also)g(use)g(an)g(explicit)g(quanti\014er:)p
Black Black 783 2403 a Fg({)783 2639 y(for)107
b($s)f(in)g(//STUDENT)783 2876 y(where)h(every)h($r)e(in)g
(//RESULT[SID)k(=)105 b($s/SID])2048 3113 y(satisfies)j(CAT)f(!=)f('H')
783 3349 y(return)i(
)783 3822 y(})p
Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)
g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 115 114 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-115)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
128 111 5087 4 v 128 610 4 500 v 215 456 a Fj(Universal)145
b(Quanti\014cation)f(\(1\))p 5211 610 V 128 613 5087
4 v 5215 613 67 440 v 195 680 5087 67 v Black 142 1100
a Fh(\017)p Black 83 w Fi(\\Print)94 b(the)h(names)g(of)g(all)h
(students)e(who)i(have)f(solved)324 1416 y(all)83 b(homew)-7
b(o)g(rks)83 b(in)g(the)f(database":)p Black Black 1099
1719 a Fg(SELECT)108 b(S.FIRST,)g(S.LAST)1099 1956 y(FROM)318
b(STUDENTS)108 b(S)1099 2192 y(WHERE)213 b(NOT)106 b(EXISTS)i(\(SELECT)
g(*)1837 2429 y(FROM)212 b(EXERCISES)109 b(E)1837 2666
y(WHERE)e(E.CAT)g(=)f('H')1837 2902 y(AND)317 b(NOT)107
b(EXISTS)g(\(SELECT)h(*)2469 3139 y(FROM)212 b(RESULTS)108
b(R)2469 3375 y(WHERE)f(R.SID)g(=)f(S.SID)2469 3612 y(AND)317
b(R.CAT)107 b(=)f('H')2469 3849 y(AND)317 b(R.ENO)107
b(=)f(E.ENO\)\))p Black -283 4114 5977 9 v -283 4260
a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725
b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p Black
eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 116 115 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-116)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
128 137 5087 4 v 128 637 4 500 v 215 482 a Fj(Universal)145
b(Quanti\014cation)f(\(2\))p 5211 637 V 128 640 5087
4 v 5215 640 67 440 v 195 706 5087 67 v Black 142 1221
a Fh(\017)p Black 83 w Fi(In)77 b(X)-7 b(Query)-21 b(,)78
b(the)f(\\fo)-7 b(r)76 b(all")h(can)g(b)7 b(e)77 b(directly)g(exp)-7
b(ressed:)p Black Black 326 1576 a Fg({)536 1812 y(for)107 b($s)f(in)g(//STUDENT)536
2049 y(where)i(every)f($e)f(in)g(//EXERCISE[CAT='H')q(])111
b(satisfies)747 2286 y(//RESULT[SID=$s/SI)q(D][)q(CA)q(T=')q(H'])q([E)q
(NO=)q($e/)q(ENO)q(])536 2522 y(return)d(
)326
2996 y(})p
Black Black 608 3357 a Ff(Query)74 b(Result:)g
()1925 3515 y(
)1925 3674 y(
)
1632 3832 y()p Black
-283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
%%Page: (116,117,118,119) 30
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 117 116 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-117)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1787 52 1770 4 v 1787 551 4 500 v 1873 397 a Fj(LIKE)143
b(\(1\))p 3553 551 V 1787 554 1770 4 v 3556 555 67 440
v 1853 621 1770 67 v Black 142 1018 a Fh(\017)p Black
83 w Fi(\\Print)67 b(the)g(names)h(of)f(all)h(students)f(who)h(have)g
(an)f(email)324 1295 y(address)83 b(from)f Fg(acm.org)p
Fi(":)p Black Black 540 1618 a Fg(SELECT)107 b(FIRST,)h(LAST)540
1847 y(FROM)317 b(STUDENTS)540 2075 y(WHERE)212 b(EMAIL)107
b(LIKE)g('\045@acm.org')p 3853 1547 1389 5 v 3851 1784
5 237 v 3936 1713 a(FIRST)p 4544 1784 V 168 w(LAST)p
5237 1784 V 3853 1789 1389 5 v 3853 1814 V 3851 2050
5 237 v 3936 1980 a(Ann)p 4544 2050 V 378 w(Smith)p 5237
2050 V 3853 2055 1389 5 v Black 142 2447 a Fh(\017)p
Black 83 w Fi(The)83 b(function)f(lib)-7 b(ra)g(ry)82
b(contains)324 2719 y
SDict begin H.S end
324 2719 a Black -29 x Fo([https://www.w3.o)-5
b(rg/TR/xpath-functions/])p Black 3453 2585 a
SDict begin H.R end
3453 2585
a 3453 2690 a
SDict begin [/H /I/Border [0 0 1]BorderArrayPatch/Color [0 1 1]/Action
<>/Subtype
/Link H.B /ANN pdfmark end
3453 2690 a Black 359 2975 a Fh(\005)p
Black 128 w Fg(contains\()p Fc(s)1634 3016 y Fb(1)1745
2975 y Fg(,)106 b Fc(s)2053 3016 y Fb(2)2161 2975 y Fg(\))p
Fi(:)83 b(Substring)e(test.)p Black 359 3260 a Fh(\005)p
Black 128 w Fg(starts-with\()p Fc(s)1949 3300 y Fb(1)2061
3260 y Fg(,)106 b Fc(s)2369 3300 y Fb(2)2477 3260 y Fg(\))p
Fi(:)83 b(Pre\014x)f(test.)p Black 359 3545 a Fh(\005)p
Black 128 w Fg(ends-with\()p Fc(s)1739 3585 y Fb(1)1851
3545 y Fg(,)105 b Fc(s)2158 3585 y Fb(2)2266 3545 y Fg(\))p
Fi(:)83 b(Su\016x)f(test)g(\(this)h(example\).)p Black
359 3829 a Fh(\005)p Black 128 w Fg(matches\()p Fc(s)p
Fg(,)109 b Fc(p)p Fg(\))p Fi(:)83 b(Regula)-7 b(r)83
b(exp)-7 b(ression)83 b(test.)p Black -283 4114 5977
9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 118 117 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-118)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1787 52 1770 4 v 1787 551 4 500 v 1873 397 a Fj(LIKE)143
b(\(2\))p 3553 551 V 1787 554 1770 4 v 3556 555 67 440
v 1853 621 1770 67 v Black 142 1065 a Fh(\017)p Black
83 w Fi(Solution)82 b(with)h Fg(ends-with)p Fi(:)p Black
Black 326 1367 a Fg(for)106 b($s)g(in)g(//STUDENT[ends-wi)q(th\()q(EMA)
q(IL)q(,)111 b('@acm.org'\)])326 1604 y(return)c(...)p
Black 142 1903 a Fh(\017)p Black 83 w Fi(Solution)82
b(with)h Fg(matches)p Fi(:)p Black Black 572 2230 a Fg(for)107
b($s)f(in)g(//STUDENT)1837 2467 y([matches\(EMAIL,)111
b('^.*@acm.org$'\)])572 2687 y(return)d(...)p Black Black
608 2989 a Ff($)70 b Fo(matches)f(the)g(end)g(of)g(the)h(string)g(\(o)
-5 b(r)70 b(a)g(line)g(end)f(in)h(multi-line)h(mo)5 b(de\).)608
3164 y(It)56 b(is)g(necessa)-5 b(ry)-14 b(,)54 b(b)5
b(ecause)55 b(otherwise)h(the)f(regula)-5 b(r)57 b(exp)-5
b(ression)56 b(could)g(match)608 3339 y(any)d(substring.)i(In)f(the)f
(same)g(w)-5 b(a)g(y)-14 b(,)54 b Ff(^)f Fo(ensures)h(that)g(the)f
(match)h(must)g(b)5 b(egin)608 3514 y(at)53 b(the)f(sta)-5
b(rt)53 b(of)f(the)g(string.)h(Of)f(course,)g Ff(^.*)h
Fo(could)f(b)5 b(e)52 b(left)f(out,)i(but)g(in)f(this)608
3689 y(w)-5 b(a)g(y)-14 b(,)70 b(the)f(example)h(demonstrates)g(a)h
(match)f(of)g(the)f(entire)i(string.)f(Case-)608 3864
y(insensitive)57 b(matching)h(is)f(done)h(with)f(a)h(third)g(a)-5
b(rgument)58 b Ff('i')g Fo(\(\\\015ags"\).)p Black -283
4114 5977 9 v -283 4260 a(Stefan)e(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 119 118 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-119)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
348 291 4648 4 v 348 790 4 500 v 434 636 a Fj(Duplicate)144
b(Elimination)g(\(1\))p 4992 790 V 348 793 4648 4 v 4995
793 67 440 v 414 860 4648 67 v Black 142 1328 a Fh(\017)p
Black 83 w Fi(\\Print)62 b(the)h(numb)7 b(ers)62 b(of)h(all)g(homew)-7
b(o)g(rks)63 b(fo)-7 b(r)63 b(which)g(the-)324 1643 y(re)83
b(is)g(at)f(least)g(one)h(graded)g(submission)f(\(result\)":)p
Black Black 1518 2008 a Fg(SELECT)108 b(DISTINCT)g(ENO)1518
2244 y(FROM)318 b(RESULTS)1518 2481 y(WHERE)213 b(CAT)106
b(=)g('H')p 3778 1827 485 5 v 3776 2063 5 237 v 3861
1993 a(ENO)p 4258 2063 V 3778 2068 485 5 v 3778 2093
V 3776 2330 5 237 v 4072 2259 a(1)p 4258 2330 V 3776
2566 V 4072 2496 a(2)p 4258 2566 V 3778 2571 485 5 v
Black 142 2896 a Fh(\017)p Black 83 w Fi(Duplicates)97
b(in)g(a)g(sequence)g(of)g(atomic)f(values)i(can)f(b)7
b(e)324 3212 y(removed)83 b(with)g(the)f(function)g Fg(distinct-values)
p Fi(.)p Black 142 3602 a Fh(\017)p Black 83 w Fi(Often,)h(existential)
f(quanti\014cation)g(helps.)p Black -283 4114 5977 9
v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 120 119 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-120)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
348 52 4648 4 v 348 551 4 500 v 434 397 a Fj(Duplicate)144
b(Elimination)g(\(2\))p 4992 551 V 348 554 4648 4 v 4995
555 67 440 v 414 621 4648 67 v Black 142 1042 a Fh(\017)p
Black 83 w Fi(Solution)82 b(with)h Fg(distinct-values)p
Fi(:)p Black Black 1152 1345 a Fg({)1152 1582
y(let)106 b($s)h(:=)f(//RESULT[CAT)j(=)d('H']/ENO)1152
1818 y(for)g($n)h(in)f(distinct-values\($s\))1152 2055
y(return)i({$n})1152 2291
y(})p Black Black 608 2654 a Fo(Note)57 b(that)h
Ff(distinct-values)i Fo(applies)e(atomization)h(to)f(its)f(a)-5
b(rgument.)p Black 142 3018 a Fh(\017)p Black 83 w Fi(Solution)82
b(with)h(existential)f(quanti\014cation:)p Black Black
414 3349 a Fg(for)107 b($h)f(in)g(//EXERCISE[CAT)111
b(=)105 b('H'])414 3586 y(where)j(exists\(//RESULT[CAT)k(=)106
b('H'][ENO)i(=)e($h/ENO]\))414 3822 y(return)i(...)p
Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)
g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
%%Page: (120,121,122,123) 31
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 121 120 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-121)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
437 81 4469 4 v 437 580 4 500 v 524 426 a Fj(Simple)144
b(Aggregations)g(\(1\))p 4902 580 V 437 583 4469 4 v
4906 584 67 440 v 504 650 4469 67 v Black 142 1118 a
Fh(\017)p Black 83 w Fi(\\Ho)-7 b(w)83 b(many)g(students)f(a)-7
b(re)82 b(in)h(the)f(database?":)p Black Black 1466 1469
a Fg(SELECT)107 b(COUNT\(*\))1466 1705 y(FROM)317 b(STUDENTS)p
3304 1288 1012 5 v 3302 1524 5 237 v 3387 1454 a(COUNT\(*\))p
4311 1524 V 3304 1529 1012 5 v 3304 1554 V 3302 1791
5 237 v 4125 1720 a(4)p 4311 1791 V 3304 1796 1012 5
v Black 142 2121 a Fh(\017)p Black 83 w Fi(The)83 b(lib)-7
b(ra)g(ry)82 b(o\013ers)g(the)h(usual)f(aggregation)g(functions:)p
Black 359 2461 a Fh(\005)p Black 128 w Fg(count\()p Fc(s)p
Fg(\))p Fi(:)j(Numb)7 b(er)83 b(of)f(items)g(in)h(a)g(sequence)p
Black 359 2801 a Fh(\005)p Black 128 w Fg(sum\()p Fc(s)p
Fi([)p Fg(,)p Fc(z)8 b Fi(])p Fg(\))p Fi(:)85 b(Sum)d(\(with)h(result)g
Fc(z)91 b Fi(fo)-7 b(r)82 b(empt)-7 b(y)82 b(seq.\))p
Black 359 3142 a Fh(\005)p Black 128 w Fg(avg\()p Fc(s)p
Fg(\))p Fi(:)j(Average.)p Black 359 3482 a Fh(\005)p
Black 128 w Fg(min\()p Fc(s)p Fg(\))p Fi(:)g(Minimum.)p
Black 359 3823 a Fh(\005)p Black 128 w Fg(max\()p Fc(s)p
Fg(\))p Fi(:)g(Maximum.)p Black -283 4114 5977 9 v -283
4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 122 121 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-122)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
437 242 4469 4 v 437 742 4 500 v 524 587 a Fj(Simple)144
b(Aggregations)g(\(2\))p 4902 742 V 437 745 4469 4 v
4906 745 67 440 v 504 811 4469 67 v Black 142 1326 a
Fh(\017)p Black 83 w Fi(This)83 b(is)f(simple)h(in)g(X)-7
b(Query)-21 b(,)83 b(to)7 b(o:)p Black Black 1837 1657
a Fg()2048 1894 y({count\(//STUDENT\)})1837
2130 y()p Black 142 2430 a Fh(\017)p Black
83 w Fi(Note)74 b(that)f(in)h(X)-7 b(Query)-21 b(,)75
b(aggregation)e(functions)g(can)i(b)7 b(e)324 2745 y(used)58
b(under)f Fg(where)p Fi(,)i(which)f(w)-7 b(ould)58 b(b)7
b(e)58 b(fo)-7 b(rbidden)57 b(in)g(SQL.)p Black Black
608 3065 a Fo(The)c(reason)g(is)g(that)g(in)h(X)-5 b(Query)-14
b(,)52 b(the)g(a)-5 b(rgument)54 b(of)e(the)h(aggregation)h(func-)608
3248 y(tion)46 b(computes)e(the)i(set)f(\(sequence\))e(of)i(values)g
(to)h(b)5 b(e)45 b(aggregated.)g(In)h(SQL,)608 3430 y(the)f(a)-5
b(rgument)47 b(is)f(only)g(an)g(attribute,)h(and)f(the)f(aggregation)j
(is)e(over)f(va)-5 b(riable)608 3613 y(assignments)58
b(generated)f(b)-5 b(y)57 b(the)g Ff(FROM)p Fo(-clause.)p
Black -283 4114 5977 9 v -283 4260 a(Stefan)f(Brass:)i(XML)f(und)g
(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 123 122 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-123)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
437 52 4469 4 v 437 551 4 500 v 524 397 a Fj(Simple)144
b(Aggregations)g(\(3\))p 4902 551 V 437 554 4469 4 v
4906 555 67 440 v 504 621 4469 67 v Black 142 1042 a
Fh(\017)p Black 83 w Fi(Ho)-7 b(w)83 b(many)g(distinct)f(topics)g(a)-7
b(re)83 b(there?)p Black Black 675 1392 a Fg(SELECT)108
b(COUNT\(DISTINCT)i(TOPIC\))675 1629 y(FROM)318 b(EXERCISES)p
3884 1211 1223 5 v 3881 1448 5 237 v 3967 1377 a(COUNT\(...\))p
5101 1448 V 3884 1453 1223 5 v 3884 1478 V 3881 1715
5 237 v 4915 1644 a(2)p 5101 1715 V 3884 1719 1223 5
v Black 142 2019 a Fh(\017)p Black 83 w Fi(In)83 b(X)-7
b(Query:)p Black Black 783 2347 a Fg(count\(distinct-val)q(ue)q(s\(/)q
(/EX)q(ERC)q(IS)q(E/T)q(OPI)q(C\))q(\))p Black 142 2704
a Fh(\017)p Black 83 w Fi(In)83 b(SQL,)g(null)g(values)g(a)-7
b(re)83 b(not)f(counted:)p Black Black 1044 3054 a Fg(SELECT)108
b(COUNT\(EMAIL\))1044 3291 y(FROM)318 b(STUDENTS)p 3304
2873 1433 5 v 3302 3110 5 237 v 3387 3039 a(COUNT\(EMAIL\))p
4732 3110 V 3304 3115 1433 5 v 3304 3140 V 3302 3377
5 237 v 4546 3306 a(3)p 4732 3377 V 3304 3382 1433 5
v Black 142 3611 a Fh(\017)p Black 83 w Fi(In)83 b(X)-7
b(Query)-21 b(,)83 b(this)g(happ)7 b(end)82 b(automatically)-21
b(.)p Black Black 608 3874 a Fo(The)57 b(path)h Ff(//STUDENT/EMAIL)i
Fo(selects)d(only)g(existent)g(email)g(elements.)p Black
-283 4114 5977 9 v -283 4260 a(Stefan)f(Brass:)i(XML)f(und)g(Datenbank)
-5 b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 124 123 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-124)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1169 151 3005 4 v 1169 650 4 500 v 1255 496 a Fj(GROUP)142
b(BY)h(\(1\))p 4171 650 V 1169 653 3005 4 v 4174 654
67 440 v 1236 720 3005 67 v Black 142 1188 a Fh(\017)p
Black 83 w Fi(\\Print)67 b(fo)-7 b(r)67 b(every)i(student)e(the)h
(total)f(numb)7 b(er)67 b(of)h(home-)324 1503 y(w)-7
b(o)g(rk)83 b(p)7 b(oints.")p Black Black 941 1834 a
Fg(SELECT)108 b(S.FIRST,)g(S.LAST,)g(SUM\(R.POINTS\))941
2071 y(FROM)318 b(STUDENTS)108 b(S,)e(RESULTS)i(R)941
2308 y(WHERE)213 b(S.SID)107 b(=)f(R.SID)h(AND)f(R.CAT)i(=)d('H')941
2544 y(GROUP)213 b(BY)106 b(S.SID,)h(S.FIRST,)i(S.LAST)p
1376 2779 3030 5 v 1373 3016 5 237 v 1459 2945 a(FIRST)p
2277 3016 V 378 w(LAST)p 3075 3016 V 379 w(SUM\(POINTS\))p
4400 3016 V 1376 3021 3030 5 v 1376 3046 V 1373 3282
5 237 v 1459 3212 a(Ann)p 2277 3282 V 588 w(Smith)p 3075
3282 V 1222 w(18)p 4400 3282 V 1373 3519 V 1459 3448
a(Michael)p 2277 3519 V 168 w(Jones)p 3075 3519 V 1222
w(18)p 4400 3519 V 1373 3756 V 1459 3685 a(Richard)p
2277 3756 V 168 w(Turner)p 3075 3756 V 1222 w(5)p 4400
3756 V 1376 3761 3030 5 v Black -283 4114 5977 9 v -283
4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
%%Page: (124,125,126,127) 32
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 125 124 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-125)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1169 146 3005 4 v 1169 646 4 500 v 1255 491 a Fj(GROUP)142
b(BY)h(\(2\))p 4171 646 V 1169 649 3005 4 v 4174 649
67 440 v 1236 715 3005 67 v Black 142 1160 a Fh(\017)p
Black 83 w Fi(If)83 b(w)-7 b(e)84 b(w)-7 b(ant)83 b(the)g(same)g(in)g
(X)-7 b(Query)-21 b(,)84 b(w)-7 b(e)84 b(must)e(explicitly)324
1475 y(exclude)i(students)e(without)g(homew)-7 b(o)g(rks:)p
Black Black 326 1802 a Fg()326
2039 y({)536 2275 y(for)107 b($s)f(in)g(//STUDENT)536
2512 y(let)h($p)f(:=)g(//RESULT[SID=$s/SI)q(D][)q(CA)q(T=')q(H'])q(/PO)
q(IN)q(TS)536 2748 y(where)i(exists\(//RESULT[SID)q(=$s)q(/SI)q(D)k
(and)106 b(CAT='H']\))536 2985 y(return)i(
)326
3458 y(})326 3695 y()p
Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)
g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 126 125 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-126)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
200 52 4944 4 v 200 551 4 500 v 286 397 a Fj(Restructuring)144
b(the)f(Data)f(\(1\))p 5140 551 V 200 554 4944 4 v 5143
555 67 440 v 266 621 4944 67 v Black 142 1136 a Fh(\017)p
Black 83 w Fi(Supp)7 b(ose)96 b(w)-7 b(e)97 b(w)-7 b(ant)96
b(to)g(remove)g(the)g(elements)g(fo)-7 b(r)96 b(the)324
1411 y(relations)61 b(\(lik)-7 b(e)62 b Fg(STUDENTS)p
Fi(\),)j(and)c(put)g(the)g(tuple)g(elements)324 1686
y(directly)83 b(b)7 b(elo)-7 b(w)83 b Fg(GRADES-DB)p
Fi(:)p Black Black 1415 2017 a Fg({)1837 2253
y(for)106 b($e)g(in)h(/GRADES-DB/*/*)1837 2490 y(return)g($e)1415
2727 y(})p Black 142 3026 a Fh(\017)p Black
83 w Fi(This)83 b(gives)p Black Black 1731 3286 a Fg()2153
3523 y()2574 3759 y(101)2574 3988
y(...)p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 127 126 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-127)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
200 52 4944 4 v 200 551 4 500 v 286 397 a Fj(Restructuring)144
b(the)f(Data)f(\(2\))p 5140 551 V 200 554 4944 4 v 5143
555 67 440 v 266 621 4944 67 v Black 142 1008 a Fh(\017)p
Black 83 w Fi(The)107 b(opp)7 b(osite)107 b(transfo)-7
b(rmation)106 b(\(grouping)h(tuple)h(ele-)324 1301 y(ments)83
b(b)-7 b(y)82 b(relation\))h(is)g(also)g(p)7 b(ossible:)p
Black Black 941 1645 a Fg()1363 1882 y({)1784
2118 y(for)107 b($s)f(in)g(/GRADES-DB/STUDENT)1784 2355
y(return)i($s)1363 2592 y(})1363 2828 y({)1784
3065 y(for)f($e)f(in)g(/GRADES-DB/EXERCIS)q(E)1784 3302
y(return)i($e)1363 3538 y(})1363 3751 y(...)941
3988 y()p Black -283 4114 5977 9 v -283 4260
a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725
b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p Black
eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 128 127 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-128)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
200 56 4944 4 v 200 555 4 500 v 286 401 a Fj(Restructuring)144
b(the)f(Data)f(\(3\))p 5140 555 V 200 558 4944 4 v 5143
559 67 440 v 266 625 4944 67 v Black 142 965 a Fh(\017)p
Black 83 w Fi(Nesting)73 b(results)f(under)g(students)g(\(data)g(in)h
(attributes\):)p Black Black 327 1262 a Fg({)748
1491 y(for)107 b($s)f(in)g(//STUDENT)748 1719 y(return)i(element)g
(STUDENT)g({)1170 1947 y(for)e($d)g(in)h($s/*)1170 2176
y(return)g(attribute)i({name\($d\)})g({data\($d\)},)1170
2404 y(for)d($r)g(in)h(//RESULT[SID=$s/SID)q(])1170 2632
y(return)g(element)h(RESULT)g({)1591 2861 y(for)f($a)f(in)g($r/*)1591
3089 y(where)i(name\($a\))g(ne)e("SID")1591 3317 y(return)i(attribute)h
({name\($a\)})g({data\($a\)})1170 3447 y(})748 3590 y(},)748
3755 y(...\(:)f(Copy/transform)i(EXERCISE)e(data)f(:\))327
3984 y(})p Black -283 4114 5977 9 v -283
4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
%%Page: (128,129,130,131) 33
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 129 128 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-129)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
200 89 4944 4 v 200 588 4 500 v 286 434 a Fj(Restructuring)144
b(the)f(Data)f(\(4\))p 5140 588 V 200 591 4944 4 v 5143
592 67 440 v 266 658 4944 67 v Black 142 984 a Fh(\017)p
Black 83 w Fi(The)83 b(output)e(lo)7 b(oks)83 b(as)g(follo)-7
b(ws:)p Black Black 380 1315 a Fg()380 1551 y()591 1788 y()802 2025 y()802 2261 y()802 2498 y()
591 2735 y()591 2971 y()802 3208 y(...)591
3444 y()591 3681 y(...)380 3918 y()p
Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)
g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 130 129 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-130)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1777 154 1789 4 v 1777 558 4 405 v 1864 475 a Fj(Overview)p
3563 558 V 1777 561 1789 4 v 3566 561 67 345 v 1844 628
1789 67 v Black Black 690 1343 a Fi(1.)83 b(Intro)7 b(duction)690
1887 y(2.)83 b(Basic)f(Syntax,)h(Constructo)-7 b(rs)690
2445 y(3.)83 b(FLO)-7 b(WR-Exp)g(ressions)690 3002 y(4.)83
b(Examples,)g(Compa)-7 b(rison)83 b(with)f(SQL)690 3560
y(5.)h(Prolog,)f(F)-7 b
0 setlinecap
(unctions)2705 3505 y
save /setgray { pop } def
2705 3505
a @beginspecial @setspecial
0.99626401 0.99626401 scale 0.79999 setlinewidth 261.2973 0 moveto
261.2973 9.86255 lineto 0 11.04584 -8.95416 20 -20 20 rcurveto 0 29.86255
lineto -241.2973 29.86255 lineto -11.04584 0 -20 -8.95416 -20 -20 rcurveto
-261.2973 0 lineto -261.2973 -9.86255 lineto 0 -11.04584 8.95416 -20
20 -20 rcurveto 0 -29.86255 lineto 241.2973 -29.86255 lineto 11.04584
0 20 8.95416 20 20 rcurveto 261.2973 0 lineto stroke
@endspecial 2705 3505 a
restore
2705 3505 a Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 131 130 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-131)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
1520 79 2303 4 v 1520 528 4 449 v 1606 397 a Fj(Namespaces)p
3820 528 V 1520 531 2303 4 v 3823 531 67 389 v 1587 597
2303 67 v Black 142 1065 a Fh(\017)p Black 83 w Fi(Namespaces)84
b(can)e(b)7 b(e)83 b(de\014ned)g(in)g(the)f(Prolog:)p
Black 359 1368 a Fh(\005)p Black 128 w Fg(declare)108
b(namespace)h(Prefix)e(=)f("URI";)p Black 359 1670 a
Fh(\005)p Black 128 w Fg(declare)i(default)g(element)g(namespace)g
("URI";)p Black 359 1973 a Fh(\005)p Black 128 w Fg(declare)g(default)g
(function)g(namespace)h("URI";)p Black 142 2325 a Fh(\017)p
Black 83 w Fi(The)83 b(follo)-7 b(wing)83 b(namespace)g(p)-7
b(re\014xes)82 b(a)-7 b(re)83 b(p)-7 b(redecla)g(red:)p
Black 359 2627 a Fh(\005)p Black 128 w Fg(xml)106 b(=)g
(http://www.w3.org/)q(XM)q(L/1)q(998)q(/na)q(me)q(spa)q(ce)p
Black 359 2930 a Fh(\005)p Black 128 w Fg(xs)g(=)g(http://www.w3.org/2)
q(00)q(1/X)q(MLS)q(che)q(ma)p Black 359 3232 a Fh(\005)p
Black 128 w Fg(xsi)g(=)g(http://www.w3.org/)q(20)q(01/)q(XML)q(Sch)q
(em)q(a-i)q(nst)q(an)q(ce)p Black 359 3535 a Fh(\005)p
Black 128 w Fg(fn)g(=)g(http://www.w3.org/2)q(00)q(5/x)q(pat)q(h-f)q
(un)q(cti)q(ons)p Black 359 3837 a Fh(\005)p Black 128
w Fg(local)h(=)f Ff(http://)74 b(www.w3.org/2005/xquery-local-function)
q(s)p Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56
b(Brass:)i(XML)f(und)g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84
b(at)58 b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
TeXDict begin @landscape 132 131 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-132)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
188 52 4968 4 v 188 551 4 500 v 274 397 a Fj(User-De\014ned)144
b(F)-12 b(unctions)144 b(\(1\))p 5152 551 V 188 554 4968
4 v 5155 555 67 440 v 254 621 4968 67 v Black 142 1136
a Fh(\017)p Black 83 w Fi(One)66 b(can)f(decla)-7 b(re)65
b(functions)f(in)h(the)g(p)-7 b(rolog)65 b(of)f(the)h(main)324
1443 y(mo)7 b(dule)74 b(\(i.e.)h(b)7 b(efo)-7 b(re)74
b(the)g(query\))h(and)f(lib)-7 b(ra)g(ry)74 b(mo)7 b(dules.)p
Black 142 1824 a Fh(\017)p Black 83 w Fi(F)-7 b(unctions)101
b(must)e(b)7 b(e)101 b(in)f(a)h(namespace,)f(but)g(fo)-7
b(r)100 b(func-)324 2131 y(tions)89 b(decla)-7 b(red)90
b(in)f(the)g(main)g(mo)7 b(dule)89 b(X)-7 b(Query)90
b(de\014nes)324 2438 y(the)83 b(namespace)g(p)-7 b(re\014x)82
b Fg(local)p Fi(.)p Black 142 2819 a Fh(\017)p Black
83 w Fi(A)h(simple)f(example)i(is:)p Black Black 572
3079 a Fg(declare)108 b(function)h(local:inc\($n)g(as)e(xs:integer\))
1415 3316 y(as)f(xs:integer)1415 3553 y({)g($n+1)h(};)572
3789 y(local:inc\(1\))j(\(:)c(This)h(is)f(the)h(query)g(:\))p
Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)
g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
%%Page: (132,133,134,135) 34
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 133 132 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-133)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
188 52 4968 4 v 188 551 4 500 v 274 397 a Fj(User-De\014ned)144
b(F)-12 b(unctions)144 b(\(2\))p 5152 551 V 188 554 4968
4 v 5155 555 67 440 v 254 621 4968 67 v Black 142 1018
a Fh(\017)p Black 83 w Fi(Thus,)82 b(a)h(function)f(decla)-7
b(ration)83 b(consists)f(of:)p Black 359 1340 a Fh(\005)p
Black 128 w Fi(The)g(k)-7 b(eyw)g(o)g(rds)84 b(\\)p Fg(declare)108
b(function)p Fi(",)p Black 359 1662 a Fh(\005)p Black
128 w Fi(the)70 b(name)h(of)f(the)g(function)g(with)g(namespace)h(p)-7
b(re\014x,)p Black 359 1984 a Fh(\005)p Black 128 w Fi(a)103
b(comma-sepa)-7 b(rated)102 b(list)h(of)g(pa)-7 b(rameter)102
b(decla)-7 b(rati-)592 2281 y(ons)57 b(in)g Fg(\(...\))p
Fi(,)i(each)e(consisting)g(of)g(a)g(va)-7 b(riable)57
b(and)g(op-)592 2578 y(tionally)83 b(the)f(k)-7 b(eyw)g(o)g(rd)83
b(\\)p Fg(as)p Fi(")g(and)g(a)g(sequence-t)-7 b(yp)7
b(e,)p Black 359 2900 a Fh(\005)p Black 128 w Fi(optionally)-21
b(,)72 b(a)h(sp)7 b(eci\014cation)72 b(of)g(the)h(return)e(t)-7
b(yp)7 b(e:)72 b(the)592 3197 y(k)-7 b(eyw)g(o)g(rd)83
b(\\)p Fg(as)p Fi(")h(and)e(a)h(sequence-t)-7 b(yp)7
b(e,)p Black 359 3519 a Fh(\005)p Black 128 w Fi(and)77
b(b)7 b(o)g(dy)77 b(of)f(the)h(function:)f(an)h(exp)-7
b(ression)77 b(in)g Fg({...})p Black 359 3841 a Fh(\005)p
Black 128 w Fi(and)83 b(\014nally)f(a)h(\\)p Fg(;)p Fi(".)p
Black -283 4114 5977 9 v -283 4260 a Fo(Stefan)56 b(Brass:)i(XML)f(und)
g(Datenbank)-5 b(en)1725 b(Universit)n(\177)-84 b(at)58
b(Halle,)g(2016)p Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 423.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
TeXDict begin @landscape 134 133 bop 0 0 a
SDict begin /product where{pop product(Distiller)search{pop pop pop
version(.)search{exch pop exch pop(3011)eq{gsave newpath 0 0 moveto
closepath clip/Courier findfont 10 scalefont setfont 72 72 moveto(.)show
grestore}if}{pop}ifelse}{pop}ifelse}if end
0 0 a Black
-283 -333 a Fo(7.)57 b(X)-5 b(Query)4847 b(7-134)p -283
4114 9 4379 v -283 -257 5977 9 v 5693 4114 9 4379 v Black
188 195 4968 4 v 188 694 4 500 v 274 540 a Fj(User-De\014ned)144
b(F)-12 b(unctions)144 b(\(3\))p 5152 694 V 188 697 4968
4 v 5155 698 67 440 v 254 764 4968 67 v Black 142 1232
a Fh(\017)p Black 83 w Fi(If)102 b(the)f(t)-7 b(yp)7
b(es)102 b(a)-7 b(re)102 b(not)f(sp)7 b(eci\014ed,)102
b Fg(item\(\)*)i Fi(is)e(assumed)324 1547 y(\(the)83
b(most)f(general)h(t)-7 b(yp)7 b(e\).)p Black 142 1938
a Fh(\017)p Black 83 w Fi(Instead)67 b(of)g(a)h(function)e(b)7
b(o)g(dy)-21 b(,)67 b(one)h(can)f(also)h(sp)7 b(ecify)67
b(the)324 2253 y(k)-7 b(eyw)g(o)g(rd)84 b(\\)p Fg(external)p
Fi(".)p Black Black 608 2573 a Fo(It)67 b(is)g(implementation-dep)5
b(endent)68 b(if)e(an)i(ho)-5 b(w)67 b(functions)g(written)h(in)f(some)
608 2755 y(other)57 b(language)i(\(e.g.,)d(C\))h(can)h(b)5
b(e)56 b(link)-5 b(ed)59 b(to)e(the)g(X)-5 b(Query)57
b(evaluato)-5 b(r.)p Black 142 3158 a Fh(\017)p Black
83 w Fi(F)e(unctions)83 b(can)g(b)7 b(e)83 b(recursive.)p
Black Black 608 3478 a Fo(And)65 b(also)g(mutually)g(recursive.)e(X)-5
b(Query)65 b(b)5 b(ecomes)63 b(in)h(this)i(w)-5 b(a)g(y)64
b(computa-)608 3660 y(tionally)58 b(complete,)e(but)i(then)f(it)h
(cannot)g(gua)-5 b(rantee)58 b(termination.)p Black -283
4114 5977 9 v -283 4260 a(Stefan)e(Brass:)i(XML)f(und)g(Datenbank)-5
b(en)1725 b(Universit)n(\177)-84 b(at)58 b(Halle,)g(2016)p
Black eop end
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
297.500000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
/PStoPSenablepage false def
PStoPSxform concat
showpage
PStoPSsaved restore
userdict/PStoPSsaved save put
PStoPSmatrix setmatrix
10.000000 12.075630 translate
0.483193 dup scale
userdict/PStoPSmatrix matrix currentmatrix put
userdict/PStoPSclip{0 0 moveto
595.000000 0 rlineto 0 842.000000 rlineto -595.000000 0 rlineto
closepath}put initclip
PStoPSxform concat
showpage
PStoPSsaved restore
%%Trailer
userdict /end-hook known{end-hook}if
%%EOF