Re: [xml] Question regarding XPath

Hi, William.

Thanks for your response.  Comments below.

On Fri, 16 Mar 2007 08:48:53 -0500, William M. Brack <wbrack mmm com hk> wrote:

I'm not sure about your data, but using my own testfile it seems xpath1.c
does the RightThing as well:

[bill bbsuper work]$ cat test1.xsd
<?xml version="1.0"?>
<xs:schema xmlns:xs="";>
  <xs:element name="a" type="A"/>

This is a stripped version of the schema we're using:

$ cat streamerror.xsd
<?xml version="1.0"?>

<xs:schema xmlns:xs="";>
  <xs:element name="bad-format" type="empty"/>

[bill bbsuper work]$ ./xpath1 test1.xsd //xs:element
Result (1 nodes):
= element node "";
[bill bbsuper work]$

Execution without a qualifying namespace:

$ ./xpath1 streamerror.xsd //xs:element
XPath error : Undefined namespace prefix
XPath error : Invalid expression
Error: unable to evaluate xpath expression "//xs:element"

Execution with the namespace specified on the command-line:

$ ./xpath1 streamerror.xsd //xs:element xs=
Result (0 nodes):

Where do we differ?

For whatever it's worth, this is compiled from scratch on WinXP/AMD64. We'd like to strip down the components to what we really need, but I've compiled in everything here. The only item turned off is iconv, which we don't have here. Is it possible that the problems we're running into are architecture related?

I'm using libxml2-2.6.27.

More followup under Daniel's post.



Objective Systems, Inc.
Tel: +1 (484) 875-9841
Fax: +1 (484) 875-9830
Toll-free: (877) 307-6855 (USA only)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]