Re: Simpler XQuery Syntax?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




Bill D. wrote:

Yes, it all works. It just seems redundant to have to restate the identical 'for' statement, once for each namespace/schema. I thought there might be a more concise way to phrase this SELECT statement that would accomplish the same thing.

for $x in /CurrentConfiguration/Install/V

Well with XQuery you can use *:foo to select 'foo' elements in any namespace so you could do

for $x in /*:CurrentConfiguration/*:Install/*:V

to have a query that works against any possible namespace (even no namespace).

--

Martin Honnen --- MVP XML
http://msmvps.com/blogs/martin_honnen/
.