cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r126530 - /cocoon/trunk/tools/src/anttasks/XConfToolTask.java
Date Wed, 26 Jan 2005 19:18:51 GMT
Author: cziegeler
Date: Wed Jan 26 11:18:50 2005
New Revision: 126530

URL: http://svn.apache.org/viewcvs?view=rev&rev=126530
Log:
Better error message when xpath attribute is missing
Modified:
   cocoon/trunk/tools/src/anttasks/XConfToolTask.java

Modified: cocoon/trunk/tools/src/anttasks/XConfToolTask.java
Url: http://svn.apache.org/viewcvs/cocoon/trunk/tools/src/anttasks/XConfToolTask.java?view=diff&rev=126530&p1=cocoon/trunk/tools/src/anttasks/XConfToolTask.java&r1=126529&p2=cocoon/trunk/tools/src/anttasks/XConfToolTask.java&r2=126530
==============================================================================
--- cocoon/trunk/tools/src/anttasks/XConfToolTask.java	(original)
+++ cocoon/trunk/tools/src/anttasks/XConfToolTask.java	Wed Jan 26 11:18:50 2005
@@ -1,5 +1,5 @@
 /*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 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.
@@ -227,7 +227,7 @@
         String extension = filename.lastIndexOf(".")>0?filename.substring(filename.lastIndexOf(".")+1):"";
         String basename = basename(filename);
 
-	if (!elem.getTagName().equals(extension)) {
+        if (!elem.getTagName().equals(extension)) {
             throw new BuildException("Not a valid xpatch file: "+filename);
         }
 
@@ -238,7 +238,9 @@
 
         // Get 'root' node were 'component' will be inserted into
         String xpath = getAttribute(elem, "xpath", replaceProperties);
-
+        if ( xpath == null ) {
+            throw new IOException("Attribute 'xpath' is required.");    
+        }
         NodeList nodes = XPathAPI.selectNodeList(configuration, xpath);
 
         // Suspend, because the xpath returned not one node

Mime
View raw message