• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1141
  • Last Modified:

Regular expression for to replace XML node

HI,

I have following XML:

<?xml version="1.0" encoding="UTF-8"?>

<RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 xmlns="http://purl.org/rss/1.0/"
 xmlns:content="http://purl.org/rss/1.0/modules/content/"
 xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:syn="http://purl.org/rss/1.0/modules/syndication/"
 xmlns:admin="http://webns.net/mvcb/"

>

<channel about="http://www.us-cert.gov/cas/techalerts/index.html">
<title>US-CERT Technical Cyber Security Alerts</title>
<link>http://www.us-cert.gov/cas/techalerts/index.html</link>
<description>US-CERT Technical Cyber Security Alerts provide timely
information about current security issues, vulnerabilities, and
exploits.</description>
<language>en-us</language>
<rights>Produced 2011 by US-CERT, a government organization.</rights>
<date>2011-10-13T14:59:42+00:00</date>
<creator>info@us-cert.gov</creator>
<items>
 <Seq>
  <li resource="http://www.us-cert.gov/cas/techalerts/TA11-286A.html" />
  <li resource="http://www.us-cert.gov/cas/techalerts/TA11-284A.html" />
  <li resource="http://www.us-cert.gov/cas/techalerts/TA11-256A.html" />
  <li resource="http://www.us-cert.gov/cas/techalerts/TA11-222A.html" />
  <li resource="http://www.us-cert.gov/cas/techalerts/TA11-221A.html" />
  <li resource="http://www.us-cert.gov/cas/techalerts/TA11-201A.html" />
  <li resource="http://www.us-cert.gov/cas/techalerts/TA11-200A.html" />
  <li resource="http://www.us-cert.gov/cas/techalerts/TA11-193A.html" />
  <li resource="http://www.us-cert.gov/cas/techalerts/TA11-166A.html" />
  <li resource="http://www.us-cert.gov/cas/techalerts/TA11-165A.html" />
 </Seq>
</items>
</channel>

I am using this XML in Nintex Workflow. I want to write a regular expression to replace all xmlns strings (in bold above) with empty strings. What could be the regular expression which identifies the pattern in it. I tried (<RDF)[a-b1-9/.=#"](>) but it does not work.

Please help. Thanks !
0
pratz09
Asked:
pratz09
  • 3
1 Solution
 
käµfm³d 👽Commented:
How about:

<RDF[^>]+>

Open in new window

0
 
käµfm³d 👽Commented:
Alternatively, you might try:

<RDF.+?>

Open in new window

0
 
pratz09Author Commented:
Thanks a lot !!!!
0
 
käµfm³d 👽Commented:
NP. Glad  to help = )
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now