Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW: test1 by Jeloukhova Alena, k5-361 #31

Open
wants to merge 24 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions books.dtd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!ELEMENT bookstore (book*)>
<!ELEMENT book (title, year, price, author+)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT year (#PCDATA)>
<!ELEMENT price (#PCDATA)>

<!ATTLIST book
category CDATA #REQUIRED
cover (hardback|paperback) #IMPLIED
>
<!ATTLIST title
lang CDATA "en" #REQUIRED
>



16 changes: 16 additions & 0 deletions books.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE bookstore [
<!ELEMENT bookstore (book*)>
<!ELEMENT book (title, year, price, author+)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ELEMENT year (#PCDATA)>
<!ELEMENT price (#PCDATA)>

<!ATTLIST book
category CDATA #REQUIRED
cover (hardback|paperback) #IMPLIED
>
<!ATTLIST title
lang CDATA "en">
]>
<bookstore>
<book category="cooking">
<title lang="en">Everyday Italian</title>
Expand Down
73 changes: 73 additions & 0 deletions books.xsd
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="bookstore" type="bookstoreType"/>

<xs:complexType name="bookstoreType">
<xs:sequence>
<xs:element name="book" type="bookType" maxOccurs="50" minOccurs="0"/>
</xs:sequence>
</xs:complexType>

<xs:complexType name="bookType">
<xs:sequence>
<xs:element name="title" type="titleType" maxOccurs="1" minOccurs="0"/>
<xs:element name="author" type="authorType" maxOccurs="50" minOccurs="0"/>
<xs:element name="year" type="yearType" maxOccurs="1" minOccurs="0"/>
<xs:element name="price" type="priceType" maxOccurs="1" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="cover" type="coverType"/>
<xs:attribute name="category" type="xs:string" use="required"/>
</xs:complexType>

<xs:simpleType name="priceType">
<xs:restriction base="xs:float">
<xs:minInclusive value="0"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="yearType">
<xs:restriction base="xs:integer">
<xs:minInclusive value="1900"/>
<xs:maxInclusive value="2014"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="authorType">
<xs:restriction base="xs:string">
<xs:minLength value="2"/>
<xs:maxLength value="30"/>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="coverType">
<xs:restriction base="xs:string">
<xs:pattern value="(hardback|paperback)"/>
</xs:restriction>
</xs:simpleType>

<xs:complexType name="titleType">
<xs:simpleContent>
<xs:restriction base="titleTypeBase">
<xs:minLength value="2"/>
<xs:maxLength value="30"/>
</xs:restriction>
</xs:simpleContent>
</xs:complexType>

<xs:complexType name="titleTypeBase">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="lang" use="required" type="langType"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>

<xs:simpleType name="langType">
<xs:restriction base="xs:string">
<xs:length value="2"/>
</xs:restriction>
</xs:simpleType>


</xs:schema>
4 changes: 4 additions & 0 deletions student.dtd
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
<!ELEMENT student EMPTY>
<!ATTLIST student
fullname CDATA #REQUIRED
group (К6-361|К6-362) #REQUIRED
>
3 changes: 3 additions & 0 deletions student.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE student SYSTEM "student.dtd">
<student fullname="Jeloukhova" group="K6-361"/>
2 changes: 2 additions & 0 deletions task16
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//book

1 change: 1 addition & 0 deletions task17
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//book[@cover]
1 change: 1 addition & 0 deletions task18
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//book[child::year=2003]
1 change: 1 addition & 0 deletions task19
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//book[child::price>=30 and child::price<40]
2 changes: 2 additions & 0 deletions task20.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<xsl:value-of select="bookstore/book/title">

4 changes: 4 additions & 0 deletions task21.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<xs:for-each select="bookstore/book">
<xsl:sort select="price">
<xsl:value-of select="title">