Update of /cvsroot/xdoclet/xdoclet/core/src/xdoclet In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23104/core/src/xdoclet
Modified Files: XmlSubTask.java Log Message: Added support for XML Schema validation (XDT-1284) Index: XmlSubTask.java =================================================================== RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/XmlSubTask.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** XmlSubTask.java 10 Oct 2004 22:32:16 -0000 1.22 --- XmlSubTask.java 1 Mar 2005 21:00:10 -0000 1.23 *************** *** 6,9 **** --- 6,12 ---- import java.net.URL; + import java.util.ArrayList; + import java.util.Collection; + import java.util.Iterator; import org.apache.commons.logging.Log; *************** *** 40,43 **** --- 43,48 ---- private String schema = null; + private URL schemaURL = null; + /** * Gets the UseIds attribute of the XmlSubTask object. *************** *** 111,114 **** --- 116,129 ---- /** + * Gets the SchemaURL attribute of the XmlSubTask object. + * + * @return The SchemaURL value + */ + public URL getSchemaURL() + { + return schemaURL; + } + + /** * If this attribute is set to true, XDoclet will generate id attributes in the XML document. Note that this is only * available in some subtasks. *************** *** 193,197 **** if (shouldValidate()) { ! XmlValidator.getInstance().registerDTD(getPublicId(), getDtdURL()); } --- 208,219 ---- if (shouldValidate()) { ! XmlValidator validator = XmlValidator.getInstance(); ! ! if (getPublicId() != null) { ! validator.registerDTD(getPublicId(), getDtdURL()); ! } ! if (getSchemaURL() != null) { ! validator.registerSchema(getSchemaURL()); ! } } *************** *** 203,206 **** --- 225,238 ---- /** + * Sets the SchemaURL attribute of the XmlSubTask object. + * + * @param url The new SchemaURL value + */ + protected void setSchemaURL(URL url) + { + this.schemaURL = url; + } + + /** * Sets the DtdURL attribute of the XmlSubTask object. * *************** *** 254,258 **** private boolean shouldValidate() { ! return isValidateXML() && getPublicId() != null && getDtdURL() != null; } } --- 286,290 ---- private boolean shouldValidate() { ! return isValidateXML() && (getPublicId() != null && getDtdURL() != null) || schema != null; } } ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ xdoclet-devel mailing list xdoclet-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/xdoclet-devel