I'm resending this as it seemed to vanish from the jaxen list...

Hi Michael

This would be better addressed to the jaxen mail list
[EMAIL PROTECTED] The trick is to provide Jaxen with a
NamespaceContext that maps the prefixes you use in your XPath expression to
the URIs you want to use.

An alternative is to use the verbose mechanism....

/*[local-name()='foo']/*[local-name()='Description']

There's a few mails on the archive about this kinda thing. It should be
added to the FAQ...

Also make sure when you create your own NamespaceContext that you don't
change the default namespace prefx "" to a URI or you might find the
standard XPath functions suddenly disappear (which again should be added to
the FAQ...)

James
  ----- Original Message -----
  From: Zufferey, Michael
  To: '[EMAIL PROTECTED]'
  Sent: Monday, July 15, 2002 12:55 PM
  Subject: JAXEN XPATH with Namespaces


  Dear Mr. Strachan,



  I work as MPEG-7 specialist for an Austrian Computer Science Institute.
Recently, I work also with DOM/JDOM/XML/XPATH in order to handle MPEG-7
documents (XML-Schema based documents) for retrieving needed information.



  Unfortunately, XPATH doesn't work with XML document when namespace are
defined. Only Xalan (Apache org) seems to retrieve some information, but
only when I specify the prefix, e.g.:
"/mpeg7:mpeg7/mpeg7:Description//mpeg7:FreeTextAnnotation").



  In order to use JDOM, I have installed the JAXEN XPATH search engine.
Unfortunately, after one day of tests and efforts, nothing seems to work. I
retrieve no results. And I have tried all (relative/absolute XPATH
expressions, create and assign namespace to the document, elements, etc,
using NamespaceContext (? How to use it correctly? No examples are
provided)., etc.).



  Can you give me some advices or some simple examples, which could help me
to solve my problem?



  Thank you for your attention and help.



  Sincerely yours,



  Michael Z.





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

  Michael Zufferey
  Institute of Information Systems & Information Management
  JOANNEUM RESEARCH Forschungsgesellschaft mbH
  Steyrergasse 17, A-8010 Graz, AUSTRIA



  phone:  +43-316-876-1245              fax: +43-316-876-1191
  mobile: +43-650-600-99-16

  web:     http://iis.joanneum.at
  e-mail:  mailto:[EMAIL PROTECTED]
  --------------------------------------------------------------------------
------------




__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.comm


-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing 
real-time communications platform! Don't just IM. Build it in! 
http://www.jabber.com/osdn/xim
_______________________________________________
Jaxen-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxen-interest

Reply via email to