LISTSERV mailing list manager LISTSERV 15.5

Help for XML-L Archives


XML-L Archives

XML-L Archives


View:

Next Message | Previous Message
Next in Topic | Previous in Topic
Next by Same Author | Previous by Same Author
Chronologically | Most Recent First
Proportional Font | Monospaced Font

Options:

Join or Leave XML-L
Reply | Post New Message
Search Archives


Subject:
From: Bob Trasverso <[log in to unmask]>
Reply-To:[log in to unmask]
Date:Tue, 20 Nov 2001 12:26:45 -0000
Content-Type:text/plain
Parts/Attachments:
Parts/Attachments

text/plain (54 lines)


Hi all,

i have a problem to understand namespace in XPATH espression result, using
XALAN-J 2_2_D13
I have this little xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Root [
<!ATTLIST Notaries Id ID #IMPLIED>
]>

<Root xmlns:foo="http://www.usps.gov/foo" xmlns="http://www.usps.gov/">
<Element1>foo<Element1>
<Element2>bar<Element2>
<Notaries xmlns="" Id="notaries">
<Notary name="Great, A. T." />
<Notary name="Hun, A. T." />
</Notaries>
</Root>

then i have this code snippet in Java,
after parsing, i have org.w3c.Document doc:

Node n = Doc.getElementById("notaries");
NodeList resultNodes = XPathAPI.selectNodeList(n,"(.//. | .//@*|.//namespace::*)");
if i print resultNodest i get:

i 0 Attribute xmlns:foo=http://www.usps.gov/foo
i 1 Attribute xmlns:xml=http://www.w3.org/XML/1998/namespace
i 2 Element Notaries
i 3 Attribute Id=notaries
i 4 Attribute xmlns=
i 5 Text
i 6 Element Notary
i 7 Attribute name=Great, A. T.
i 8 Text
i 9 Element Notary
i 10 Attribute name=Hun, A. T.
i 11 Text

That's all!!
But about namespace spec, the namespace name
foo=http://www.usps.gov/foo is not inherithed!!! It's not a defalut
namespace!!! e then then namespace whit prefix xml??? I have a few
doubts...If there is somebody that explains me this behaviour i'm happy.

Thans in advance

-----------------------------------------------------

messaggio inviato con Freemail by superEva
http://www.supereva.it

-----------------------------------------------------

Back to: Top of Message | Previous Page | Main XML-L Page

Permalink



LISTSERV.HEANET.IE

CataList Email List Search Powered by the LISTSERV Email List Manager