You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cactus-dev@jakarta.apache.org by cm...@apache.org on 2003/05/10 14:47:21 UTC
cvs commit: jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant WebXmlMergeTask.java
cmlenz 2003/05/10 05:47:21
Modified: integration/ant/src/java/org/apache/cactus/integration/ant/webxml
Tag: CACTUS_14_ANT_BRANCH WebXmlIo.java
integration/ant/src/java/org/apache/cactus/integration/ant
Tag: CACTUS_14_ANT_BRANCH WebXmlMergeTask.java
Log:
Change the strategy for XMLCatalog support: if the user specifies an XMLCatalog, it will be used instead of the built-in resolver
Revision Changes Path
No revision
No revision
1.1.2.5 +9 -22 jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/webxml/Attic/WebXmlIo.java
Index: WebXmlIo.java
===================================================================
RCS file: /home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/webxml/Attic/WebXmlIo.java,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- WebXmlIo.java 8 May 2003 13:17:06 -0000 1.1.2.4
+++ WebXmlIo.java 10 May 2003 12:47:21 -0000 1.1.2.5
@@ -100,22 +100,6 @@
{
/**
- * The nested entity resolver.
- */
- private EntityResolver nestedResolver;
-
- /**
- * Constructor.
- *
- * @param theNestedResolver The resolver to delegate to, or
- * <code>null</code>
- */
- public WebXmlEntityResolver(EntityResolver theNestedResolver)
- {
- this.nestedResolver = theNestedResolver;
- }
-
- /**
* @see org.xml.sax.EntityResolver#resolveEntity
*/
public InputSource resolveEntity(String thePublicId, String theSystemId)
@@ -136,10 +120,6 @@
}
System.err.println("Resource for public ID " + thePublicId
+ " not found");
- if (nestedResolver != null)
- {
- nestedResolver.resolveEntity(thePublicId, theSystemId);
- }
return null;
}
@@ -273,7 +253,14 @@
factory.setValidating(false);
factory.setNamespaceAware(false);
DocumentBuilder builder = factory.newDocumentBuilder();
- builder.setEntityResolver(new WebXmlEntityResolver(null));
+ if (theEntityResolver != null)
+ {
+ builder.setEntityResolver(theEntityResolver);
+ }
+ else
+ {
+ builder.setEntityResolver(new WebXmlEntityResolver());
+ }
return new WebXml(builder.parse(theInput));
}
No revision
No revision
1.11.2.5 +7 -10 jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/WebXmlMergeTask.java
Index: WebXmlMergeTask.java
===================================================================
RCS file: /home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/WebXmlMergeTask.java,v
retrieving revision 1.11.2.4
retrieving revision 1.11.2.5
diff -u -r1.11.2.4 -r1.11.2.5
--- WebXmlMergeTask.java 1 May 2003 13:39:26 -0000 1.11.2.4
+++ WebXmlMergeTask.java 10 May 2003 12:47:21 -0000 1.11.2.5
@@ -119,19 +119,11 @@
/**
* For resolving entities such as DTDs.
*/
- private XMLCatalog xmlCatalog = new XMLCatalog();
+ private XMLCatalog xmlCatalog = null;
// Public Methods ----------------------------------------------------------
/**
- * @see org.apache.tools.ant.Task#init()
- */
- public void init() throws BuildException
- {
- this.xmlCatalog.setProject(project);
- }
-
- /**
* @see Task#execute()
*/
public void execute() throws BuildException
@@ -202,6 +194,11 @@
*/
public final void addConfiguredXMLCatalog(XMLCatalog theXmlCatalog)
{
+ if (this.xmlCatalog == null)
+ {
+ this.xmlCatalog = new XMLCatalog();
+ this.xmlCatalog.setProject(getProject());
+ }
this.xmlCatalog.addConfiguredXMLCatalog(theXmlCatalog);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: cactus-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: cactus-dev-help@jakarta.apache.org