Archive for October 6, 2014

Exclude namespaces from XML using Jscript

In one of my requirement I had to parse XML and find node values.

 My XML looks as below

<NS1:Envelope xmlns:NS1=>





Since the XML has got namespaces I need to exclude namespaces before I find the node. 

Below is the logic to exclude namespaces

var xmlWithNamespaces={Your xml with namespaces};

var xmlWithNoNamespaces= xmlWithNamespaces.replace(/<(\/?)([^:>\s]*:)?([^>]+)>/g, “<$1$3>”);




Categories: Misc Tags: , , ,