Hi,

Yes. Your path should be:

/web-site[@port='8888']

without a trailing '/'. Old implementations of XPath used to accept the trailing '/', but that's been tightened up now. My documentation used to refer to a trailing slash, but I've corrected this. If you've found some doc that's wrong, I'll correct...

Think that should sort you out!

Brian

Sandeep Watts wrote:
Hi Brian,
Thanks for the response.
I am using a fairly simple xml that uses xmltask. As u
asked for JVM version, i checked the same and now its
set to jdk1.4.2

The exception has changed and is :

  [xmltask] javax.xml.transform.TransformerException:
A location step was expected following the '/' or '//'
token.
  [xmltask]     at
org.apache.xpath.compiler.XPathParser.error(XPathParser.java:649)
  [xmltask]     at
org.apache.xpath.compiler.XPathParser.RelativeLocationPath(XPathParser.java:1626)
  [xmltask]     at
org.apache.xpath.compiler.XPathParser.LocationPath(XPathParser.java:1584)
  [xmltask]     at
org.apache.xpath.compiler.XPathParser.PathExpr(XPathParser.java:1306)
  [xmltask]     at
org.apache.xpath.compiler.XPathParser.UnionExpr(XPathParser.java:1225)
  [xmltask]     at
org.apache.xpath.compiler.XPathParser.UnaryExpr(XPathParser.java:1131)
  [xmltask]     at
org.apache.xpath.compiler.XPathParser.MultiplicativeExpr(XPathParser.java:1052)

The xml file is as under:
<project basedir="." name="conf" default="configApp">
	<taskdef name="xmltask"
classname="com.oopsconsultancy.xmltask.ant.XmlTask"/>

	<property file="conf.properties"/>

	<target name="clean1">
		 <xmltask source="${j2ee.home}/http-web-site.xml"
dest="${j2ee.home}/http-web-site.xml">
			<cut
path="/web-site/web-app[@application='myAppl']" 
buffer="namedBuffer1"/>
	   </xmltask> 
	</target>	


	<target name="configApp" depends="clean1">
		<xmltask source="${j2ee.home}/http-web-site.xml"
dest="${j2ee.home}/http-web-site.xml">
			<attr path=	"/web-site[@port='8888']/" attr="port"
value="7777"/>
	   </xmltask>
	</target>
</project>


Has this sthng to do with the syntax ??
I cant figure that out.

Thanks,
Sandeep





--- Brian Agnew <brian@oopsconsultancy.com> wrote:

  
Can you post your jvm version, and your build.xml
and the document 
you're reading from, pls ? I have *no* idea what a
DTMLiaison is, I have 
to say! But I use Linux with no problems so don't
anticipate any major 
problems.

Sandeep Watts wrote:

    
Hi,
I am using the xmltask in my xml file which works
      
fine on WIN 2K after 
    
setting the PATH and CLASSPATH Variables. Same way
      
when i try on Linux 
    
this does not work and gives the following
      
exception:
    
 
  [xmltask]
      
javax.xml.transform.TransformerException: Cannot use
a 
    
DTMLiaison for a input DOM node... pass a
      
org.apache.xpath.DOM2Helper 
    
instead!
  [xmltask]    at
      
org.apache.xpath.compiler.XPathParser.error(int, 
    
java.lang.O
  [xmltask] bject[])
      
(/usr/lib/lib-org-apache-xalan-2.4.1.so)
    
  [xmltask]    at 

      
org.apache.xpath.compiler.XPathParser.RelativeLocationPath()
  
(/usr/lib/lib-org-apache-xalan-2.4.1.so)
  [xmltask]    at
      
org.apache.xpath.compiler.XPathParse
    
  [xmltask] r.LocationPath()
      
(/usr/lib/lib-org-apache-xalan-2.4.1.so)
    
  [xmltask]    at
      
org.apache.xpath.compiler.XPathParser.PathExpr() 
    
(/usr/lib/lib-org-apache-xalan-2.4.1.so)
  [xmltask]    at
      
org.apache.xpath.compiler.XPathParser.Un
    
  [xmltask] ionExpr()
      
(/usr/lib/lib-org-apache-xalan-2.4.1.so)
    
  [xmltask]    at
      
org.apache.xpath.compiler.XPathParser.UnaryExpr() 
    
(/usr/lib/lib-org-apache-xalan-2.4.1.so)
  [xmltask]    at
      
org.apache.xpath.compiler.XPathParser.Multipli
    
  [xmltask] cativeExpr(int)
      
(/usr/lib/lib-org-apache-xalan-2.4.1.so)
    
  [xmltask]    at 

      
org.apache.xpath.compiler.XPathParser.AdditiveExpr(int)
  
(/usr/lib/lib-org-apache-xalan-2.4.1.so)
  [xmltask]    at
      
org.apache.xpath.compiler.XPathPar
    
  [xmltask] ser.RelationalExpr(int) 
(/usr/lib/lib-org-apache-xalan-2.4.1.so)
  [xmltask]    at 

      
org.apache.xpath.compiler.XPathParser.EqualityExpr(int)
  
