XML schéma pro komentáře
authorFrantišek Kučera <franta-hg@frantovo.cz>
Tue Jun 08 10:42:58 2010 +0200 (2010-06-08)
changeset 1310d1cba59734b
parent 130 1bbff3f5181f
child 132 1ca0d7fdbe51
XML schéma pro komentáře
java/nekurak.net-ejb/src/java/cz/frantovo/nekurak/ejb/PodnikEJB.java
java/nekurak.net-lib/src/cz/frantovo/nekurak/util/Komentare.java
java/nekurak.net-lib/src/cz/frantovo/nekurak/util/komentář.xsd
java/nekurak.net-web/web/styl.css
xml/komentář.xml
xml/komentář.xsd
     1.1 --- a/java/nekurak.net-ejb/src/java/cz/frantovo/nekurak/ejb/PodnikEJB.java	Tue Jun 08 09:09:17 2010 +0200
     1.2 +++ b/java/nekurak.net-ejb/src/java/cz/frantovo/nekurak/ejb/PodnikEJB.java	Tue Jun 08 10:42:58 2010 +0200
     1.3 @@ -97,8 +97,10 @@
     1.4  		break;
     1.5  	}
     1.6  
     1.7 +	/** Zkontrolujeme XML */
     1.8 +	
     1.9  
    1.10 -	/** Zkontrolujeme XML */
    1.11 +
    1.12  	log.severe("Komentář: " + k.getNadpis() + " | " + k.getKomentar() + " | " + k.getTyp());
    1.13      }
    1.14  }
     2.1 --- a/java/nekurak.net-lib/src/cz/frantovo/nekurak/util/Komentare.java	Tue Jun 08 09:09:17 2010 +0200
     2.2 +++ b/java/nekurak.net-lib/src/cz/frantovo/nekurak/util/Komentare.java	Tue Jun 08 10:42:58 2010 +0200
     2.3 @@ -25,6 +25,15 @@
     2.4  	return "<div>" + komentar + "</div>";
     2.5      }
     2.6  
     2.7 +    /**
     2.8 +     * zkontroluje komentář oproti schématu
     2.9 +     * @param komentar
    2.10 +     * @return jestli komentář odpovídá
    2.11 +     */
    2.12 +    public boolean isValidniXHTML(String komentar) {
    2.13 +	return false;
    2.14 +    }
    2.15 +
    2.16      private static String escapujXML(String str) {
    2.17  	return str.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;").replaceAll("'", "&apos;");
    2.18  
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/java/nekurak.net-lib/src/cz/frantovo/nekurak/util/komentář.xsd	Tue Jun 08 10:42:58 2010 +0200
     3.3 @@ -0,0 +1,1 @@
     3.4 +../../../../../../../xml/komentář.xsd
     3.5 \ No newline at end of file
     4.1 --- a/java/nekurak.net-web/web/styl.css	Tue Jun 08 09:09:17 2010 +0200
     4.2 +++ b/java/nekurak.net-web/web/styl.css	Tue Jun 08 10:42:58 2010 +0200
     4.3 @@ -124,7 +124,7 @@
     4.4  	max-width: 400px;
     4.5  }
     4.6  
     4.7 -input, textarea	{
     4.8 +input, textarea, select	{
     4.9  	width:200px;
    4.10  	margin-left: 2px;
    4.11  }
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/xml/komentář.xml	Tue Jun 08 10:42:58 2010 +0200
     5.3 @@ -0,0 +1,21 @@
     5.4 +<div>
     5.5 +<p>
     5.6 +ahoj
     5.7 +
     5.8 +<strong>jak se</strong>
     5.9 +aaa
    5.10 +<em>máš?</em>
    5.11 +<em>máš?</em>
    5.12 +<em>máš?</em>
    5.13 +
    5.14 +<strong>jak se</strong>
    5.15 +
    5.16 +</p>
    5.17 +
    5.18 +<p>
    5.19 +ahoj<strong>jak se</strong>
    5.20 +</p>
    5.21 +
    5.22 +<p>…</p>
    5.23 +
    5.24 +</div>
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/xml/komentář.xsd	Tue Jun 08 10:42:58 2010 +0200
     6.3 @@ -0,0 +1,21 @@
     6.4 +<?xml version="1.0" encoding="UTF-8" ?>
     6.5 +
     6.6 +<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
     6.7 +
     6.8 +    <xs:element name="div">
     6.9 +	<xs:complexType>
    6.10 +	    <xs:choice minOccurs="1" maxOccurs="unbounded">
    6.11 +		<xs:element name="p">
    6.12 +		    <xs:complexType mixed="true">
    6.13 +			<xs:choice minOccurs="0" maxOccurs="unbounded">
    6.14 +			    <xs:element name="em" type="xs:string"/>
    6.15 +			    <xs:element name="strong" type="xs:string"/>
    6.16 +			</xs:choice>
    6.17 +		    </xs:complexType>
    6.18 +		</xs:element>
    6.19 +	    </xs:choice>
    6.20 +
    6.21 +	</xs:complexType>
    6.22 +    </xs:element>
    6.23 +
    6.24 +</xs:schema>
    6.25 \ No newline at end of file