You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by Michael Westbay <we...@users.sourceforge.net> on 2002/07/20 17:49:44 UTC

xpath on recent CVS (was: Re: vendor error 2070 with XUpdate)

Kevin McCarty-san wrote:

> I am having trouble running XUPDATE.
>
> When i run this from the command line (redhat) it works:
>
> xindice xpath -c /db/tpri/teacherData -q /data/teacher/student
> [@social_security_number=\'311-11-1111\']

Odd.  I'm having a problem with xpath.  With the latest CVS build, I always 
get "null" for any xpath query document returned.  Given the following 
document (I substitued "?"s for the Japanese characters so as not to break 
anyone's mailer):

  bash-2.04$ xindice rd -c /db/proyakyu/players -n 5                    
  <?xml version="1.0"?>
  <player id="5">
  <name lang="en">
  <given>Kazuhiro</given>
  <surname>Kiyohara</surname>
  </name>
  <name lang="ja">
  <given>??</given>
  <surname>??</surname>
  </name>
  <name lang="ja_kana">
  <given>????</given>
  <surname>????</surname>
  </name>
  <born>
  <date-of-birth>1967-08-18</date-of-birth>
  <place-of-birth xref="/places/place[@id=&apos;5&apos;]" />
  </born>
  <education>
  <high-school koshien="true" xref="/schools/school[@id=&apos;0&apos;]" />
  </education>
  <entered draft-pick="1" year="1986" xref="/teams/team[@id=&apos;SL&apos;]" 
/>
  </player>

The xpath query for /player[@id=5] (with and without quotes) returns:

  bash-2.04$ xindice xpath -c /db/proyakyu/players -q "/player[@id=5]"
  null
  bash-2.04$ xindice xpath -c /db/proyakyu/players -q "/player[@id=5]/name"
  null
  null
  null
  bash-2.04$ xindice xpath -c /db/proyakyu/players -q "/player"
  null
  null
  ... [about 1500 times]
  
As you can see, the unique document query returns a single null, there are 
three "name"s (English, Kanji, and Kana), all being returned as null 
documents, and the query for all "player"s returns a null for each document 
(about 1,500 of them).  So the xpath query is finding something, but it is 
not being returned.

I know with all of the updating going on recently that things are likely to 
break, but has anyone else had success with xpath command line queries with 
the most recent CVS builds?

["player@id" is indexed to an int type.  This really sped up the searches.]

Platform:
   OS:  FreeBSD 4.6
  JVM:  java version "1.3.1-internal"
        Java(TM) 2 Runtime Environment, Standard Edition (build 
1.3.1-internal-westbay-020114-01:24)
        Classic VM (build 1.3.1-internal-westbay-020114-01:24, green threads, 
nojit)

I'd just like confirmation that xpath works from the command line on the most 
recent CVS builds.  Thank you.

-- 
Michael Westbay
Work: Beacon-IT http://www.beacon-it.co.jp/
Home:           http://www.seaple.icc.ne.jp/~westbay
Commentary:     http://www.japanesebaseball.com/forum/


Re: xpath on recent CVS (was: Re: vendor error 2070 with XUpdate)

Posted by Michael Westbay <we...@users.sourceforge.net>.
Staken-san wrote:

> It was broken. Should be fixed now.

That did the trick.  I verify that the patch works.

Thank you.

-- 
Michael Westbay
Work: Beacon-IT http://www.beacon-it.co.jp/
Home:           http://www.seaple.icc.ne.jp/~westbay
Commentary:     http://www.japanesebaseball.com/forum/


Re: xpath on recent CVS (was: Re: vendor error 2070 with XUpdate)

Posted by Kimbro Staken <ks...@xmldatabases.org>.
It was broken. Should be fixed now.

On Saturday, July 20, 2002, at 08:49  AM, Michael Westbay wrote:

> Kevin McCarty-san wrote:
>
>> I am having trouble running XUPDATE.
>>
>> When i run this from the command line (redhat) it works:
>>
>> xindice xpath -c /db/tpri/teacherData -q /data/teacher/student
>> [@social_security_number=\'311-11-1111\']
>
> Odd.  I'm having a problem with xpath.  With the latest CVS build, I 
> always
> get "null" for any xpath query document returned.  Given the following
> document (I substitued "?"s for the Japanese characters so as not to break
> anyone's mailer):
>
>   bash-2.04$ xindice rd -c /db/proyakyu/players -n 5
>   <?xml version="1.0"?>
>   <player id="5">
>   <name lang="en">
>   <given>Kazuhiro</given>
>   <surname>Kiyohara</surname>
>   </name>
>   <name lang="ja">
>   <given>??</given>
>   <surname>??</surname>
>   </name>
>   <name lang="ja_kana">
>   <given>????</given>
>   <surname>????</surname>
>   </name>
>   <born>
>   <date-of-birth>1967-08-18</date-of-birth>
>   <place-of-birth xref="/places/place[@id=&apos;5&apos;]" />
>   </born>
>   <education>
>   <high-school koshien="true" xref="/schools/school[@id=&apos;0&apos;]" /
> >
>   </education>
>   <entered draft-pick="1" year="1986" xref="/teams/team[@id=&apos;SL&apos;
> ]"
> />
>   </player>
>
> The xpath query for /player[@id=5] (with and without quotes) returns:
>
>   bash-2.04$ xindice xpath -c /db/proyakyu/players -q "/player[@id=5]"
>   null
>   bash-2.04$ xindice xpath -c /db/proyakyu/players -q 
> "/player[@id=5]/name"
>   null
>   null
>   null
>   bash-2.04$ xindice xpath -c /db/proyakyu/players -q "/player"
>   null
>   null
>   ... [about 1500 times]
>
> As you can see, the unique document query returns a single null, there are
> three "name"s (English, Kanji, and Kana), all being returned as null
> documents, and the query for all "player"s returns a null for each 
> document
> (about 1,500 of them).  So the xpath query is finding something, but it is
> not being returned.
>
> I know with all of the updating going on recently that things are likely 
> to
> break, but has anyone else had success with xpath command line queries 
> with
> the most recent CVS builds?
>
> ["player@id" is indexed to an int type.  This really sped up the searches.
> ]
>
> Platform:
>    OS:  FreeBSD 4.6
>   JVM:  java version "1.3.1-internal"
>         Java(TM) 2 Runtime Environment, Standard Edition (build
> 1.3.1-internal-westbay-020114-01:24)
>         Classic VM (build 1.3.1-internal-westbay-020114-01:24, green 
> threads,
> nojit)
>
> I'd just like confirmation that xpath works from the command line on the 
> most
> recent CVS builds.  Thank you.
>
> --
> Michael Westbay
> Work: Beacon-IT http://www.beacon-it.co.jp/
> Home:           http://www.seaple.icc.ne.jp/~westbay
> Commentary:     http://www.japanesebaseball.com/forum/
>
>
Kimbro Staken
Java and XML Software, Consulting and Writing http://www.xmldatabases.org/
Apache Xindice native XML database http://xml.apache.org/xindice
XML:DB Initiative http://www.xmldb.org