On Wed, 2002-05-29 at 21:09, Dave Jarvis wrote:
> Hi, Mark.
> 
> Thanks very much for the quick response.
> 
> Technically the value of the namespace attribute is a URI (a relative URL).
> However, without the namespace prefix, everything bombs.  I have read the
> link you supplied -- it was quite informative.
> 
> > <Root version="1.0" xmlns="Get - Data - Request.xsd">
> 
> I have changed this to the following:
> 
>       <Root version="1.0" xmlns:req="Get - Data - Request.xsd">
> 
> And now everything works fine.  Unfortunately, I have no control over the
> prefix (:req), so unless I can convince the other company to provide a
> prefix, we may be unable to proceed using Jaxen.

You look at it the wrong way:
The prefix is not important. However in xpath, "no prefix" means "no
namespace", while in ordinary xml documents, "no prefix" means "default
namespace, if in scope, else no namespace"

Your solution: use a prefix in your xpath expressions, and don't worry
about your source document. Bind your prefix (lets call it "foobar")
using XPath.addNamespace to the namespace uri. Then use xpath
expressions like "foobar:Root" and "foobar:Data/foobar:Element".
As long as the namespace uri is the same, it doesn't matter if the
source document uses the default namespace or any specific prefix at
all.

Greetings,
  Erwin



_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
Jaxen-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxen-interest

Reply via email to