[Xmltask-users] R: R: Attribute change issue when xmlns is present
Brought to you by:
bagnew
From: Verre R. <verre@PITAGORA.IT> - 2008-10-10 15:21:51
|
tnx, now is ok ________________________________ Da: Karr, David [mailto:dav...@wa...] Inviato: venerdì 10 ottobre 2008 17.16 A: xml...@li... Oggetto: Re: [Xmltask-users] R: Attribute change issue when xmlns is present Try replacing ":beans" with "/:beans". ________________________________ From: Verre Raffaele [mailto:verre@PITAGORA.IT] Sent: Friday, October 10, 2008 8:12 AM To: Mark Coffin; xml...@li... Subject: [Xmltask-users] R: Attribute change issue when xmlns is present uhm... there's something wrong: when I evaluate the xpath :beans/:bean[@id='router'] before executing <xmltask source="invoker.xml" dest="invoker.xml" report="true" preserveType="true"> <attr path=":beans/:bean[@id='router']" attr="class" value="myvalue"/> </xmltask> I have: javax.xml.transform.TransformerException: A location path was expected, but the following token was encountered: :beans at org.apache.xpath.compiler.XPathParser.error(XPathParser.java:608) at org.apache.xpath.compiler.XPathParser.LocationPath(XPathParser.java:1599) at org.apache.xpath.compiler.XPathParser.PathExpr(XPathParser.java:1315) at org.apache.xpath.compiler.XPathParser.UnionExpr(XPathParser.java:1234) at org.apache.xpath.compiler.XPathParser.UnaryExpr(XPathParser.java:1140) at org.apache.xpath.compiler.XPathParser.MultiplicativeExpr(XPathParser.java:1061) at org.apache.xpath.compiler.XPathParser.AdditiveExpr(XPathParser.java:1003) at org.apache.xpath.compiler.XPathParser.RelationalExpr(XPathParser.java:928) at org.apache.xpath.compiler.XPathParser.EqualityExpr(XPathParser.java:868) at org.apache.xpath.compiler.XPathParser.AndExpr(XPathParser.java:832) at org.apache.xpath.compiler.XPathParser.OrExpr(XPathParser.java:805) at org.apache.xpath.compiler.XPathParser.Expr(XPathParser.java:788) at org.apache.xpath.compiler.XPathParser.initXPath(XPathParser.java:127) at org.apache.xpath.XPath.<init>(XPath.java:176) at org.apache.xpath.XPathAPI.eval(XPathAPI.java:232) at org.apache.xpath.XPathAPI.eval(XPathAPI.java:189) ________________________________ Da: Mark Coffin [mailto:mc...@aa...] Inviato: venerdì 10 ottobre 2008 16.43 A: Verre Raffaele; xml...@li... Oggetto: RE: [Xmltask-users] Attribute change issue when xmlns is present Hi Verre, If your using dtd's or xmlns I think you have to reference it with a colon : like this: <xmltask source="invoker.xml" dest="invoker.xml" report="true" preserveType="true"> <attr path=":beans/:bean[@id='router']" attr="class" value="it.pitagora.otherClass"/> </xmltask> Mark Coffin mc...@aa...<mailto:mc...@aa...> Phone: 905.632.0864 1.800.668.8486 Fax: 905.632.2605 www.aalsolutions.com<http://www.aalsolutions.com> ________________________________ From: Verre Raffaele [mailto:verre@PITAGORA.IT] Sent: October 10, 2008 10:37 AM To: xml...@li... Subject: [Xmltask-users] Attribute change issue when xmlns is present Hi I have an xml file like this: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean class="it.pitagora.myClass" id="router"/> </beans> when I execute the code: <xmltask source="invoker.xml" dest="invoker.xml" report="true" preserveType="true"> <attr path="beans/bean[@id='router']" attr="class" value="it.pitagora.otherClass"/> </xmltask> nothing happen. If I delete the xmlns attribute : <beans> <bean class="it.pitagora.myClass" id="router"/> </beans> previous code work fine. Any idea to risolve this issue? There's something wrong in my code? Thanks a lo for you reply Raffaele Verre Raffaele Verre e way Enterprise Business Solutions S.r.l. c/o Nuova Pitagora s.r.l. - Via Cattaneo 23 - 87100 email: ve...@pi...<mailto:ve...@pi...> tel: 0984 - 899340 Informativa ai sensi del codice della Privacy (D. Lgs. 196 - 30/06/2003)<blocked::mailto:mu...@pi...> http://www.pitagora.it/196/signature.html ****** CONFIDENTIALITY NOTICE ****** NOTICE: This e-mail message and all attachments transmitted with it may contain legally privileged and confidential information intended solely for the use of the addressee. If the reader of this message is not the intended recipient, you are hereby notified that any reading, dissemination, distribution, copying, or other use of this message or its attachments is strictly prohibited. If you have received this message in error, please notify the sender immediately and delete this message from your system. Thank you. |