You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Gregor Karlinger <gr...@iaik.at> on 2000/08/08 14:04:21 UTC

Bugreport: Namespace resolution problem

Hi all,

I detected the following "strange behaviour" of Xalan. I am using
Xalan 1.2.D01 together with the accompanying Xerces jar file.

I am using the ApplyXPath sample file with the following XML content,
applying the XPath

  "/ANameSpace:AnElement/AnotherNameSpace:AnotherChildElement"

in order to select the second child element of the document's root
element:

  <?xml version="1.0" encoding="UTF-8"?>
  <ANameSpace:AnElement
xmlns:ANameSpace="http://www.tu-graz.ac.at/#ANameSpace">
    <ANameSpace:AChildElement>
      Some data
    </ANameSpace:AChildElement>
    <AnotherNameSpace:AnotherChildElement
xmlns:AnotherNameSpace="http://www.tu-graz.ac.t/#AnotherNameSpace">
      Some other data
    </AnotherNameSpace:AnotherChildElement>
  </ANameSpace:AnElement>

The result of applying this XPath is empty. I have tried around
a little bit and changed the location of the namespace declaration
for "AnotherNamespace" to the document's root element - see the
modified XML content:

  <?xml version="1.0" encoding="UTF-8"?>
  <ANameSpace:AnElement
xmlns:ANameSpace="http://www.tu-graz.ac.at/#ANameSpace"

xmlns:AnotherNameSpace="http://www.tu-graz.ac.t/#AnotherNameSpace">
    <ANameSpace:AChildElement>
      Some data
    </ANameSpace:AChildElement>
    <AnotherNameSpace:AnotherChildElement>
      Some other data
    </AnotherNameSpace:AnotherChildElement>
  </ANameSpace:AnElement>


Now applying the upper XPath expression works as expected, and delivers the
following
output:

  <output>
  <AnotherNameSpace:AnotherChildElement>
      Some other data
    </AnotherNameSpace:AnotherChildElement></output>

Can anybody please ckeck this problem?

Regards, Gregor
---------------------------------------------------------------
Gregor Karlinger
mailto://gregor.karlinger@iaik.at
http://www.iaik.at
Phone +43 316 873 5541
Institute for Applied Information Processing and Communications
Austria
---------------------------------------------------------------