glenn 01/07/12 18:53:29
Modified: tools/UltraDev/4.0/ctlx/src/org/apache/taglibs/tools/ultradev/ctlx
TLDParser.java
Log:
Applied patch from Julien Carnelos, Thanks
Revision Changes Path
1.3 +17 -6
jakarta-taglibs/tools/UltraDev/4.0/ctlx/src/org/apache/taglibs/tools/ultradev/ctlx/TLDParser.java
Index: TLDParser.java
===================================================================
RCS file:
/home/cvs/jakarta-taglibs/tools/UltraDev/4.0/ctlx/src/org/apache/taglibs/tools/ultradev/ctlx/TLDParser.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TLDParser.java 2001/04/26 16:31:53 1.2
+++ TLDParser.java 2001/07/13 01:53:28 1.3
@@ -67,6 +67,7 @@
/* file: TLDParser.java
* author: Dan Mandell [[EMAIL PROTECTED]]
+ * contributors : Julien Carnelos [[EMAIL PROTECTED]]
* -------------------------------------------
* Takes the URL of a TLD file as an argument and produces a text
* file containing JavaScript declarations of associative
@@ -88,7 +89,7 @@
public final int SUCCESS = 1;
/* Private Constants/Defaults */
- private final String PATH_TO_TLDS = "tlds/";
+ private final String PATH_TO_TLDS = "tlds";
private final String TLD_SUFFIX = ".tld";
private final String UNDEFINED = "UNDEFINED";
private final String DEFAULT_OUTPUT_FILE = "tagLibData.js";
@@ -123,7 +124,11 @@
userMode = req.getParameter("mode").toLowerCase();
outputFilePrefix = req.getParameter("prefix");
String tldpath = req.getRealPath(PATH_TO_TLDS);
- tld = new File(tldpath + outputFilePrefix + TLD_SUFFIX);
+
+ /* updated the separator to make it compatible with Windows based
servers */
+ tld = new File(tldpath + File.separator + outputFilePrefix +
TLD_SUFFIX);
+
+ System.out.println( "tld = " + tld );
if (userMode.equals("ultradev")) mode = ULTRADEV;
else if (userMode.equals("other")) mode = OTHER;
@@ -153,7 +158,7 @@
domParser.parse(new InputSource((Reader) new FileReader(TLD)));
Document doc = domParser.getDocument();
Element root = doc.getDocumentElement();
- System.out.println("Creating att table");
+ System.out.println("Creating attributes table");
createAttTable(root);
writeOutput();
result = SUCCESS;
@@ -217,8 +222,8 @@
thetag.setBodyContent(bodyContentText.toLowerCase().equals("empty") ? false : true);
}
-
System.out.println("Analyzing attributes...");
+
while (curAtt != null) {
curField = curAtt.getFirstChild();
@@ -356,8 +361,14 @@
out.print("\"" + attributes[k] + "\"");
if (k < attributes.length - 1) out.print(", ");
}
- if (i < tagNames.length - 1) out.println("]], ");
- else out.println("]]];");
+
+ out.print("]");
+
+ /* easy to add any new information... */
+
+ if ( i >= tagNames.length - 1 ) out.println( "]];");
+ else
+ out.println("],");
}
}