Find all prefix:url namespaces in an XML file - quickly

LMFAO 2 MUCH

New Member
We need to find all prefix:namespace pairs in an XML file. We allow users to supply any XML file and any XPath to query on it. We need to find the prefix:uri mappings to set those when the XPath is evaluated.We presently use:\[code\]selectNodes("//namespace::*[name() != 'xml'][not(../../namespace::*=.)]");\[/code\]and this does return all pairs. The problem is that it is slow. I looked at this answer but it also is slow. Is there a fast way to do this? And I need this solely to perform XPath queries against the XML.I'm doing this both in Java (using dom4j) and .NET.thanks - dave
 
Back
Top