You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Boris Kolpackov <bo...@codesynthesis.com> on 2010/07/04 21:49:34 UTC
Re: DOMNamedNodeMap::getNamedItemNS( , )
Hi Bertwim,
B.W.H. van Beest <bw...@xs4all.nl> writes:
> I have a problem in understanding how the
>
> DOMNamedNodeMap::getNamedItemNS( <namespace>, <localname> )
>
> method is supposed to be used.
>
> Consider the following sample xml file:
> ====
> <?xml version="1.0"?>
> <note xmlns="http://www.w3schools.com"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.w3schools.com note.xsd">
> <to>Tove</to>
> <from>Jani</from>
> <heading>Reminder</heading>
> <body>Don't forget me this weekend!</body>
> </note>
> ====
>
> I would like to obtain the schema location, "http://www.w3schools.com
> note.xsd"
>
> If I set <namespace> to "http://www.w3.org/2001/XMLSchema-instance"
> and <localname> to "schemaLocation" (both as XMLCh strings)
>
> the call to getNamedItemNS( <namespace>, <localname> ) returns a nil
> pointer.
This should work, provided the DOM document was created with namespace
support enabled. Can you send a small test case that demonstrates
the problems?
Boris
--
Boris Kolpackov, Code Synthesis http://codesynthesis.com/~boris/blog
Open-source XML data binding for C++ http://codesynthesis.com/products/xsd
XML data binding for embedded systems http://codesynthesis.com/products/xsde
Command line interface to C++ compiler http://codesynthesis.com/projects/cli