(/usr/lib/lib-org-apache-xalan-2.4.1.so)
  [xmltask]    at org.apache.xpath.compiler.
  [xmltask] XPathParser.AndExpr()
      
(/usr/lib/lib-org-apache-xalan-2.4.1.so)
    
  [xmltask]    at
      
org.apache.xpath.compiler.XPathParser.OrExpr() 
    
(/usr/lib/lib-org-apache-xalan-2.4.1.so)
  [xmltask]    at
      
org.apache.xpath.compiler.XPathParser
    
  [xmltask] .Expr()
      
(/usr/lib/lib-org-apache-xalan-2.4.1.so)
    
  [xmltask]    at 

      
org.apache.xpath.compiler.XPathParser.initXPath(org.apache.xpath.compiler.Compiler,
  
java.lang.String,
      
org.apache.xml.utils.PrefixResolver) (/usr/
    
  [xmltask] lib/lib-org-apache-xalan-2.4.1.so)
  [xmltask]    at
      
org.apache.xpath.XPath.XPath(java.lang.String, 
    
javax.xml.transform.SourceLocator, 
org.apache.xml.utils.PrefixResolver, int, 
javax.xml.transform.ErrorListener)
  [xmltask]
      
(/usr/lib/lib-org-apache-xalan-2.4.1.so)
    
  [xmltask]    at
      
org.apache.xpath.XPathAPI.eval(org.w3c.dom.Node, 
    
java.lang.String, org.w3c.dom.Node) 
(/usr/lib/lib-org-apache-xalan-2.4.1.so)
  [xmltask]    at org.apache.xpath.XPat
  [xmltask] hAPI.eval(org.w3c.dom.Node,
      
java.lang.String) 
    
(/usr/lib/lib-org-apache-xalan-2.4.1.so)
  [xmltask]    at 

      
com.oopsconsultancy.xmltask.jdk14.XPathAnalyser14.analyse(org.w3c.dom.Node,
  
java.lang.String) (Unknown Sour
  [xmltask] ce)
  [xmltask]    at 

      
com.oopsconsultancy.xmltask.XmlReplace.apply(org.w3c.dom.Document)
  
(Unknown Source)
  [xmltask]    at
      
com.oopsconsultancy.xmltask.XmlReplacement.apply() 
    
(Unknown Source)
  [xmltask]    at com.oopsconsultancy.xmltas
  [xmltask]
      
k.ant.XmlTask.processDoc(org.w3c.dom.Document, 
    
java.lang.String) (Unknown Source)
  [xmltask]    at
      
com.oopsconsultancy.xmltask.ant.XmlTask.execute() 
    
(Unknown Source)
  [xmltask]    at
      
org.apache.tools.ant.Task.perform() (/u
    
  [xmltask]
      
sr/lib/lib-org-apache-tools-ant-1.5.2.so)
    
  [xmltask]    at
      
org.apache.tools.ant.Target.execute() 
    
(/usr/lib/lib-org-apache-tools-ant-1.5.2.so)
  [xmltask]    at
      
org.apache.tools.ant.Target.performTasks() 
    
(/usr/lib/lib-org-ap
  [xmltask] ache-tools-ant-1.5.2.so)
  [xmltask]    at 

      
org.apache.tools.ant.Project.executeTarget(java.lang.String)
  
(/usr/lib/lib-org-apache-tools-ant-1.5.2.so)
  [xmltask]    at 

      
org.apache.tools.ant.Project.executeTargets(java.util.Vec
  
  [xmltask] tor)
      
(/usr/lib/lib-org-apache-tools-ant-1.5.2.so)
    
  [xmltask]    at 

      
org.apache.tools.ant.Main.runBuild(java.lang.ClassLoader)
  
(/usr/lib/lib-org-apache-tools-ant-1.5.2.so)
  [xmltask]    at
      
org.apache.tools.ant.Main.start(jav
    
  [xmltask] a.lang.String[], java.util.Properties,
      
java.lang.ClassLoader)
      
(/usr/lib/lib-org-apache-tools-ant-1.5.2.so)
    
  [xmltask]    at
      
org.apache.tools.ant.Main.main(java.lang.String[]) 
    
(/usr/lib/lib-org-apache-tools-ant-1.5.2.so)
 
Can u suggest the remedy for this problem.
 
 
Thanks in advance,
Sandeep
 


      
------------------------------------------------------------------------
  
*Yahoo! Messenger*
      
<http://uk.messenger.yahoo.com>* - want a free & 
    
easy way to contact your friends online?** * 
      
-- 
Brian Agnew                 
http://www.oopsconsultancy.com
OOPS Consultancy Ltd         brian @
oopsconsultancy.com
Tel: +44 (0)7720 397526
Fax: +44 (0)20 8682 0012


    



	
	
		
___________________________________________________________ 
Yahoo! Messenger - want a free and easy way to contact your friends online? http://uk.messenger.yahoo.com

  

-- 
Brian Agnew                  http://www.oopsconsultancy.com
OOPS Consultancy Ltd         brian @ oopsconsultancy.com
Tel: +44 (0)7720 397526
Fax: +44 (0)20 8682 0012