pratz09
asked on
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</dat e>
<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 !
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+
<creator>info@us-cert.gov<
<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 !
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot !!!!
NP. Glad to help = )
Open in new window