0

i have this

<Connector protocol="HTTP/1.1" redirectPort="8443"/>

How can i use xmltask to add this attribute?

<Connector protocol="HTTP/1.1" redirectPort="8443" newAttribute="VALUE"/>

i cant find anything on the documentation.

Thanks

kpma1985
  • 25
  • 4
  • 1
    Its for tomcat user server.xml file, you are trying to add custom attribute?. Per this documention http://tomcat.apache.org/tomcat-5.5-doc/config/http.html only standard attributes are supported –  Jan 30 '14 at 13:52

1 Answers1

1

build.xml

<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask" />

<xmltask destbuffer="xml-buffer">
    <fileset file="src.xml"/>
    <attr path="//Connector[@protocol='HTTP/1.1']" attr="newAttribute" value="VALUE"/>
</xmltask>

<xmltask>
    <print buffer="xml-buffer"/>
</xmltask>

Output

  [xmltask] { buffer 'xml-buffer' output
  [xmltask] <Connector newAttribute="VALUE" protocol="HTTP/1.1" redirectPort="8443"/>
  [xmltask] } buffer 'xml-buffer' output
Chad Nouis
  • 6,861
  • 1
  • 27
  • 28