Quantcast
Channel: MSBuild Extension Pack
Viewing all articles
Browse latest Browse all 1211

New Post: XMLUpdate - how to write a newline character?

$
0
0

I have a bit of an issue updating (what is supposedly) a standard XML file.

Entry is:

  <mbean code="org.jboss.resource.deployment.AdminObject" name="jca.wmq:name=jms/tpiAsyncQueue">
    <attribute name="JNDIName">jms/tpiAsyncQueue</attribute>
    <attribute name="Properties">baseQueueName=PORTALS.ASYNC.QUOTE.IN targetClient=MQ</attribute>
  </mbean>

and the code that currently writes it is:

    <XmlUpdate XmlFileName="\\$(JBOSSServerName)\$(JBOSSJMSWMQDSFile)" Xpath="//connection-factories/mbean[@name='jca.wmq:name=jms/$(JBOSSmbean)']/attribute[@name='Properties']" Value="baseQueueName=$(JBOSSmbeanbaseQName) targetClient=MQ" />

Unfortunately, the JBOSS App reading it seems to need:

  <mbean code="org.jboss.resource.deployment.AdminObject" name="jca.wmq:name=jms/tpiAsyncQueue">
    <attribute name="JNDIName">jms/tpiAsyncQueue</attribute>
    <attribute name="Properties">
               baseQueueName=PORTALS.ASYNC.QUOTE.IN
               targetClient=MQ
    </attribute>
  </mbean>

(i.e. the 2 entries for attribute name="Properties" need to be on seperate lines).

So I updated the XMLUpdate code to:

    <XmlUpdate XmlFileName="\\$(JBOSSServerName)\$(JBOSSJMSWMQDSFile)" Xpath="//connection-factories/mbean[@name='jca.wmq:name=jms/$(JBOSSmbean)']/attribute[@name='Properties']" Value="baseQueueName=%0A%0D$(JBOSSmbeanbaseQName) %0A%0DtargetClient=MQ%0A%0D" />

and the log file showed it correctly:

Task "XmlUpdate"
  Updating Xml Document "\\localhost\C$\app\datasources\jms-wmq-ds.xml".
    1 node(s) selected for update.
  XmlUpdate Wrote: "baseQueueName=
  PORTALS.ASYNC.QUOTE.IN
  targetClient=MQ
  ".
Done executing task "XmlUpdate".

However the actual file did not reflect the return character.

Can anyone help?


Viewing all articles
Browse latest Browse all 1211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>