Author: alexsmirnov
Date: 2007-07-12 21:21:25 -0400 (Thu, 12 Jul 2007)
New Revision: 1614
Modified:
trunk/docs/ajaxguide/en/src/main/docbook/modules/a4jUGstart.xml
trunk/docs/ajaxguide/pom.xml
trunk/docs/xslt/src/main/resources/en/f.xsl
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/ConfigurableXMLFilter.java
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/NekkoXMLFilter.java
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/tidy/TidyXMLFilter.java
trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/ToXHTMLStream.java
Log:
Fix rendering empty html attributes in the neko xml filter
Modified: trunk/docs/ajaxguide/en/src/main/docbook/modules/a4jUGstart.xml
===================================================================
--- trunk/docs/ajaxguide/en/src/main/docbook/modules/a4jUGstart.xml 2007-07-12 21:38:37
UTC (rev 1613)
+++ trunk/docs/ajaxguide/en/src/main/docbook/modules/a4jUGstart.xml 2007-07-13 01:21:25
UTC (rev 1614)
@@ -255,8 +255,4 @@
<title>Other Relevant Resources</title>
<para><ulink
url="http://jsf.javabeat.net/articles/2007/06/introduction-to-ajax4j...
to Ajax4Jsf - Sample Application</ulink> by Shunmuga Raja</para>
</section>
- <section id="Relevant_src">
- <title>Other Relevant Resources</title>
- <para><ulink
url="http://jsf.javabeat.net/articles/2007/06/introduction-to-ajax4j...
to Ajax4Jsf - Sample Application</ulink> by Shunmuga Raja</para>
- </section>
</chapter>
Modified: trunk/docs/ajaxguide/pom.xml
===================================================================
--- trunk/docs/ajaxguide/pom.xml 2007-07-12 21:38:37 UTC (rev 1613)
+++ trunk/docs/ajaxguide/pom.xml 2007-07-13 01:21:25 UTC (rev 1614)
@@ -1,16 +1,16 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<artifactId>docs</artifactId>
<groupId>org.richfaces</groupId>
<version>3.1.0-SNAPSHOT</version>
</parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.richfaces.docs</groupId>
- <artifactId>ajaxguide</artifactId>
- <packaging>pom</packaging>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.richfaces.docs</groupId>
+ <artifactId>ajaxguide</artifactId>
+ <packaging>pom</packaging>
<description>Ajax4jsf user guide</description>
<pluginRepositories>
<pluginRepository>
@@ -43,10 +43,10 @@
<configuration>
<artifactItems>
<artifactItem>
- <groupId>org.richfaces.ui</groupId>
- <artifactId>
- core
- </artifactId>
+ <groupId>
+ org.richfaces.ui
+ </groupId>
+ <artifactId>core</artifactId>
<version>
${project.version}
</version>
@@ -96,13 +96,13 @@
</goals>
</execution>
</executions>
- <dependencies>
+ <dependencies>
<dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon</artifactId>
- <version>8.7</version>
+ <groupId>net.sf.saxon</groupId>
+ <artifactId>saxon</artifactId>
+ <version>8.7</version>
</dependency>
- </dependencies>
+ </dependencies>
<configuration>
<transformationSets>
<transformationSet>
@@ -130,13 +130,17 @@
<parameter>
<name>lang</name>
<value>
- ${basedir}/src/main/docbook
+ ${basedir}${file.separator}src${file.separator}main${file.separator}docbook
</value>
</parameter>
<parameter>
<name>title</name>
<value>${project.name}</value>
</parameter>
+ <parameter>
+ <name>separator</name>
+ <value>${file.separator}</value>
+ </parameter>
</parameters>
</transformationSet>
</transformationSets>
@@ -149,7 +153,7 @@
<version>${project.version}</version>
<executions>
<execution>
- <id>generate</id>
+ <id>generate</id>
<!--
<phase>compile</phase>
-->
@@ -158,7 +162,7 @@
</goals>
</execution>
<execution>
- <id>resources</id>
+ <id>resources</id>
<!--
<phase>compile</phase>
-->
@@ -253,5 +257,5 @@
<module>en</module>
</modules>
-</project>
-
+</project>
+
Modified: trunk/docs/xslt/src/main/resources/en/f.xsl
===================================================================
--- trunk/docs/xslt/src/main/resources/en/f.xsl 2007-07-12 21:38:37 UTC (rev 1613)
+++ trunk/docs/xslt/src/main/resources/en/f.xsl 2007-07-13 01:21:25 UTC (rev 1614)
@@ -5,6 +5,7 @@
<xsl:output method="xml" version="1.0"
encoding="UTF-8" indent="yes"/>
<xsl:param name="lang" />
<xsl:param name="title" />
+ <xsl:param name="separator" />
<xsl:template match="javaee:taglib | taglib">
<xsl:variable
name="excluded-tag-names">header2,header3,header4,header5,header6</xsl:variable>
@@ -47,7 +48,7 @@
<xsl:attribute name="id"><xsl:value-of
select="$tag_name"/></xsl:attribute>
<title><<xsl:value-of
select="concat($prefix,':', $tag_name)" />></title>
- <xsl:for-each select="document(concat($lang, '/included/',$tag_name,
'.desc.xml'))/*">
+ <xsl:for-each select="document(concat('file:/',$lang,
$separator,'included',$separator,$tag_name, '.desc.xml'))/*">
<xsl:copy-of select="./*"/>
</xsl:for-each>
<table>
@@ -75,7 +76,7 @@
</tbody>
</tgroup>
</table>
- <xsl:for-each select="document(concat($lang,'/included/',$tag_name,
'.xml'))/*">
+ <xsl:for-each select="document(concat('file:/',$lang,
$separator,'included',$separator,$tag_name, '.xml'))/*">
<xsl:copy-of select="./*"/>
</xsl:for-each>
</section>
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java
===================================================================
--- trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java 2007-07-12
21:38:37 UTC (rev 1613)
+++ trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/BaseXMLFilter.java 2007-07-13
01:21:25 UTC (rev 1614)
@@ -73,6 +73,10 @@
private static final String INIT_PARAMETER_PREFIX =
"org.ajax4jsf.xmlfilter.";
+ public static final String TEXT_HTML = "text/html";
+
+ public static final String APPLICATION_XHTML_XML = "application/xhtml+xml";
+
public BaseFilter filter;
public void setFilter(BaseFilter filter) {
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/ConfigurableXMLFilter.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/ConfigurableXMLFilter.java 2007-07-12
21:38:37 UTC (rev 1613)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/ConfigurableXMLFilter.java 2007-07-13
01:21:25 UTC (rev 1614)
@@ -27,10 +27,16 @@
*/
public class ConfigurableXMLFilter extends BaseXMLFilter {
- private static final Log log = LogFactory
+ public static final String NONE = "NONE";
+
+ public static final String NEKO = "NEKO";
+
+ public static final String TIDY = "TIDY";
+
+ private static final Log log = LogFactory
.getLog(ConfigurableXMLFilter.class);
- private static final String PARSERS_LIST_PARAMETER =
"org.ajax4jsf.xmlparsers";
+ private static final String PARSERS_LIST_PARAMETER =
"org.ajax4jsf.xmlparser.ORDER";
private static final String VIEW_ID_PATTERN_PARAMETER =
"org.ajax4jsf.xmlparser.";
@@ -62,11 +68,11 @@
for (int i = parsersNames.length - 1; i >= 0; i--) {
String parserName = parsersNames[i];
ParserConfig parserConfig;
- if ("TIDY".equals(parserName)) {
+ if (TIDY.equals(parserName)) {
parserConfig = new TidyParserConfig();
- } else if ("NEKO".equals(parserName)) {
+ } else if (NEKO.equals(parserName)) {
parserConfig = new NekoParserConfig();
- } else if ("PASS".equals(parserName)) {
+ } else if (NONE.equals(parserName)) {
parserConfig = new PassParserConfig();
} else {
throw new ServletException(
@@ -101,8 +107,8 @@
HtmlParser parser = null;
if (isAjax || isForcexml()) {
parser = parsers.getParser(viewId, mimetype);
- } else if (mimetype.startsWith("text/html")
- || mimetype.startsWith("application/xhtml+xml")) {
+ } else if (mimetype.startsWith(TEXT_HTML)
+ || mimetype.startsWith(APPLICATION_XHTML_XML)) {
parser = new FastHtmlParser();
}
return parser;
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/NekkoXMLFilter.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/NekkoXMLFilter.java 2007-07-12
21:38:37 UTC (rev 1613)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/nekko/NekkoXMLFilter.java 2007-07-13
01:21:25 UTC (rev 1614)
@@ -40,7 +40,7 @@
HtmlParser parser = null;
if( isAjax ){
parser = getXmlParser();
- } else if (mimetype.startsWith("text/html") ||
mimetype.startsWith("application/xhtml+xml")) {
+ } else if (mimetype.startsWith(TEXT_HTML) ||
mimetype.startsWith(APPLICATION_XHTML_XML)) {
parser = new FastHtmlParser();
} else {
return null;
Modified: trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/tidy/TidyXMLFilter.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/tidy/TidyXMLFilter.java 2007-07-12
21:38:37 UTC (rev 1613)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/webapp/tidy/TidyXMLFilter.java 2007-07-13
01:21:25 UTC (rev 1614)
@@ -68,7 +68,7 @@
*/
protected HtmlParser getParser(String mime, boolean isAjax, String viewId) {
// For non-ajax, parse only html types !
- if (isAjax || mime.startsWith("text/html") ||
mime.startsWith("application/xhtml+xml")) {
+ if (isAjax || mime.startsWith(TEXT_HTML) || mime.startsWith(APPLICATION_XHTML_XML)) {
if(isAjax || isForcexml()){
TidyParser parser ;
parser = new TidyParser(getTidyProperties());
Modified:
trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/ToXHTMLStream.java
===================================================================
---
trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/ToXHTMLStream.java 2007-07-12
21:38:37 UTC (rev 1613)
+++
trunk/framework/impl/src/main/java/org/ajax4jsf/xml/serializer/ToXHTMLStream.java 2007-07-13
01:21:25 UTC (rev 1614)
@@ -1084,11 +1084,14 @@
{
writer.write(' ');
- if ( ((value.length() == 0) || value.equalsIgnoreCase(name))
+ if ( ((value.length() == 0) )
&& elemDesc != null
&& elemDesc.isAttrFlagSet(name, ElemDesc.ATTREMPTY))
{
writer.write(name);
+ writer.write("=\"");
+ writeAttrString(writer, name, this.getEncoding());
+ writer.write('"');
}
else
{