ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sun zheng" <zheng_...@hotmail.com>
Subject configuration of environment arguments by xml..
Date Mon, 14 Jul 2003 12:11:34 GMT
Hi all,

I just find out a way maybe possible.. but it still does not work.. pls help 
me.

I require the customer configures a user_environment.properties file.. the 
structure is as followed. the customer defines his user names and pwds, all 
kinds of ports, url, ...

<root>
  <JAVA_HOME>...</JAVA_HOME>
  <TOMCAT_HOME>...</TOMCAT_HOME>
  ...
  ..
  .

  <authorization>
    <userinfo>
      <username>...</username>
      <userpwd>...</userpwd>
    </userinfo>
    <userinfo>
      <username>...</username>
      <userpwd>...</userpwd>
    </userinfo>
    ...
    ..
    .
  </authorization>

</root>


there is an authorizationInfo.xml of my context of Tomcat. it has the same 
structure of
  <authorization>
    <userinfo>
      <username>...</username>
      <userpwd>...</userpwd>
    </userinfo>
    <userinfo>
      <username>...</username>
      <userpwd>...</userpwd>
    </userinfo>
    ...
    ..
    .
  </authorization>


what im trying to do is to replace the content of authorizationInfo.xml by 
the same parts of user_environment.properties

in ant i define the task
<replaceregexp file="authorizaInfo.xml"
               match="&lt;authorization>.*&lt;/authorization>"
               replace="{root.authorization}"
               flag="g"  />

if in those two xml files i write the content between <authorization> and 
</authorization> in one line, the attribute 
match="&lt;authorization>.*&lt;/authorization>" can find them and 
replace="{root.authorization}" works perfectly.. however, between 
<authorization> and </authorization> there are multiple lines, hence, 
match="&lt;authorization>.*&lt;/authorization>" can not search out the 
content.

what should I do ? should I modify the regular expression or use another ant 
command?

with best wishes

Sun Zheng


[prev in list] [next in list] [prev in thread] [next in thread]

List:     ant-user
Subject:  configuration of environment arguments by xml..
From:     "sun zheng" <zheng_sun () hotmail ! com>
Date:     2003-07-14 8:33:25
[Download message RAW]

Hi all,

I require customers configure a xml file to their
environment arguments.. now i get a question.
I need the customers type in nick/pwd for each
context in tomcat.. ie.

<root>

<context1>
  <userinfo>
   <username>aaa</username>
   <userpwd>aaa</userpwd>
  </userinfo>
  <userinfo>
   <username>bbb</username>
   <userpwd>bbb</userpwd>
  </userinfo>
  <userinfo>
   <username>ccc</username>
   <userpwd>ccc</userpwd>
  </userinfo>
</context1>

<context2>
  <userinfo>
   <username>aaa</username>
   <userpwd>aaa</userpwd>
  </userinfo>
  <userinfo>
   <username>bbb</username>
   <userpwd>bbb</userpwd>
  </userinfo>
  <userinfo>
   <username>ddd</username>
   <userpwd>ddd</userpwd>
  </userinfo>
</context2>

</root>

then, while ant builds the system, it inserts/(replaces if exists) those
contents into different context xml files..

but i have no idea how to do it.. will you pls tell me the usual way?

with best wishes

Sun Zheng

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org

[prev in list] [next in list] [prev in thread] [next in thread]




Configure | About MARC | Support MARC | Got a list to add? | 10East is 
Hiring!

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message