Re: [xml] namespaces



Quoting "Buchcik, Kasimier" <k buchcik 4commerce de>:

Hi,

Are you looking at the "ns" fields of the text nodes or
the element nodes? Only element and attribute nodes can
be in a namespace.
hi
thank's for clearing that for me,
got it working.

q:what is the norm with namespaces? I mean how should I do when I parse RDF ( ( RSS ) feeds containing namespaces. should I make the software check and validate against the dtd online automatically, ( is that good and safe?)...appreas quite fuzzy to me to rely on a link to be correct...., what is the best way?
would appreciate some light on this.
thank's
greger

Regards,

Kasimier

-----Original Message-----
From: xml-bounces gnome org [mailto:xml-bounces gnome org] On
Behalf Of boss gregerhaga net
Sent: Tuesday, June 20, 2006 3:32 PM
To: xml gnome org
Subject: [xml] namespaces

hi
trying to parse this xml fragment
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.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/elements/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>ask perl org</dc:publisher>
<dc:creator>ask perl 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/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml








[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]