Hi,

I mis-understood the changes Julian proposed for xindice.bat. Sorry ...
After I changed the following lines (that's actually I think what he
meant):

REM set CL=
REM :LOOP
REM if "%1"=="" goto DONE
REM set CL=%CL% %1
REM shift
REM goto LOOP
REM :DONE

set CL=%1 %2 %3 %4 %5 %6 %7 %8 %9

it worked.

Example:

c:\Programme\xml-xindice-1.0\java\examples\guide\xml>xindice.bat xpath
-c /db/addressbook -q "/person/[EMAIL PROTECTED]'home']"
<?xml version="1.0"?>
<phone type="home" xmlns:src="http://xml.apache.org/xindice/Query";
src:col="/db/addressbook"
src:key="7e7aa7c01f9fdabb000000ef0d4b254e">534-567-8901</phone>
<?xml version="1.0"?>
<phone type="home" xmlns:src="http://xml.apache.org/xindice/Query";
src:col="/db/addressbook"
src:key="7e7aa7c01f9fdabb000000ef0d4b372f">234-567-8901</phone>

Or

c:\Programme\xml-xindice-1.0\java\examples\guide\xml>xindice.bat
xpath_query -c /db/klemens -q "/[EMAIL PROTECTED]'120320']"
<?xml version="1.0"?>
<product product_id="120320"
xmlns:src="http://xml.apache.org/xindice/Query"; src
:col="/db/klemens" src:key="test3">
   <description>Glazed Ham</description>
</product>


Not very ellegant I know, but as long as it works ...

Klemens

-----Urspr�ngliche Nachricht-----
Von: Dr. Klemens Waldh�r [mailto:[EMAIL PROTECTED] 
Gesendet: Montag, 15. Juli 2002 11:06
An: [email protected]
Betreff: AW: AW: AW: XPATH usage


Hi,

I checked now the command line output produced by xindice.bat

It is like:

c:\Programme\xml-xindice-1.0\java\examples\guide\xml>java -Xms16m
-Xmx128m -Djav
a.endorsed.dirs="c:\Programme\xml-xindice-1.0\java\lib\xerces-1.4.3.jar"
-Djacor
b.verbosity=0 -Dxindice.home=c:\Programme\xml-xindice-1.0
-Dcmd.home=c:\Programm
e\xml-xindice-1.0\bin -classpath
%CLASSPATH%;c:/projects/java;c:\Programme\xml-x
indice-1.0\java\lib\Xindice.jar;c:/projects/java;c:\Programme\xml-xindic
e-1.0\ja
va\lib\Xindice.jar;c:/projects/java;c:\Programme\xml-xindice-1.0\java\li
b\Xindic
e.jar;\config;c:\Programme\xml-xindice-1.0\java\lib\ant-1.4.1.jar;c:\Pro
gramme\x
ml-xindice-1.0\java\lib\apache-xmlrpc.jar;c:\Programme\xml-xindice-1.0\j
ava\lib\
examples.jar;c:\Programme\xml-xindice-1.0\java\lib\infozone-tools.jar;c:
\Program
me\xml-xindice-1.0\java\lib\openorb-1.2.0.jar;c:\Programme\xml-xindice-1
.0\java\
lib\openorb_tools-1.2.0.jar;c:\Programme\xml-xindice-1.0\java\lib\xalan-
2.0.1.ja
r;c:\Programme\xml-xindice-1.0\java\lib\xerces-1.4.3.jar;c:\Programme\xm
l-xindic
e-1.0\java\lib\xindice-http-0.8.jar;c:\Programme\xml-xindice-1.0\java\li
b\xindic
e-http.jar;c:\Programme\xml-xindice-1.0\java\lib\xindice-xmlrpc-0.6.jar;
c:\Progr
amme\xml-xindice-1.0\java\lib\xindice.jar;c:\Programme\xml-xindice-1.0\j
ava\lib\
xml-apis-1.0.jar;c:\Programme\xml-xindice-1.0\java\lib\xmldb-sdk.jar;c:\
Programm
e\xml-xindice-1.0\java\lib\xmldb-xupdate.jar;c:\Programme\xml-xindice-1.
0\java\l ib\xmldb.jar;c:\Programme\Java\j2sdk1.4.0_01\lib\tools.jar
org.apache.xindice.to
ols.XMLUserTools  xpath -c /db/addressbook -q /person/[EMAIL PROTECTED]
"home"]

