List Info

Thread: namespaces




namespaces
user name
2006-06-20 13:32:00
hi
trying to parse this xml fragment
<?xml version="1.0"
encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://ww
w.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/
" xmlns:perljobs="http://jobs.perl.org/rss/"
xmlns:taxo="http://purl
.org/rss/1.0/modules/taxonomy/"
xmlns:dc="http://purl.org/dc/e
lements/1.1/">
<channel rdf:about="http://jobs.perl.org/"
;>
<description>The Perl Jobs site</description>
<dc:language>en-us</dc:language>
<dc:rights>Copyright 2001,
jobs.perl.org</dc:rights>
<dc:date>2006-06-18T01:38:44Z</dc:date>
<dc:publisher>askperl.org</dc:publisher>
<dc:creator>askperl.org</dc:creator>
<dc:subject>Perl Jobs</dc:subject>;
</channel>
</rdf:RDF>
..having some problems determining when I reach the dc
namespace in the parse.
I tried to check the ns menber of the nodes to find out if
the node  
contents of, for example language, which I get with  
xmlNodelistGetString, belongs to the dc namespace. This
failed, the ns  
member of the nodes are empty. Is it correct that the ns
member should  
be empty? How to check in a parse when and if I reach a
particular  
namespace?

Tia
G
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
namespaces
user name
2006-06-20 16:28:24
On Tue, Jun 20, 2006 at 04:32:00PM +0300, bossgregerhaga.net wrote:
> hi
> trying to parse this xml fragment
> <?xml version="1.0"
encoding="UTF-8"?>
> <rdf:RDF xmlns:rdf="http://ww
w.w3.org/1999/02/22-rdf-syntax-ns#"
> xmlns="http://purl.org/rss/1.0/
" xmlns:perljobs="http://jobs.perl.org/rss/"
> xmlns:taxo="http://purl
.org/rss/1.0/modules/taxonomy/"
> xmlns:dc="http://purl.org/dc/e
lements/1.1/">
> <channel rdf:about="http://jobs.perl.org/"
;>
> <description>The Perl Jobs
site</description>
> <dc:language>en-us</dc:language>
> <dc:rights>Copyright 2001,
jobs.perl.org</dc:rights>
> <dc:date>2006-06-18T01:38:44Z</dc:date>
> <dc:publisher>askperl.org</dc:publisher>
> <dc:creator>askperl.org</dc:creator>
> <dc:subject>Perl Jobs</dc:subject>;
> </channel>
> </rdf:RDF>
> ..having some problems determining when I reach the dc
namespace in the parse.
> I tried to check the ns menber of the nodes to find out
if the node  
> contents of, for example language, which I get with  
> xmlNodelistGetString, belongs to the dc namespace. This
failed, the ns  
> member of the nodes are empty. Is it correct that the
ns member should  
> be empty? How to check in a parse when and if I reach a
particular  
> namespace?

  All the element nodes here should have a namespace, so
their ->ns
should not be NULL. No idea how you got something different.

Daniel

-- 
Daniel Veillard      | Red Hat http://redhat.com/
veillardredhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ |
Rpmfind RPM search engine http://rpmfind.net/
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )