You are viewing a plain text version of this content. The canonical link for it is here.
Posted to adffaces-commits@incubator.apache.org by aw...@apache.org on 2007/04/30 00:49:35 UTC

svn commit: r533575 - /incubator/adffaces/branches/faces-1_2-070427/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java

Author: awiner
Date: Sun Apr 29 17:49:34 2007
New Revision: 533575

URL: http://svn.apache.org/viewvc?view=rev&rev=533575
Log:
ADFFACES-467: generated h.tld doesn't conform to schema
- Patch from Tim McConnell

Modified:
    incubator/adffaces/branches/faces-1_2-070427/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java

Modified: incubator/adffaces/branches/faces-1_2-070427/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java
URL: http://svn.apache.org/viewvc/incubator/adffaces/branches/faces-1_2-070427/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java?view=diff&rev=533575&r1=533574&r2=533575
==============================================================================
--- incubator/adffaces/branches/faces-1_2-070427/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java (original)
+++ incubator/adffaces/branches/faces-1_2-070427/plugins/maven-faces-plugin/src/main/java/org/apache/myfaces/trinidadbuild/plugin/faces/GenerateJspTaglibsMojo.java Sun Apr 29 17:49:34 2007
@@ -6,9 +6,9 @@
  *  to you under the Apache License, Version 2.0 (the
  *  "License"); you may not use this file except in compliance
  *  with the License.  You may obtain a copy of the License at
- * 
+ *
  *  http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  *  Unless required by applicable law or agreed to in writing,
  *  software distributed under the License is distributed on an
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -301,14 +301,30 @@
   {
     _writeStartTagLibrary(stream, _JSP_TAG_LIBRARY_DTD);
     stream.writeStartElement("tlib-version");
-    stream.writeCharacters(project.getVersion());
-    stream.writeEndElement();
+    String tlibVersion = project.getVersion();
+    // Remove everything but dewey-decimal characters (i.e., numbers and periods)
+    tlibVersion = tlibVersion.replaceAll("[^.0-9]", "");
+    // Remove leading and/or trailing periods
+    while (tlibVersion.startsWith("."))
+    {
+      tlibVersion = tlibVersion.substring(1);
+    }
 
-    stream.writeCharacters("\n  ");
+    while (tlibVersion.endsWith("."))
+    {
+      tlibVersion = tlibVersion.substring(0, tlibVersion.length() - 1);
+    }
 
-    stream.writeStartElement("jsp-version");
-    stream.writeCharacters(version);
+    stream.writeCharacters(tlibVersion);
     stream.writeEndElement();
+
+    if (!_is12())
+    {
+      stream.writeCharacters("\n  ");
+      stream.writeStartElement("jsp-version");
+      stream.writeCharacters(version);
+      stream.writeEndElement();
+    }
     stream.writeCharacters("\n  ");
     stream.writeStartElement("short-name");
     stream.writeCharacters(shortName);