jstrachan 01/10/09 03:23:25
Modified: xtags/src/org/apache/taglibs/xtags/xpath ParseTag.java
xtags/xml xtags.xml
Log:
The <xtags:parse> tag can now take an optional flag to indicate whether validation
should be performed or not
Revision Changes Path
1.2 +14 -1
jakarta-taglibs/xtags/src/org/apache/taglibs/xtags/xpath/ParseTag.java
Index: ParseTag.java
===================================================================
RCS file:
/home/cvs/jakarta-taglibs/xtags/src/org/apache/taglibs/xtags/xpath/ParseTag.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ParseTag.java 2001/07/24 13:44:22 1.1
+++ ParseTag.java 2001/10/09 10:23:25 1.2
@@ -100,6 +100,9 @@
private Document document;
+ /** Sets whether validation mode is on or off */
+ private boolean validate;
+
public ParseTag() {
}
@@ -149,6 +152,7 @@
url = null;
reader = null;
document = null;
+ validate = false;
}
// Properties
@@ -192,6 +196,15 @@
this.reader = reader;
}
+ public boolean getValidate() {
+ return validate;
+ }
+
+ public void setValidate(boolean validate) {
+ this.validate = validate;
+ }
+
+
// Implementation methods
//-------------------------------------------------------------------------
protected SAXReader getSAXReader() throws SAXException {
@@ -210,7 +223,7 @@
catch (Throwable t) {
// ignore any errors
}
- return new SAXReader();
+ return new SAXReader(validate);
}
protected void defineVariable( Document document ) {
1.14 +15 -0 jakarta-taglibs/xtags/xml/xtags.xml
Index: xtags.xml
===================================================================
RCS file: /home/cvs/jakarta-taglibs/xtags/xml/xtags.xml,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- xtags.xml 2001/09/26 07:53:32 1.13
+++ xtags.xml 2001/10/09 10:23:25 1.14
@@ -566,6 +566,14 @@
Allows a Reader of the stream to be parsed as XML to be specified
</description>
</attribute>
+ <attribute>
+ <name>validate</name>
+ <required>false</required>
+ <rtexprvalue>true</rtexprvalue>
+ <description>
+ Specifies whether validation should be enabled or disabled.
+ </description>
+ </attribute>
<script-variable>If the id attribute is set the variable with that id will be
defined for the document</script-variable>
<restrictions>None</restrictions>
<example><usage>
@@ -1324,6 +1332,13 @@
</tagtoc>
</taglib>
+
+<revision release="Patches" date="10/09/2001">
+ <description>
+ The <xtags:parse> tag can now take an optional
+ boolean flag to enable XML validation as the document is parsed.
+ </description>
+</revision>
<revision release="Patches" date="09/26/2001">
<description>