>From the last line one sees that the problem is that somewhere "=" gets
lost for the attribute. 
It should  be: [EMAIL PROTECTED]"home"]
Maybe this is XP command line problem as all other solutions using ' for
quoting do not work either.

Klemens

-----Urspr�ngliche Nachricht-----
Von: Dr. Klemens Waldh�r [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 9. Juli 2002 18:04
An: [email protected]
Betreff: AW: AW: AW: XPATH usage


Hi,

I made the changes you proposed. The query as such works now but -
surprise - it always returns now the same answer:

c:\Programme\xml-xindice-1.0>xindice xpath_query -c /db/klemens -q
/[EMAIL PROTECTED]"120320"] <?xml version="1.0"?> <product
product_id="120320" xmlns:src="http://xml.apache.org/xindice/Query";
src:col="/db/klemens" src:key="test3">
   <description>Glazed Ham</description>
</product>

c:\Programme\xml-xindice-1.0>xindice xpath_query -c /db/klemens -q
[EMAIL PROTECTED]"de"] <?xml version="1.0"?> <product product_id="120320"
xmlns:src="http://xml.apache.org/xindice/Query"; src:col="/db/klemens"
src:key="test3">
   <description>Glazed Ham</description>
</product>

I just changed the last lines in the bat file:

REM set CL=
REM :LOOP
REM if "%1"=="" goto DONE
REM set CL=%CL% %1
REM shift
REM goto LOOP
REM :DONE

:runAnt
%JAVACMD% -Xms16m -Xmx128m -Djacorb.verbosity=0
-Dxindice.home=%XINDICE_HOME% -Dcmd.home=%XINDICE_HOME%\bin -classpath
%LOCALCLASSPATH% org.apache.xindice.tools.XMLUserTools %CL%



:end
set LOCALCLASSPATH=

Klemens

-----Urspr�ngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 9. Juli 2002 14:48
An: [email protected]
Betreff: Re: AW: AW: XPATH usage


There is (was?) a bug in the window's command file for 
Xindice which incorrectly passes the command line 
parameters to the java application.  I posted a revised 
command file some weeks back to this group which 
resolved the issue.

