HostWeb Forums » Microsoft Databases » microsoft.public.sqlserver.xml » Retreiving Namespace URI

Topic: Retreiving Namespace URI

Reply | New Topic | This is SPAM | This is Offensive

Submitted: 5/21/2008 7:34:00 AM

By: Anonymous
Hello,
I have a XML as below:

declare @doc2 xml
SET @doc2 = '<?xml version="1.0" ?>
<p1: Domains_and_Emails xmlns:p1="LDAP">
<Domain>
<UnixEmail>
<uid>info</uid>
<Password>xyz</Password>
<EmailAccount>info@xyz.com</EmailAccount>
</UnixEmail>
</Domain>
</p1: Domains_and_Emails>'


In the above example, how would I get the namespace string?

Thanks,
Ganesh


Replies below ↓

Replies

Reply | New Topic | This is SPAM | This is Offensive

Submitted: 5/21/2008 10:03:03 AM

By: Anonymous

Re: Retreiving Namespace URI

Thanks.. Is there a way to get the namespace prefix as well?

-Ganesh


"Mark" wrote:

>
> select r.query('local-name(.)'),
> r.query('namespace-uri(.)')
> from @doc2.nodes('/*') as x(r)
>

Reply | New Topic | This is SPAM | This is Offensive

Submitted: 5/23/2008 10:38:18 PM

By: markc600

Re: Retreiving Namespace URI


select r.query('local-name(.)'),
r.query('namespace-uri(.)')
from @doc2.nodes('/*') as x(r)

Reply | New Topic | This is SPAM | This is Offensive

Submitted: 5/23/2008 10:38:20 PM

By: markc600

Re: Retreiving Namespace URI

> Thanks.. Is there a way to get the namespace prefix as well?

Not as far as I know

Contents
Home
Forums
About Us
Contact Us
Web Hosting:
Hosting Providers
How to choose a name
What is a Hosting Provider
Hosting Types
Choosing the right plan
 
Search
 
Login to HostWeb.com
Email
Password
If you do not have an account with us yet, join now - it's FREE!