I am trying to split 4.5.02.08 by using regexp and I am trying to put pattern 
as 
 
<regexp path="//:project/:version[1]/text()" 
pattern="(\d*)\.(\d*)\.(\d*)\.(\d*)" property="servlet.name"/>
 
if I echo "servlet.name" it gives me first digit which is "4", now how to split 
rest of the 3 digits in different regexp of xmltask? Means each digits should 
get split in different "property",


<regexp path="//:project/:version[1]/text()" 
pattern="(\d*)\.(\d*)\.(\d*)\.(\d*)" property="servlet.name1"/>

<regexp path="//:project/:version[1]/text()" pattern="??" 
property="servlet.name2"/>

<regexp path="//:project/:version[1]/text()" pattern="??" 
property="servlet.name3"/>

<regexp path="//:project/:version[1]/text()" pattern="??" 
property="servlet.name4"/>



It will be great help if anyone can help in this regard.




-----Original Message-----
From: Brian Agnew <br...@oopsconsultancy.com>
To: jhoomshar...@netscape.net
Cc: xmltask-users@lists.sourceforge.net
Sent: Fri, Jan 15, 2010 5:25 pm
Subject: Re: [Xmltask-users] Reading version and writing it in different format


So what have you tried ?
First copy out into a set of properties. e.g.
<xmltask source="">
   <regexp...
   <regexp...>
/xmltask>
and then use another <xmltask> in a second target (this is important) to
rite these properties into your new XML. To approach this in stages, do
he first one and ensure you can print the properties via <echo> or
imilar.
Brian
>
 Hi All,
 I have pom.xml, below is snippet of my pom.xml file:
 pom.xml
 -------
 <?xml version="1.0" encoding="UTF-8"?>
 <project xmlns="http://maven.apache.org/POM/4.0.0";
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
 http://maven.apache.org/maven-v4_0_0.xsd";>
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.xkri.kill.tokens</groupId>
   <artifactId>tokens-active-dent</artifactId>
   <version>7.5.02.02</version>
   <!-- default packaging -->
   <packaging>jar</packaging>
   <name>Colt and ADAM</name>
   <description>This package provides the ${name}</description>
   :
   :
   :
  </project>

  I want to pick the version from node
  <version>7.5.02.02</version>
  and replace it to another config.xml:
  config.xml
  ----------
  <?xml version="1.0" encoding="UTF-8"?>
 <installationTaskConfiguration xmlns="http://www.colt.com";
                                
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
                                xsi:schemaLocation="http://www.colt.com
 InstallationTaskConfiguration.xsd">

   <registryVersion product="" releaseVersion="7" majorVersion="5"
 minorVersion="02"/>
   <productFeature id="tokens-active-dent"
         parent="base-dent"
                     state="INSTALLING"
                     requiredDiskSpaceMode="default"
                     rebootRequiredOnInstall="false"
                     rebootRequiredOnUninstall="false"
                     rebootRequiredOnUpgrade="false"
                     backupOnUpgrade="false">
       <version product="" releaseVersion="7" majorVersion="5"
 minorVersion="02" subMinorVersion="SNAPSHOT"/>
       <requiredDiskSpaceMap>
         <requiredDiskSpace id="default" size="1MB"/>
         <requiredDiskSpace id="backup" size="0MB"/>
         <requiredDiskSpace id="temporary" size="0MB"/>
       </requiredDiskSpaceMap>
     </productFeature>
     :
     :
     :
  </installationTaskConfiguration>

  in config.xml file I want to reaplce in this format:
  <version product="" releaseVersion="7" majorVersion="5" minorVersion="02"
 subMinorVersion="02"/>

  can anyone give me an idea on how to copy and repace in above mentioend
 format?

 I was going through the documentation of xmltask and looks like latest
 version 1.16 should give me the desired result, if yes then I am not clear
 how?


 ------------------------------------------------------------------------------
 Throughout its 18-year history, RSA Conference consistently attracts the
 world's best and brightest in the field, creating opportunities for
 Conference
 attendees to learn about information security's most important issues
 through
 interactions with peers, luminaries and emerging and established
 companies.
 
http://p.sf.net/sfu/rsaconf-dev2dev_______________________________________________
 Xmltask-users mailing list
 Xmltask-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/xmltask-users


- 
rian Agnew                  http://www.oopsconsultancy.com
OPS Consultancy Ltd
el: +44 (0)7720 397526
ax: +44 (0)20 8682 0012



------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Xmltask-users mailing list
Xmltask-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xmltask-users

Reply via email to