|
|
|
date: Tue, 20 May 2008 15:46:09 -0700,
group: microsoft.public.xml
back
Re: How to get the namespace URI string?
* Ganesh Muthuvelu wrote in microsoft.public.xml:
>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?
Using what, exactly? Are you using XPath, XQuery, .NET's XmlDocument, a
SAX2 parser in Java, libxml2 in C, ...? Usually the environment provides
some method, like a namespace-uri() getter in some fashion, to get the
namespace from the p1:Domains_and_Emails Element node or event, or some
function to look up the namespace uri that corresponds to a prefix, e.g.
the DOM has lookupNamespaceURI as a method on all Nodes.
--
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/
date: Wed, 21 May 2008 01:02:46 +0200
author: Bjoern Hoehrmann
|
|