Join Bytes! wrote:
Quote:
Originally Posted by
I'm using Java (org.jdom.xpath.XPath) which has the following method:
>
addNamespace(java.lang.String prefix, java.lang.String uri)
which adds a namespace definition (prefix and URI) to the list of
namespaces known of this XPath expression.
>
My this case, what are the values of prefix and uri?
|
The prefix is up to you, provided you don't repeat a prefix already used
in your document (e.g. 'soap'), start the prefix with a letter or
underscore, and confine yourself to the characters
A-Z a-z 0-9 _ - .
(or consult <URL: http://www.w3.org/TR/xml-namesfor the full range of
permissible characters, software permitting).
Without knowing Java in any detail, I presume
addNamespace("monster",
"http://webservices.monster.com/MonsterPortal")
is appropriate if you want to use
monster:PersistentTicket
in your XPath, and
addNamespace("m", "http://webservices.monster.com/MonsterPortal")
if you want to use
m:PersistentTicket
The significant thing about the namespace is its URI - you could add the
namespace twice and use the prefixes interchangeably, although that
might be unnecessarily confusing :-)