add files for xpath excercises

This commit is contained in:
Andreas Zweili 2017-05-13 09:46:02 +02:00
parent 3a08e11bcc
commit ac9967ccb5
8 changed files with 254 additions and 0 deletions

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<note xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="aufgabe6.xsd">
<to>Me</to>
<from>You</from>
<heading>Reminder</heading>
<body>Don't forget to solve this</body>
</note>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="note">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="to" type="xsd:string"/>
<xsd:element name="from" type="xsd:string"/>
<xsd:element name="heading" type="xsd:string"/>
<xsd:element name="body" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="aufgabe6b.xsd">
<empNumber>1234</empNumber>
<firstName>Max</firstName>
<lastName>Muster</lastName>
<dateOfBirth>1010-08-30</dateOfBirth>
<department>Marketing</department>
<salary>50000</salary>
</employee>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="employeeType">
<xsd:sequence>
<xsd:element name="empNumber" type="xsd:string"/>
<xsd:element name="firstName" type="xsd:string" />
<xsd:element name="lastName" type="xsd:string" />
<xsd:element name="dateOfBirth" type="xsd:date" />
<xsd:element name="department" type="xsd:string" />
<xsd:element name="salary" type="xsd:long" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="employee" type="employeeType" />
</xsd:schema>

93
web/2_sem/xpath/xpath.org Normal file
View File

@ -0,0 +1,93 @@
* Aufgabe 1
** a) /library/book/isbn
#+BEGIN_SRC xml
<?xml version="1.0" encoding="UTF-8"?>
<result>
<isbn>0836217462</isbn>
<isbn>045654656</isbn>
</result>
#+END_SRC
** b) /library/book/title
#+BEGIN_SRC xml
<?xml version="1.0" encoding="UTF-8"?>
<result>
<title lang="en">Being a Dog Is a Full-Time Job</title>
<title lang="de">Das fliegende Klassenzimmer</title>
</result>
#+END_SRC
** c) /library/book/author/name
#+BEGIN_SRC xml
<?xml version="1.0" encoding="UTF-8"?>
<result>
<name>Charles M Schulz</name>
<name>Erich Kästner</name>
</result>
#+END_SRC
* Aufgabe 2
** a) /library/book/character/name
#+BEGIN_SRC xml
<?xml version="1.0" encoding="UTF-8"?>
<result>
<name>Peppermint Patty</name>
<name>Snoopy</name>
<name>Schroeder</name>
<name>Lucy</name>
</result>
#+END_SRC
** b)
* Vorgabe File
#+BEGIN_SRC xml
<?xml version="1.0" encoding="UTF-8"?>
<library>
<book id="b0836217462" available="true">
<isbn>0836217462</isbn>
<title lang="en">Being a Dog Is a Full-Time Job</title>
<author id="CMS">
<name>Charles M Schulz</name>
<born>1922-11-26</born>
<dead>2000-02-12</dead>
</author>
<character id="PP">
<name>Peppermint Patty</name>
<born>1966-08-22</born>
<qualification>bold, brash and tomboyish</qualification>
</character>
<character id="Snoopy">
<name>Snoopy</name>
<born>1950-10-04</born>
<qualification>extroverted beagle</qualification>
</character>
<character id="Schroeder">
<name>Schroeder</name>
<born>1951-05-30</born>
<qualification>brought classical music to the Peanuts strip</qualification>
</character>
<character id="Lucy">
<name>Lucy</name>
<born>1952-03-03</born>
<qualification>bossy, crabby and selfish</qualification>
</character>
</book>
<book id="c06364656" available="true">
<isbn>045654656</isbn>
<title lang="de">Das fliegende Klassenzimmer</title>
<author id="EK">
<name>Erich Kästner</name>
<born>1899-02-23</born>
<dead>1974-07-29</dead>
</author>
</book>
</library>
#+END_SRC

BIN
web/2_sem/xpath/xpath.pdf Normal file

Binary file not shown.

75
web/2_sem/xpath/xpath.tex Normal file
View File

@ -0,0 +1,75 @@
% Created 2017-05-13 Sat 09:41
% Intended LaTeX compiler: pdflatex
\documentclass{az_article}
\author{Andreas Zweili}
\date{\today}
\title{}
\hypersetup{
pdfauthor={Andreas Zweili},
pdftitle={},
pdfkeywords={},
pdfsubject={},
pdfcreator={Emacs 25.1.1 (Org mode 9.0.6)},
pdflang={English}}
\begin{document}
\tableofcontents
\newpage
\section{Aufgabe 1}
\label{sec:org19289e8}
\subsection{a) /library/book/isbn}
\label{sec:orgd8d994d}
\begin{verbatim}
<?xml version="1.0" encoding="UTF-8"?>
<result>
<isbn>0836217462</isbn>
<isbn>045654656</isbn>
</result>
\end{verbatim}
\subsection{b) /library/book/title}
\label{sec:orgc884de6}
\begin{verbatim}
<?xml version="1.0" encoding="UTF-8"?>
<result>
<title lang="en">Being a Dog Is a Full-Time Job</title>
<title lang="de">Das fliegende Klassenzimmer</title>
</result>
\end{verbatim}
\subsection{c) /library/book/author/name}
\label{sec:org498de01}
\begin{verbatim}
<?xml version="1.0" encoding="UTF-8"?>
<result>
<name>Charles M Schulz</name>
<name>Erich Kästner</name>
</result>
\end{verbatim}
\section{Aufgabe 2}
\label{sec:org9eccf58}
\subsection{a) /library/book/character/name}
\label{sec:org6495209}
\begin{verbatim}
<?xml version="1.0" encoding="UTF-8"?>
<result>
<name>Peppermint Patty</name>
<name>Snoopy</name>
<name>Schroeder</name>
<name>Lucy</name>
</result>
\end{verbatim}
\subsection{b)}
\label{sec:org7b2348a}
\section{\href{xpath\_vorlage.xml}{Vorgabe File}}
\label{sec:orge9a4a1a}
\end{document}

View File

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<library>
<book id="b0836217462" available="true">
<isbn>0836217462</isbn>
<title lang="en">Being a Dog Is a Full-Time Job</title>
<author id="CMS">
<name>Charles M Schulz</name>
<born>1922-11-26</born>
<dead>2000-02-12</dead>
</author>
<character id="PP">
<name>Peppermint Patty</name>
<born>1966-08-22</born>
<qualification>bold, brash and tomboyish</qualification>
</character>
<character id="Snoopy">
<name>Snoopy</name>
<born>1950-10-04</born>
<qualification>extroverted beagle</qualification>
</character>
<character id="Schroeder">
<name>Schroeder</name>
<born>1951-05-30</born>
<qualification>brought classical music to the Peanuts strip</qualification>
</character>
<character id="Lucy">
<name>Lucy</name>
<born>1952-03-03</born>
<qualification>bossy, crabby and selfish</qualification>
</character>
</book>
<book id="c06364656" available="true">
<isbn>045654656</isbn>
<title lang="de">Das fliegende Klassenzimmer</title>
<author id="EK">
<name>Erich Kästner</name>
<born>1899-02-23</born>
<dead>1974-07-29</dead>
</author>
</book>
</library>