dion 2004/09/09 05:24:41
Modified: jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml
ParamTag.java ParseTagSupport.java IfTag.java
SortTag.java ForEachTag.java ExprTag.java
AttributeTag.java DoctypeTag.java CopyOfTag.java
ParseTag.java XMLTagLibrary.java CommentTag.java
TransformTag.java
jelly/jelly-tags/xml/src/test/org/apache/commons/jelly/tags/xml
TestJelly.java TestXMLTags.java TestParser.java
Log:
Fix license file whitespace
Revision Changes Path
1.5 +5 -5
jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/ParamTag.java
Index: ParamTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/ParamTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ParamTag.java 25 Feb 2004 01:31:50 -0000 1.4
+++ ParamTag.java 9 Sep 2004 12:24:40 -0000 1.5
@@ -1,12 +1,12 @@
/*
* Copyright 2002,2004 The Apache Software Foundation.
- *
+ *
* Licensed 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 KIND, either express or implied.
@@ -44,7 +44,7 @@
throw new JellyTagException( "<param> tag must be enclosed inside a
<transform> tag" );
}
Object value = this.getValue();
- if (value == null) {
+ if (value == null) {
value = getBodyText();
}
1.6 +25 -25
jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/ParseTagSupport.java
Index: ParseTagSupport.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/ParseTagSupport.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- ParseTagSupport.java 25 Feb 2004 01:31:50 -0000 1.5
+++ ParseTagSupport.java 9 Sep 2004 12:24:40 -0000 1.6
@@ -1,12 +1,12 @@
/*
* Copyright 2002,2004 The Apache Software Foundation.
- *
+ *
* Licensed 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 KIND, either express or implied.
@@ -33,7 +33,7 @@
import org.dom4j.io.SAXReader;
import org.xml.sax.SAXException;
-/**
+/**
* An abstract base class for any tag which parsers its body as XML.
*
* @author <a href="mailto:[EMAIL PROTECTED]">James Strachan</a>
@@ -46,7 +46,7 @@
/** The variable that will be generated for the document */
private String var;
-
+
/** The markup text to be parsed */
private String text;
@@ -58,7 +58,7 @@
// Properties
- //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
/** The variable name that will be used for the Document variable created
*/
public String getVar() {
@@ -87,7 +87,7 @@
this.text = text;
}
-
+
/** @return the SAXReader used for parsing, creating one lazily if need be */
public SAXReader getSAXReader() throws SAXException {
if (saxReader == null) {
@@ -100,24 +100,24 @@
public void setSAXReader(SAXReader saxReader) {
this.saxReader = saxReader;
}
-
+
// Implementation methods
- //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
/**
* Factory method to create a new SAXReader
- */
+ */
protected abstract SAXReader createSAXReader() throws SAXException;
-
-
+
+
/**
* Parses the body of this tag and returns the parsed document
*/
protected Document parseBody(XMLOutput output) throws JellyTagException {
SAXContentHandler handler = new SAXContentHandler();
XMLOutput newOutput = new XMLOutput(handler);
-
+
try {
handler.startDocument();
invokeBody( newOutput);
@@ -127,7 +127,7 @@
throw new JellyTagException(e);
}
}
-
+
/**
* Parses the give piece of text as being markup
*/
@@ -135,13 +135,13 @@
if ( log.isDebugEnabled() ) {
log.debug( "About to parse: " + text );
}
-
+
try {
return getSAXReader().read( new StringReader( text ) );
- }
+ }
catch (DocumentException e) {
throw new JellyTagException(e);
- }
+ }
catch (SAXException e) {
throw new JellyTagException(e);
}
@@ -149,18 +149,18 @@
/**
* Parses the given source
- */
+ */
protected Document parse(Object source) throws JellyTagException {
// #### we should allow parsing to output XML events to
// the output if no var is specified
-
-
+
+
try {
if (source instanceof String) {
String uri = (String) source;
source = context.getResource(uri);
}
-
+
if (source instanceof URL) {
return getSAXReader().read((URL) source);
}
@@ -181,13 +181,13 @@
+ " with value: "
+ source);
}
- }
+ }
catch (DocumentException e) {
throw new JellyTagException(e);
- }
+ }
catch (SAXException e) {
throw new JellyTagException(e);
- }
+ }
catch (MalformedURLException e) {
throw new JellyTagException(e);
}
1.5 +14 -14
jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/IfTag.java
Index: IfTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/IfTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- IfTag.java 25 Feb 2004 01:31:50 -0000 1.4
+++ IfTag.java 9 Sep 2004 12:24:40 -0000 1.5
@@ -1,12 +1,12 @@
/*
* Copyright 2002,2004 The Apache Software Foundation.
- *
+ *
* Licensed 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 KIND, either express or implied.
@@ -22,9 +22,9 @@
import org.jaxen.JaxenException;
import org.jaxen.XPath;
-/**
+/**
* Evaluates the XPath expression to be a boolean and only evaluates the body
- * if the expression is true.
+ * if the expression is true.
* @author <a href="mailto:[EMAIL PROTECTED]">James Strachan</a>
* @version $Revision$
*/
@@ -37,14 +37,14 @@
}
// Tag interface
- //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
public void doTag(XMLOutput output) throws MissingAttributeException,
JellyTagException {
if (select == null) {
throw new MissingAttributeException( "select" );
}
-
+
Object xpathContext = getXPathContext();
-
+
try {
if ( select.booleanValueOf(xpathContext) ) {
invokeBody(output);
@@ -55,21 +55,21 @@
}
// Properties
- //-------------------------------------------------------------------------
-
+ //-------------------------------------------------------------------------
+
/** Sets the XPath expression to evaluate. */
public void setSelect(XPath select) {
this.select = select;
}
// Implementation methods
- //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
protected Object getXPathContext() {
- ForEachTag tag = (ForEachTag) findAncestorWithClass( ForEachTag.class );
+ ForEachTag tag = (ForEachTag) findAncestorWithClass( ForEachTag.class );
if ( tag != null ) {
return tag.getXPathContext();
}
return null;
}
-
+
}
1.5 +4 -4
jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/SortTag.java
Index: SortTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/SortTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- SortTag.java 25 Feb 2004 01:31:50 -0000 1.4
+++ SortTag.java 9 Sep 2004 12:24:40 -0000 1.5
@@ -1,12 +1,12 @@
/*
* Copyright 2002,2004 The Apache Software Foundation.
- *
+ *
* Licensed 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 KIND, either express or implied.
1.5 +13 -13
jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/ForEachTag.java
Index: ForEachTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/ForEachTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ForEachTag.java 25 Feb 2004 01:31:50 -0000 1.4
+++ ForEachTag.java 9 Sep 2004 12:24:40 -0000 1.5
@@ -1,12 +1,12 @@
/*
* Copyright 2002,2004 The Apache Software Foundation.
- *
+ *
* Licensed 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 KIND, either express or implied.
@@ -51,15 +51,15 @@
public ForEachTag() {
}
-
+
// Tag interface
- //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
public void doTag(XMLOutput output) throws JellyTagException {
if (select != null) {
List nodes = null;
try {
nodes = select.selectNodes( getXPathContext() );
- }
+ }
catch (JaxenException e) {
throw new JellyTagException(e);
}
@@ -79,9 +79,9 @@
}
}
}
-
+
// XPathSource interface
- //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
/**
* @return the current XPath iteration value
@@ -90,9 +90,9 @@
public Object getXPathSource() {
return iterationValue;
}
-
+
// Properties
- //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
/** Sets the XPath selection expression
*/
public void setSelect(XPath select) {
@@ -119,12 +119,12 @@
if (xpCmp == null) xpCmp = new XPathComparator();
xpCmp.setDescending(descending);
}
-
+
/*
* Override superclass so method can be access by IfTag
*/
protected Object getXPathContext() {
return super.getXPathContext();
}
-
+
}
1.5 +9 -9
jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/ExprTag.java
Index: ExprTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/ExprTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ExprTag.java 25 Feb 2004 01:31:50 -0000 1.4
+++ ExprTag.java 9 Sep 2004 12:24:40 -0000 1.5
@@ -1,12 +1,12 @@
/*
* Copyright 2002,2004 The Apache Software Foundation.
- *
+ *
* Licensed 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 KIND, either express or implied.
@@ -38,20 +38,20 @@
}
// Tag interface
- //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
public void doTag(XMLOutput output) throws MissingAttributeException,
JellyTagException {
Object xpathContext = getXPathContext();
-
+
if (select == null) {
throw new MissingAttributeException( "select" );
}
-
+
try {
String text = select.stringValueOf(xpathContext);
if ( text != null ) {
output.write(text);
}
- }
+ }
catch (SAXException e) {
throw new JellyTagException(e);
}
@@ -61,7 +61,7 @@
}
// Properties
- //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
/** Sets the XPath expression to evaluate. */
public void setSelect(XPath select) {
this.select = select;
1.6 +12 -12
jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/AttributeTag.java
Index: AttributeTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/AttributeTag.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- AttributeTag.java 10 Jul 2004 02:15:39 -0000 1.5
+++ AttributeTag.java 9 Sep 2004 12:24:40 -0000 1.6
@@ -1,12 +1,12 @@
/*
* Copyright 2002,2004 The Apache Software Foundation.
- *
+ *
* Licensed 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 KIND, either express or implied.
@@ -19,21 +19,21 @@
import org.apache.commons.jelly.TagSupport;
import org.apache.commons.jelly.XMLOutput;
-/** Adds an XML attribute to the parent element tag like
+/** Adds an XML attribute to the parent element tag like
* the <code><xsl:attribute></code> tag.
*
* @author James Strachan
* @version $Revision$
*/
public class AttributeTag extends TagSupport {
-
+
/** the name of the attribute. */
private String name;
-
+
public AttributeTag() {
}
-
+
// Tag interface
//-------------------------------------------------------------------------
public void doTag(XMLOutput output) throws JellyTagException {
@@ -43,17 +43,17 @@
}
tag.setAttributeValue( getName(), getBodyText( false ) );
}
-
+
// Properties
//-------------------------------------------------------------------------
-
- /**
+
+ /**
* @return the name of the attribute.
*/
public String getName() {
return name;
}
- /**
+ /**
* Sets the name of the attribute
*/
public void setName(String name) {
1.5 +10 -10
jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/DoctypeTag.java
Index: DoctypeTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/DoctypeTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DoctypeTag.java 25 Feb 2004 01:31:50 -0000 1.4
+++ DoctypeTag.java 9 Sep 2004 12:24:40 -0000 1.5
@@ -1,12 +1,12 @@
/*
* Copyright 2002,2004 The Apache Software Foundation.
- *
+ *
* Licensed 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 KIND, either express or implied.
@@ -22,7 +22,7 @@
import org.xml.sax.SAXException;
-/**
+/**
* A tag which outputs a DOCTYPE declaration to the current XML output pipe.
* Note that there should only be a single DOCTYPE declaration in any XML stream and
* it should occur before any element content.
@@ -40,12 +40,12 @@
}
// Tag interface
- //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
public void doTag(XMLOutput output) throws MissingAttributeException,
JellyTagException {
if (name == null) {
throw new MissingAttributeException( "name" );
}
-
+
try {
output.startDTD(name, publicId, systemId);
invokeBody(output);
@@ -56,7 +56,7 @@
}
// Properties
- //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
/**
* Returns the name.
* @return String
@@ -82,14 +82,14 @@
}
/**
- * Sets the document type name of the DOCTYPE
+ * Sets the document type name of the DOCTYPE
*/
public void setName(String name) {
this.name = name;
}
/**
- * Sets the declared public identifier for DTD
+ * Sets the declared public identifier for DTD
*/
public void setPublicId(String publicId) {
this.publicId = publicId;
1.6 +12 -12
jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/CopyOfTag.java
Index: CopyOfTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/CopyOfTag.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- CopyOfTag.java 27 Aug 2004 04:37:45 -0000 1.5
+++ CopyOfTag.java 9 Sep 2004 12:24:40 -0000 1.6
@@ -1,12 +1,12 @@
/*
* Copyright 2002,2004 The Apache Software Foundation.
- *
+ *
* Licensed 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 KIND, either express or implied.
@@ -36,39 +36,39 @@
/** The XPath expression to evaluate. */
private XPath select;
-
+
/** Should we output lexical XML data like comments
* or entity names?
*/
private boolean lexical;
-
+
public CopyOfTag() {
}
// Tag interface
- //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
public void doTag(XMLOutput output) throws MissingAttributeException,
JellyTagException {
Object xpathContext = getXPathContext();
-
+
if (select == null) {
throw new MissingAttributeException( "select" );
}
SAXWriter saxWriter;
-
+
if (lexical) {
saxWriter = new SAXWriter(output, output);
} else {
saxWriter = new SAXWriter(output);
}
-
+
Object obj;
try {
obj = select.evaluate(xpathContext);
} catch (JaxenException e) {
throw new JellyTagException("Failed to evaluate XPath expression", e);
}
-
+
try {
if (obj instanceof List) {
List nodes = (List) obj;
@@ -92,12 +92,12 @@
}
// Properties
- //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
/** Sets the XPath expression to evaluate. */
public void setSelect(XPath select) {
this.select = select;
}
-
+
public void setLexical(boolean lexical) {
this.lexical = lexical;
}
1.7 +9 -9
jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/ParseTag.java
Index: ParseTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/ParseTag.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ParseTag.java 25 Feb 2004 01:31:50 -0000 1.6
+++ ParseTag.java 9 Sep 2004 12:24:40 -0000 1.7
@@ -1,12 +1,12 @@
/*
* Copyright 2002,2004 The Apache Software Foundation.
- *
+ *
* Licensed 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 KIND, either express or implied.
@@ -51,8 +51,8 @@
if (getVar() == null) {
throw new MissingAttributeException("The var attribute cannot be null");
}
-
- Document document = getXmlDocument(output);
+
+ Document document = getXmlDocument(output);
context.setVariable(getVar(), document);
}
@@ -92,20 +92,20 @@
protected Document getXmlDocument(XMLOutput output) throws JellyTagException {
Document document = null;
Object xmlObj = this.getXml();
-
+
if (xmlObj == null) {
String text = getText();
if (text != null) {
document = parseText(text);
}
- else {
+ else {
document = parseBody(output);
}
}
else {
document = parse(xmlObj);
}
-
+
return document;
}
1.5 +5 -5
jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/XMLTagLibrary.java
Index: XMLTagLibrary.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/XMLTagLibrary.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- XMLTagLibrary.java 25 Feb 2004 01:31:50 -0000 1.4
+++ XMLTagLibrary.java 9 Sep 2004 12:24:40 -0000 1.5
@@ -1,12 +1,12 @@
/*
* Copyright 2002,2004 The Apache Software Foundation.
- *
+ *
* Licensed 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 KIND, either express or implied.
@@ -76,7 +76,7 @@
}
Expression xpathExpr = createXPathTextExpression( attributeValue );
-
+
return new XPathExpression(attributeValue,
xpathExpr,
tagScript);
1.5 +9 -9
jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/CommentTag.java
Index: CommentTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/CommentTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- CommentTag.java 25 Feb 2004 01:31:50 -0000 1.4
+++ CommentTag.java 9 Sep 2004 12:24:40 -0000 1.5
@@ -1,12 +1,12 @@
/*
* Copyright 2002,2004 The Apache Software Foundation.
- *
+ *
* Licensed 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 KIND, either express or implied.
@@ -21,7 +21,7 @@
import org.xml.sax.SAXException;
-/**
+/**
* A tag which outputs a comment to the underlying XMLOutput based on the
* contents of its body.
*
@@ -31,12 +31,12 @@
public class CommentTag extends XPathTagSupport {
private String text;
-
+
public CommentTag() {
}
// Tag interface
- //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
public void doTag(XMLOutput output) throws JellyTagException {
String text = getText();
if (text == null) {
@@ -51,7 +51,7 @@
}
// Properties
- //-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
/**
* Returns the text.
* @return String
@@ -63,7 +63,7 @@
/**
* Sets the comment text. If no text is specified then the body of the tag
* is used instead.
- *
+ *
* @param text The comment text to use
*/
public void setText(String text) {
1.5 +12 -12
jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/TransformTag.java
Index: TransformTag.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/jelly-tags/xml/src/java/org/apache/commons/jelly/tags/xml/TransformTag.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TransformTag.java 25 Feb 2004 01:31:50 -0000 1.4
+++ TransformTag.java 9 Sep 2004 12:24:40 -0000 1.5
@@ -1,12 +1,12 @@
/*
* Copyright 2002,2004 The Apache Software Foundation.
- *
+ *
* Licensed 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 KIND, either express or implied.
@@ -118,11 +118,11 @@
// set a resolver to locate uri
this.tf.setURIResolver(createURIResolver());
-
+
try {
this.transformerHandler =
this.tf.newTransformerHandler(this.getObjAsSAXSource(this.getXslt()));
- }
+ }
catch (TransformerConfigurationException e) {
throw new JellyTagException(e);
}
@@ -153,10 +153,10 @@
Document transformedDoc = result.getDocument();
this.context.setVariable(varName, transformedDoc);
}
- }
+ }
catch (SAXException e) {
throw new JellyTagException(e);
- }
+ }
catch (IOException e) {
throw new JellyTagException(e);
}
@@ -363,18 +363,18 @@
for (Iterator iter = scriptList.iterator(); iter.hasNext(); ) {
Script script = (Script) iter.next();
if (script instanceof TagScript) {
-
+
Tag tag = null;
try {
tag = ((TagScript) script).getTag();
} catch (JellyException e) {
throw new JellyTagException(e);
}
-
+
if (tag instanceof ParamTag) {
script.run(context, output);
}
-
+
}
}
1.4 +7 -7
jakarta-commons/jelly/jelly-tags/xml/src/test/org/apache/commons/jelly/tags/xml/TestJelly.java
Index: TestJelly.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/jelly-tags/xml/src/test/org/apache/commons/jelly/tags/xml/TestJelly.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TestJelly.java 25 Feb 2004 01:31:52 -0000 1.3
+++ TestJelly.java 9 Sep 2004 12:24:41 -0000 1.4
@@ -1,12 +1,12 @@
/*
* Copyright 2002,2004 The Apache Software Foundation.
- *
+ *
* Licensed 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 KIND, either express or implied.
@@ -20,7 +20,7 @@
import org.apache.commons.jelly.tags.junit.JellyTestSuite;
-/**
+/**
* A helper class to run jelly test cases as part of Ant's JUnit tests
*
* @author <a href="mailto:[EMAIL PROTECTED]">James Strachan</a>
@@ -31,8 +31,8 @@
public static void main( String[] args ) throws Exception {
TestRunner.run( suite() );
}
-
+
public static TestSuite suite() throws Exception {
- return createTestSuite(TestJelly.class, "suite.jelly");
+ return createTestSuite(TestJelly.class, "suite.jelly");
}
}
1.4 +9 -9
jakarta-commons/jelly/jelly-tags/xml/src/test/org/apache/commons/jelly/tags/xml/TestXMLTags.java
Index: TestXMLTags.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/jelly-tags/xml/src/test/org/apache/commons/jelly/tags/xml/TestXMLTags.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- TestXMLTags.java 25 Feb 2004 01:31:52 -0000 1.3
+++ TestXMLTags.java 9 Sep 2004 12:24:41 -0000 1.4
@@ -1,12 +1,12 @@
/*
* Copyright 2002,2004 The Apache Software Foundation.
- *
+ *
* Licensed 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 KIND, either express or implied.
@@ -46,7 +46,7 @@
/** The Log to which logging calls will be made. */
private static final Log log = LogFactory.getLog(TestXMLTags.class);
-
+
/** basedir for test source */
private static final String testBaseDir
="src/test/org/apache/commons/jelly/tags/xml";
@@ -114,25 +114,25 @@
}
public void testTransformSAXOutputNestedTransforms() throws Exception {
- String text = evaluteScriptAsText(testBaseDir +
+ String text = evaluteScriptAsText(testBaseDir +
"/transformExampleSAXOutputNestedTransforms.jelly");
assertEquals("Produces the correct output", "It works!", text);
}
public void testTransformSchematron() throws Exception {
- String text = evaluteScriptAsText(testBaseDir +
+ String text = evaluteScriptAsText(testBaseDir +
"/schematron/transformSchematronExample.jelly");
assertEquals("Produces the correct output", "Report count=1:assert
count=2", text);
}
public void testTransformXmlVar() throws Exception {
- String text = evaluteScriptAsText(testBaseDir +
+ String text = evaluteScriptAsText(testBaseDir +
"/transformExampleXmlVar.jelly");
assertEquals("Produces the correct output", "It works!", text);
}
public void testDoctype() throws Exception {
- String text = evaluteScriptAsText(testBaseDir +
+ String text = evaluteScriptAsText(testBaseDir +
"/testDoctype.jelly");
assertEquals("Produces the correct output", "<!DOCTYPE foo PUBLIC
\"publicID\" \"foo.dtd\">\n<foo></foo>", text);
}
1.5 +9 -9
jakarta-commons/jelly/jelly-tags/xml/src/test/org/apache/commons/jelly/tags/xml/TestParser.java
Index: TestParser.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/jelly/jelly-tags/xml/src/test/org/apache/commons/jelly/tags/xml/TestParser.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TestParser.java 25 Feb 2004 01:31:52 -0000 1.4
+++ TestParser.java 9 Sep 2004 12:24:41 -0000 1.5
@@ -1,12 +1,12 @@
/*
* Copyright 2002,2004 The Apache Software Foundation.
- *
+ *
* Licensed 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 KIND, either express or implied.
@@ -63,9 +63,9 @@
XMLParser parser = new XMLParser();
Script script = parser.parse(in);
script = script.compile();
-
+
log.debug("Found: " + script);
-
+
assertTagsHaveParent( script, null );
}
@@ -75,11 +75,11 @@
*/
protected void assertTagsHaveParent(Script script, Tag parent) throws Exception
{
if ( script instanceof TagScript ) {
- TagScript tagScript = (TagScript) script;
+ TagScript tagScript = (TagScript) script;
Tag tag = tagScript.getTag();
-
+
assertEquals( "Tag: " + tag + " has the incorrect parent", parent,
tag.getParent() );
-
+
assertTagsHaveParent( tag.getBody(), tag );
}
else if ( script instanceof ScriptBlock ) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]