diff options
Diffstat (limited to 'sem7/db/lec_xpath.md')
-rw-r--r-- | sem7/db/lec_xpath.md | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/sem7/db/lec_xpath.md b/sem7/db/lec_xpath.md new file mode 100644 index 0000000..e28bd94 --- /dev/null +++ b/sem7/db/lec_xpath.md @@ -0,0 +1,41 @@ + +Xpath is used for quering information in XML documents. +Can also be used with postgresql databases. + +When using xpath, we query an abstact document structure. +This is also represented by a nodetree. + +NOTE that `/, /something/else` in the slides are two different queries. + +# Nodetree + +**Document node** is the root of the tree, thus the whole element. +Will often contain document metadata, and will point at a single root element. + +**Element** element represent nodes. + +# Location Step + +Stuff between two `/`'s. +Looks like `${axis}::${node test}[${predicate_1}][${predicate_2}]` + +Axis will default to `child`. +But there are many other, which also have abbreviations. + +# Funktioner og Expressions + +Man kan køre funktioner såsom concat. +Og de kan bruge queries. + +``` +concat("hej", /med/dig/text()) +``` + +# Spørgsmål + +Vil det her give root element flere gange. +``` +//course/.. +``` + +Nope det er sets, den vil ikke være der flere gange. |