diff options
author | Julian T <julian@jtle.dk> | 2021-11-25 08:47:19 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2021-11-25 08:47:19 +0100 |
commit | 890ad2bcee172ab2a4cbb319145f5b42ba38619a (patch) | |
tree | c7cc445410379cb5ee4b37b18f2d45a56e680b28 /sem7/db/lec_xpath.md | |
parent | 7f57150038a90f634dd27b25bd9bba05c461c22a (diff) |
Add notes and assignment solution
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. |