You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by Marius Gleeson <xm...@subscribe.audumla.net> on 2005/05/23 01:38:15 UTC

namespaces with xpath evaluation

I am trying to use the selectNodes functionality and have found that
namespaces are not being passed through to the saxon xpath evaluator.

Basically the code when creating the saxon evaluator does not pass any
supplied namespaces from the options into the evaluator.
This can be seen in src/store/org/apache/xmlbeans/impl/store/Path.java :
around line 92

  static synchronized Path getCompiledPath(String pathExpr, int force,
        String currentVar)
    {
        Path path = null;
        Map namespaces = (force & USE_SAXON) != 0 ? new HashMap() :
        null;   <--- just an empty hashmap

        if ((force & USE_XBEAN) != 0)

As i need this functionality I have editied my local copy so that it
looks like 

    static synchronized Path getCompiledPath(String pathExpr, int force,
        String currentVar,XmlOptions options)
    {
        Path path = null;
        Map namespaces = null;

        if ((options != null) &&
        (options.hasOption(XmlOptions.SAVE_SUGGESTED_PREFIXES)) ) {
            namespaces = (Map)
            options.get(XmlOptions.SAVE_SUGGESTED_PREFIXES);
        }
        else {
            namespaces = (force & USE_SAXON) != 0 ? new HashMap() :
            null;            
        }

Is there any other way I should be doing this, if not will this ability
be in the main branch soon, and does anyone know why the jaxen
functionality was dropped, but still works it you instantiate the
classes externally?

Cheers,
Marius Gleeson
-- 
  Marius Gleeson
  audumla@fastmail.fm


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org