Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Variable in XQUERY Variable in XQUERYTo: NULL Date: 5/20/2008 12:22:00 PM
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@x...</EmailAccount>
</UnixEmail>
</Domain>
</p1: Domains_and_Emails>'
and I am using the xml.nodes function to get the XML at the required
position as below:
SELECT
tab.col.value('uid[1]','VARCHAR(20)')AS uid
FROM @doc2.nodes('declare namespace p1="LDAP"; //p1:
Domains_and_Emails/Domain[1]/UnixEmail[1]') tab(col)
In the above example, how would I replace the static literal "//p1:
Domains_and_Emails/Domain[1]/UnixEmail[1]" with a variable?. basically, I
need to pass a value for that string via a variable..
Can someone help?
Thanks,
Ganesh
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
