diff --git a/ws/eclipse/Jdbc/Input/Xml/Memo/memo.dtd b/ws/eclipse/Jdbc/Input/Xml/Memo/memo.dtd deleted file mode 100644 index 708720d5f9025811617e16f0f436c0cf0b3d6e2b..0000000000000000000000000000000000000000 --- a/ws/eclipse/Jdbc/Input/Xml/Memo/memo.dtd +++ /dev/null @@ -1,15 +0,0 @@ -<!ELEMENT memo (from, to+, date, subject, content)> -<!ELEMENT from (name, surname)> -<!ELEMENT to (name, surname)> -<!ELEMENT date EMPTY> - -<!ATTLIST date - year NMTOKEN #REQUIRED - month NMTOKEN #REQUIRED - day NMTOKEN #REQUIRED> - -<!ELEMENT subject (#PCDATA)> -<!ELEMENT content (para)+> -<!ELEMENT para (#PCDATA)> -<!ELEMENT name (#PCDATA)> -<!ELEMENT surname (#PCDATA)> diff --git a/ws/eclipse/Jdbc/Input/Xml/Memo/memo.xsd b/ws/eclipse/Jdbc/Input/Xml/Memo/memo.xsd new file mode 100644 index 0000000000000000000000000000000000000000..8dcf60dd693542ae4de21ff9973b0e1042297331 --- /dev/null +++ b/ws/eclipse/Jdbc/Input/Xml/Memo/memo.xsd @@ -0,0 +1,35 @@ +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" + xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified" + vc:minVersion="1.0" vc:maxVersion="1.1"> + + <xs:element name="memo"> + <xs:complexType> + <xs:sequence> + <xs:element name="from" type="nameSurname"/> + <xs:element name="to" minOccurs="1" maxOccurs="unbounded" type="nameSurname"/> + <xs:element name="date" type="xs:date"/> + <xs:element name="subject" type="xs:string"/> + <xs:element ref="content"/> + </xs:sequence> + </xs:complexType> + + </xs:element> + + <xs:complexType name="nameSurname"> + <xs:sequence> + <xs:element name="name" type="xs:string"/> + <xs:element name="surname" type="xs:string"/> + </xs:sequence> + </xs:complexType> + + <xs:element name="content"> + <xs:complexType> + <xs:sequence> + <xs:element name="para" type="xs:string" + minOccurs="1" maxOccurs="unbounded"/> + </xs:sequence> + </xs:complexType> + </xs:element> + + +</xs:schema> diff --git a/ws/eclipse/Jdbc/Input/Xml/Memo/memo2html.xsl b/ws/eclipse/Jdbc/Input/Xml/Memo/memo2html.xsl index a25820358869fc26ad9adb392b61cf6a82044663..e3a88f9e0c0f858e90269b8e73cbe866e3bc68d5 100644 --- a/ws/eclipse/Jdbc/Input/Xml/Memo/memo2html.xsl +++ b/ws/eclipse/Jdbc/Input/Xml/Memo/memo2html.xsl @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="ISO-8859-1"?> <!-- $Id: memo2html.xsl 148 2006-03-17 13:57:51Z goik $ --> -<xsl:stylesheet version="1.0" xmlns:xsl= - "http://www.w3.org/1999/XSL/Transform"> +<xsl:stylesheet version="2.0" xmlns:xsl= + "http://www.w3.org/1999/XSL/Transform" + xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xsl:output method="html" indent="yes"/> @@ -10,64 +11,56 @@ </xsl:template> <xsl:template match="memo"> - <HTML> - <TITLE> + <html> + <title> <xsl:text>Short message from: </xsl:text> <xsl:value-of select="from/name"/> <xsl:text> </xsl:text> <xsl:value-of select="from/surname"/> <xsl:text>, </xsl:text> - <xsl:apply-templates select="datum"/> - </TITLE> - <BODY> - <H1> + <xsl:value-of select='format-date(date, "[D].[M].[Y]")'/> + </title> + <body> + <h1> <xsl:text>Short message from: </xsl:text> <xsl:value-of select="from/name"/> <xsl:text> </xsl:text> <xsl:value-of select="from/surname"/> - </H1> - To: + </h1> + <p>To:</p> - <UL> + <ul> <xsl:for-each select="to"> - <LI> + <li> <xsl:apply-templates select="."/> - </LI> + </li> </xsl:for-each> - </UL> - <P> - Date: - <B> - <xsl:apply-templates select="date"/> - </B> - </P> - <P> - <B>Subject:<xsl:value-of select="subject"/></B> + </ul> + <p> + <xsl:text>Date: </xsl:text> + <b> + <xsl:value-of select='format-date(date, "[D].[M].[Y]")'/> + </b> + </p> + <p> + <b>Subject:<xsl:value-of select="subject"/></b> <xsl:apply-templates select="content"/> - </P> - </BODY> - </HTML> - </xsl:template> - - <xsl:template match="date"> - <xsl:value-of select="@month"/> - <xsl:text>/</xsl:text> - <xsl:value-of select="@day"/> - <xsl:text>/</xsl:text> - <xsl:value-of select="@year"/> + </p> + </body> + </html> </xsl:template> <xsl:template match="from|to"> <xsl:value-of select="name"/> <xsl:text> </xsl:text> - <B> + <b> <xsl:value-of select="surname"/> - </B> + </b> </xsl:template> <xsl:template match="content"> <xsl:for-each select="para"> - <P><xsl:value-of select="."/></P> + <p><xsl:value-of select="."/></p> </xsl:for-each> </xsl:template> diff --git a/ws/eclipse/Jdbc/Input/Xml/Memo/message.xml b/ws/eclipse/Jdbc/Input/Xml/Memo/message.xml index 1336ce3d3570c5971c5dd775df91330f9ab7616f..3f101192caa7736dffcfa79adb604800665e4d8e 100644 --- a/ws/eclipse/Jdbc/Input/Xml/Memo/message.xml +++ b/ws/eclipse/Jdbc/Input/Xml/Memo/message.xml @@ -1,6 +1,6 @@ <?xml version="1.0" ?> -<!DOCTYPE memo SYSTEM "memo.dtd"> -<memo> +<memo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="memo.xsd"> <from> <name>Martin</name> <surname>Goik</surname> @@ -13,7 +13,7 @@ <name>Eve</name> <surname>Intruder</surname> </to> - <date year="2005" month="1" day="6"/> + <date>2014-11-29</date> <subject>Firewall problems</subject> <content> <para>Thanks for your excellent work.</para>