coliver 2003/04/06 10:14:58
Modified: src/scratchpad/src/org/apache/cocoon/transformation JXPathTransformer.java JexlTransformer.java Log: removed tabs Revision Changes Path 1.7 +30 -30 cocoon-2.1/src/scratchpad/src/org/apache/cocoon/transformation/JXPathTransformer.java Index: JXPathTransformer.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/scratchpad/src/org/apache/cocoon/transformation/JXPathTransformer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- JXPathTransformer.java 6 Apr 2003 06:39:01 -0000 1.6 +++ JXPathTransformer.java 6 Apr 2003 17:14:57 -0000 1.7 @@ -100,7 +100,7 @@ jxpathContextFactory = JXPathContextFactory.newInstance(); public static final String JXPATH_NAMESPACE_URI = - "http://cocoon.apache.org/transformation/jxpath/1.0"; + "http://cocoon.apache.org/transformation/jxpath/1.0"; public static final String JXPATH_FOR_EACH = "for-each"; public static final String JXPATH_CHOOSE = "choose"; public static final String JXPATH_WHEN = "when"; @@ -152,7 +152,7 @@ public void generate() throws IOException, SAXException, ProcessingException { - try { + try { this.resolver.toSAX(this.inputSource, this); } catch (SAXException e) { if (e instanceof SAXParseException) { @@ -201,13 +201,13 @@ throws ProcessingException, SAXException, IOException { super.setup(resolver, objectModel, src, parameters); - if (src != null) { - try { - this.inputSource = resolver.resolveURI(src); - } catch (SourceException se) { - throw SourceUtil.handle("Error during resolving of '" + src + "'.", se); - } - } + if (src != null) { + try { + this.inputSource = resolver.resolveURI(src); + } catch (SourceException se) { + throw SourceUtil.handle("Error during resolving of '" + src + "'.", se); + } + } // setup the jxpath transformer for this thread // FIX ME: When we decide proper way to pass "bean" and "kont" Object bean = ((Environment)resolver).getAttribute("bean-dict"); @@ -226,34 +226,34 @@ String getExpr(String inStr) { try { - inStr = inStr.trim(); - if (inStr.length() == 0 || inStr.charAt(0) != '{') { - return inStr; - } + inStr = inStr.trim(); + if (inStr.length() == 0 || inStr.charAt(0) != '{') { + return inStr; + } StringReader in = new StringReader(inStr); int ch; StringBuffer expr = new StringBuffer(); - in.read(); // '{' + in.read(); // '{' while ((ch = in.read()) != -1) { char c = (char)ch; - if (c == '}') { - break; - } else if (c == '\\') { - ch = in.read(); - if (ch == -1) { - expr.append('\\'); - } else { - expr.append((char)ch); - } - } else { - expr.append(c); - } - } - return expr.toString(); + if (c == '}') { + break; + } else if (c == '\\') { + ch = in.read(); + if (ch == -1) { + expr.append('\\'); + } else { + expr.append((char)ch); + } + } else { + expr.append(c); + } + } + return expr.toString(); } catch (IOException ignored) { ignored.printStackTrace(); } - return inStr; + return inStr; } /** @@ -451,7 +451,7 @@ if (varName.equals("continuation")) { return kont; } - return null; + return null; } public void declareVariable(String varName, Object value) { 1.4 +11 -12 cocoon-2.1/src/scratchpad/src/org/apache/cocoon/transformation/JexlTransformer.java Index: JexlTransformer.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/scratchpad/src/org/apache/cocoon/transformation/JexlTransformer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- JexlTransformer.java 6 Apr 2003 06:41:40 -0000 1.3 +++ JexlTransformer.java 6 Apr 2003 17:14:57 -0000 1.4 @@ -402,7 +402,7 @@ /** namespace constant */ public static final String JEXL_NAMESPACE_URI - = "http://cocoon.apache.org/transformation/jexl/1.0"; + = "http://cocoon.apache.org/transformation/jexl/1.0"; public static final String JEXL_CHOOSE = "choose"; @@ -488,7 +488,7 @@ public void generate() throws IOException, SAXException, ProcessingException { - try { + try { this.resolver.toSAX(this.inputSource, this); } catch (SAXException e) { if (e instanceof SAXParseException) { @@ -535,13 +535,13 @@ throws ProcessingException, SAXException, IOException { super.setup(resolver, objectModel, src, parameters); - if (src != null) { - try { - this.inputSource = resolver.resolveURI(src); - } catch (SourceException se) { - throw SourceUtil.handle("Error during resolving of '" + src + "'.", se); - } - } + if (src != null) { + try { + this.inputSource = resolver.resolveURI(src); + } catch (SourceException se) { + throw SourceUtil.handle("Error during resolving of '" + src + "'.", se); + } + } Object bean = ((Environment)resolver).getAttribute("bean-dict"); kont = (WebContinuation)((Environment)resolver).getAttribute("kont"); chooseStack = new Stack(); @@ -788,7 +788,6 @@ return jexlContext; } - private JXPathContext getJXPathContext() { return (JXPathContext)jxpathContextStack.peek(); } @@ -806,7 +805,7 @@ if (varName.equals("continuation")) { return kont; } - return null; + return null; } public void declareVariable(String varName, Object value) {