Replacing XML Tags

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

dblaze
Posts: 1
Joined: Fri Feb 17, 2006 5:36 am

Replacing XML Tags

Postby dblaze » Fri Feb 17, 2006 5:58 am

Hi All,

I need to insert a fixed string of characters before the actual tag value in an XML file. Here's what I want to do:

<sometag>data</sometag>
<anothertag />


needs to look like:

<cmn:sometag>data</cmn:sometag>
<cmn:anothertag />

I need the 'cmn:' inserted after the < or </ and before tag name. The / in the ending tag is causing me the trouble.

Any suggestions?

Thanks,
Doug

User avatar
DataMystic Support
Site Admin
Posts: 2138
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Postby DataMystic Support » Fri Feb 17, 2006 8:46 pm

Search for perl pattern

(</?)(sometag>)

Replace with

$1cmn:$2
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments


Return to “TextPipe Tips and Tricks, Questions and Support”

Who is online

Users browsing this forum: No registered users and 5 guests