Julian
> Hi,
> 
> This does not work either. The really curious thing is that sometimes 
> other queries work.
> 
> I tried the query also in some XINDICE browser and there it does not 
> work too. Thus I think this has nothing to do with the way how Windows
> (XP) treats command lines.
> 
> Klemens
> 
> -----Urspr�ngliche Nachricht-----
> Von: Mark J. Stang [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 8. Juli 2002 15:06
> An: [email protected]
> Betreff: Re: AW: XPATH usage
> 
> 
> Shouldn't it be:
> 
> xindice xpath -c /db/klemens -q "/[EMAIL PROTECTED]'120320']"
> 
> xpath not xpath_query...
> 
> Mark
> 
> "Dr. Klemens Waldh�r" wrote:
> 
> > I tried this too. The answer I get is:
> >
> > c:\Programme\xml-xindice-1.0>xindice xpath_query -c /db/klemens -q
> > "/[EMAIL PROTECTED]'120320']" Results in:
> >
> > "='120320']""==""" ist syntaktisch an dieser Stelle nicht
> > verarbeitbar.
> >
> > Which literally translated means: "='120320']""==""" cannot be 
> > treated
> > (?) syntactically at this point.
> >
> > Klemens
> >
> > -----Urspr�ngliche Nachricht-----
> > Von: Mark J. Stang [mailto:[EMAIL PROTECTED]
> > Gesendet: Samstag, 6. Juli 2002 21:52
> > An: [email protected]
> > Betreff: Re: XPATH usage
> >
> > This is necessary on Windows.   Otherwise, the command-line parser
in
> > windows gets screwed up.   It is a platform thing...
> >
> > Mark
> >
> > "Richard R. Liu" wrote:
> >
> > > Try
> > >
> > > xindice xpath_query -c /db/klemens -q
> > > "/[EMAIL PROTECTED]'120320']"
> > >
> > > i.e., double quotes around the query and single quotes within it.
> > >
> > > > -----Original Message-----
> > > > From: Rizwan Virk [mailto:[EMAIL PROTECTED]
> > > > Sent: Saturday, July 06, 2002 17:07
> > > > To: [email protected]
> > > > Subject: RE: XPATH usage
> > > >
> > > >
> > > > hi,
> > > >
> > > > try it with single quotes ... this makes a difference sometimes
> > > > ... /[EMAIL PROTECTED]'120320']
> > > >
> > > > Thanks
> > > > Riz
> > > >
> > > > ------------------------------
> > > > Riz Virk, (617) 905-3518
> > > > [EMAIL PROTECTED], [EMAIL PROTECTED]
> > > > http://www.xyztechnologies.com
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Dr. Klemens Waldh�r [mailto:[EMAIL PROTECTED]
> > > > Sent: Saturday, July 06, 2002 10:54 AM
> > > > To: [email protected]
> > > > Subject: XPATH usage
> > > >
> > > >
> > > > Hi,
> > > >
> > > > I tried several times to run the XPATH example given in the user

> > > > manual. It does not seem to work.
> > > >
> > > > I imported several files. Also one with given in the manual. My
> > > > collectionn is called db/klemens.
> > > >
> > > > <?xml version="1.0"?>
> > > > <product product_id="120320">
> > > >    <description>Glazed Ham</description>
> > > > </product>
> > > >
> > > > Now when I search using
> > > >
> > > > c:\projects\perl\tm>xindice xpath_query -c /db/klemens -q
> > > > /[EMAIL PROTECTED]"120320"]
> > > >
> > > > ====> No result !
> > > >
> > > > If I use the following simple XPATH query instead:
> > > >
> > > > c:\projects\perl\tm>xindice xpath_query -c /db/klemens -q 
> > > > /product
> > > >
> > > > I get:
> > > >
> > > >
> > > > <?xml version="1.0"?> <product product_id="120320"
> > > > xmlns:src="http://xml.apache.org/xindice/Query";
> > > > sr:col="/db/klemens"
> >
> > > > src:key="test3">
> > > >    <description>Glazed Ham</description>
> > > > </product>
> > > > c:\projects\perl\tm>
> > > >
> > > > It works ! Now what's wrong with the first query ? Do I have to
> > > > create an index ? I am really wondering.
> > > >
> > > > With regard to the article mentioned at XINDICE realm it should
> > > > work
> >
> > > > too (Apache's Xindice Organizes XML Data Without Schema). The
> > > > example there is as follows (although one has to adapt it
because 
> > > > this is not a valid
> > > > XML document and XINDICE recognises this bug)
> > > >
> > > > "     <?xml version="1.0"?>
> > > >      <product product_id="1" type="widget">
> > > >           <description>foo</description>
> > > >      </product>
> > > >      <product product_id="2" type="widget">
> > > >           <description>bar</description>
> > > >      </product>
> > > >      <product product_id="3" type="widget">
> > > >           <description>foobar</description>
> > > >      </product>
> > > >
> > > > And the author states: If I wanted to write an XPath query to
> > > > select
> >
> > > > the second product, I could use the following query string:
> > > >      /[EMAIL PROTECTED]"2"]
> > > > "
> > > >
> > > > So theoretically my statement is correct.
> > > >
> > > > Thanks for your help !
> > > >
> > > > I also used the query in some of the browsers avalable for 
> > > > XINDICE
> 
> > > > and it does not work either. Curiously other queries sometimes
> > > > work,
> >
> > > > sometimes not. And it hard to see why one query works and the
> > > > other not.
> > > >
> > > > Another question: Is there an easy way to check if XINDICE is
> > > > running or not ? Idea is to check through the web if the server
is
> 
> > > > running or not on a specific machine.
> > > >
> > > > BTW: XINDICE is a cool tool.
> > > >
> > > > Klemens
> > > >
> > > >
> >
> > --
> > Mark J Stang
> > System Architect
> > Cybershop Systems
> 
> --
> Mark J Stang
> System Architect
> Cybershop Systems
> 
> 

Reply via email to