You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Rob Walker <ro...@softsell.com> on 2002/11/01 11:46:46 UTC

Newbie question

Have just downloaded the CVS version of Xindice and Tomcat and am new 
to both. So excuse my ignorance.

Steps I've take are:

* ant build - seems to have worked

* Completely failed to figure how to start it standalone, since the startup.bat 
file seems to have gone - so investigated Tomcat

* Installed Tomcat 4.1.12

* copied Xindice.war to /wepapps dir. of Tomcat

* start Tomcat

I get the following exceptions on a start:

=====================
31-Oct-2002 17:33:17 org.apache.commons.digester.Digester error
SEVERE: Parse Error at line 9 column -1: Element "servlet" does not allow 
"displ
ay-name" here.
org.xml.sax.SAXParseException: Element "servlet" does not allow "display-
name" h
ere.
        at org.apache.crimson.parser.Parser2.error(Parser2.java:3160)

......
31-Oct-2002 17:33:17 org.apache.commons.digester.Digester error
SEVERE: Parse Error at line 10 column -1: Element "servlet" does not allow 
"desc
ription" here.
org.xml.sax.SAXParseException: Element "servlet" does not allow 
"description" he
re.
        at org.apache.crimson.parser.Parser2.error(Parser2.java:3160)
=====================

However, I also get a database started ok message:

31-Oct-2002 17:33:19 org.apache.xindice.server.XindiceServlet init
INFO: Database successfully started

And I can access the db via http://localhost:8080/xindice-1.1b

So it looks like the exception may not be critical

Anyone got any thoughts/suggestions?

TIA

-- Rob Walker

------- End of forwarded message -------
SoftSell Business Systems, Ltd.
' testing solutions for a changing world '
 
+44 (20) 7488 3470
www.softsell.com
robw@softsell.com


Re: Unable to query using xPath predicate

Posted by jmt <jm...@dxdydz.net>.
Use ad hoc quotes :

xpath -c /db/publications/books -q "//Book[@InStock='yes']"

Mind that quotes can be different according to shells.

On Saturday 02 November 2002 20:34, Roger L. Costello wrote:
> Hi Folks,
>
> I have just started using XIndice.  Please bear with me if my questions
> are naive.
>
> [1] I have stored in a collection the document BookCatalogue.xml.
> Here's a sample of what the document looks like:
>
> <?xml version="1.0"?>
> <BookCatalogue>
>     <Book InStock="yes">
>         <Title>...</Title>
>         <Author>...</Author>
>     </Book>
>     ...
> </BookCatalogue>
>
> Note the InStock attribute.  I would like to issue this query: "Find all
> books that are in-stock".
>
> I believe that here is the appropriate XIndice query:
>
> xpath -c /db/publications/books -q //Book[@InStock="yes"]
>
> However, this results in no nodes being selected.
>
> Am I doing something wrong?  The documentation shows a query with a
> predicate, but I have not been successful at getting queries with
> predicates to work.
>
> [2] I have found that simple XPath expressions without a predicate does
> work.  For example, this works:
>
> xpath -c /db/publications/books -q //Book
>
> However, it returns a series of XML documents (each document contains
> one <Book>...</Book>), not a series of nodes (as the documentation
> indicates).  That is, the query returns:
>
> <?xml version="1.0"?>
> <Book ...>
>    ...
> </Book>
> <?xml version="1.0"?>
> <Book ...>
>    ...
> </Book>
> etc
>
> The documentation says that the results should be simply a series of
> nodes:
>
> <Book ...>
>    ...
> </Book>
> <Book ...>
>    ...
> </Book>
> etc
>
> Again, am I doing something wrong?
>
> [3] The documentation says that XUpdate may be used to update the
> documents in the XIndice database.  However, it provides no indication
> of "how" to actually submit an XUpdate document.  Is there a
> command-line command for submitting an XUpdate document?  Can someone
> give me instructions on the mechanism for using XUpdate with XIndice?
>
> [4] I noticed on the Web site "XIndice was last modified in 2000".  Is
> this technology progressing?  Has work stopped on it?
>
> Thanks!  /Roger

Re: Unable to query using xPath predicate

Posted by Matthew Van Horn <ho...@accesstech.com>.
You'll find it is always safer to wrap the whole xpath query in quotes, 
and then use single quotes in the predicates. This has solved lots of 
problems for me as my shell also has issues with unquoted parentheses 
such as: [contains(Book, 'foo')]

try:  xpath -c /db/publications/books -q "//Book[@InStock='yes']"

On Sunday, November 3, 2002, at 04:34 AM, Roger L. Costello wrote:

> Hi Folks,
>
> I have just started using XIndice.  Please bear with me if my questions
> are naive.
>
> [1] I have stored in a collection the document BookCatalogue.xml.
> Here's a sample of what the document looks like:
>
> <?xml version="1.0"?>
> <BookCatalogue>
>     <Book InStock="yes">
>         <Title>...</Title>
>         <Author>...</Author>
>     </Book>
>     ...
> </BookCatalogue>
>
> Note the InStock attribute.  I would like to issue this query: "Find 
> all
> books that are in-stock".
>
> I believe that here is the appropriate XIndice query:
>
> xpath -c /db/publications/books -q //Book[@InStock="yes"]
>
> However, this results in no nodes being selected.
>
> Am I doing something wrong?  The documentation shows a query with a
> predicate, but I have not been successful at getting queries with
> predicates to work.
>
> [2] I have found that simple XPath expressions without a predicate does
> work.  For example, this works:
>
> xpath -c /db/publications/books -q //Book
>
> However, it returns a series of XML documents (each document contains
> one <Book>...</Book>), not a series of nodes (as the documentation
> indicates).  That is, the query returns:
>
> <?xml version="1.0"?>
> <Book ...>
>    ...
> </Book>
> <?xml version="1.0"?>
> <Book ...>
>    ...
> </Book>
> etc
>
> The documentation says that the results should be simply a series of
> nodes:
>
> <Book ...>
>    ...
> </Book>
> <Book ...>
>    ...
> </Book>
> etc
>
> Again, am I doing something wrong?
>
> [3] The documentation says that XUpdate may be used to update the
> documents in the XIndice database.  However, it provides no indication
> of "how" to actually submit an XUpdate document.  Is there a
> command-line command for submitting an XUpdate document?  Can someone
> give me instructions on the mechanism for using XUpdate with XIndice?
>
> [4] I noticed on the Web site "XIndice was last modified in 2000".  Is
> this technology progressing?  Has work stopped on it?
>
> Thanks!  /Roger
>


Unable to query using xPath predicate

Posted by "Roger L. Costello" <co...@mitre.org>.
Hi Folks,

I have just started using XIndice.  Please bear with me if my questions
are naive.

[1] I have stored in a collection the document BookCatalogue.xml. 
Here's a sample of what the document looks like:

<?xml version="1.0"?>
<BookCatalogue>
    <Book InStock="yes">
        <Title>...</Title>
        <Author>...</Author>
    </Book>
    ...
</BookCatalogue>

Note the InStock attribute.  I would like to issue this query: "Find all
books that are in-stock".

I believe that here is the appropriate XIndice query:

xpath -c /db/publications/books -q //Book[@InStock="yes"]

However, this results in no nodes being selected.

Am I doing something wrong?  The documentation shows a query with a
predicate, but I have not been successful at getting queries with
predicates to work.

[2] I have found that simple XPath expressions without a predicate does
work.  For example, this works:

xpath -c /db/publications/books -q //Book

However, it returns a series of XML documents (each document contains
one <Book>...</Book>), not a series of nodes (as the documentation
indicates).  That is, the query returns:

<?xml version="1.0"?>
<Book ...>
   ...
</Book>
<?xml version="1.0"?>
<Book ...>
   ...
</Book>
etc

The documentation says that the results should be simply a series of
nodes:

<Book ...>
   ...
</Book>
<Book ...>
   ...
</Book>
etc

Again, am I doing something wrong?

[3] The documentation says that XUpdate may be used to update the
documents in the XIndice database.  However, it provides no indication
of "how" to actually submit an XUpdate document.  Is there a
command-line command for submitting an XUpdate document?  Can someone
give me instructions on the mechanism for using XUpdate with XIndice?

[4] I noticed on the Web site "XIndice was last modified in 2000".  Is
this technology progressing?  Has work stopped on it?

Thanks!  /Roger


Re: Newbie question

Posted by "Vladimir R. Bossicard" <vl...@bossicard.com>.
> <display-name>/<description> are in the wrong place. They should be one line up
> outside of the <servlet> tag.

fixed. Thanks

-Vladimir

-- 
Vladimir R. Bossicard
www.bossicard.com


Re: Newbie question

Posted by Jim Branecki <Ji...@sparta.com>.
<display-name>/<description> are in the wrong place. They should be one line up
outside of the <servlet> tag.

Rob Walker wrote:

> > I'm just curious to know why "display-name" it cut in two lines.
> >
> > SEVERE: Parse Error at line 9 column -1: Element "servlet" does not allow
> > "displ
> > ay-name" here.
> >
> > What is your operating system?  (maybe has something to do with the
> > encoding of the file)
>
> Using win2k.
>
> I think the split over two lines is just a cut and paste error of the exception
> output on my part. It wasn't in the original file.
>
> Could the web.xml DTD have changed to make the <display-name> and
> <description> elements invalid in the latest tomcat release? Or maybe these
> tags weren't in original DTD, but tomcat didn't validate/complain about them.
>
> -- Rob
>
> SoftSell Business Systems, Ltd.
> ' testing solutions for a changing world '
>
> +44 (20) 7488 3470
> www.softsell.com
> robw@softsell.com


Re: Newbie question

Posted by Rob Walker <ro...@softsell.com>.
> I'm just curious to know why "display-name" it cut in two lines.
> 
> SEVERE: Parse Error at line 9 column -1: Element "servlet" does not allow
> "displ
> ay-name" here.
> 
> What is your operating system?  (maybe has something to do with the 
> encoding of the file)

Using win2k.

I think the split over two lines is just a cut and paste error of the exception 
output on my part. It wasn't in the original file.

Could the web.xml DTD have changed to make the <display-name> and 
<description> elements invalid in the latest tomcat release? Or maybe these 
tags weren't in original DTD, but tomcat didn't validate/complain about them.

-- Rob

SoftSell Business Systems, Ltd.
' testing solutions for a changing world '
 
+44 (20) 7488 3470
www.softsell.com
robw@softsell.com


Re: Newbie question

Posted by "Vladimir R. Bossicard" <vl...@bossicard.com>.
> Great thanks - took both lines out and no exceptions. Anyone know whether 
> these "leftovers" from an old config, or are they needed when Xindice is 
> used in other configurations (e.g. standalone etc.)

No leftovers, I've added these lines for 1.1.  But it works fine by me 
(never had problems).

I'm just curious to know why "display-name" it cut in two lines.

SEVERE: Parse Error at line 9 column -1: Element "servlet" does not allow
"displ
ay-name" here.

What is your operating system?  (maybe has something to do with the 
encoding of the file)

-Vladimir

-- 
Vladimir R. Bossicard
www.bossicard.com


Re: Newbie question

Posted by Rob Walker <ro...@softsell.com>.
> remove from web.xml line under <servlet> element (that <description>)

Great thanks - took both lines out and no exceptions. Anyone know whether 
these "leftovers" from an old config, or are they needed when Xindice is 
used in other configurations (e.g. standalone etc.)

-- Rob

SoftSell Business Systems, Ltd.
' testing solutions for a changing world '
 
+44 (20) 7488 3470
www.softsell.com
robw@softsell.com


Re: Newbie question

Posted by Philipp Chudinov <fi...@quorus-ms.ru>.
remove from web.xml line under <servlet> element (that <description>)
----- Original Message -----
From: "Rob Walker" <ro...@softsell.com>
To: <xi...@xml.apache.org>
Sent: Friday, November 01, 2002 3:46 PM
Subject: Newbie question


> Have just downloaded the CVS version of Xindice and Tomcat and am new
> to both. So excuse my ignorance.
>
> Steps I've take are:
>
> * ant build - seems to have worked
>
> * Completely failed to figure how to start it standalone, since the
startup.bat
> file seems to have gone - so investigated Tomcat
>
> * Installed Tomcat 4.1.12
>
> * copied Xindice.war to /wepapps dir. of Tomcat
>
> * start Tomcat
>
> I get the following exceptions on a start:
>
> =====================
> 31-Oct-2002 17:33:17 org.apache.commons.digester.Digester error
> SEVERE: Parse Error at line 9 column -1: Element "servlet" does not allow
> "displ
> ay-name" here.
> org.xml.sax.SAXParseException: Element "servlet" does not allow "display-
> name" h
> ere.
>         at org.apache.crimson.parser.Parser2.error(Parser2.java:3160)
>
> ......
> 31-Oct-2002 17:33:17 org.apache.commons.digester.Digester error
> SEVERE: Parse Error at line 10 column -1: Element "servlet" does not allow
> "desc
> ription" here.
> org.xml.sax.SAXParseException: Element "servlet" does not allow
> "description" he
> re.
>         at org.apache.crimson.parser.Parser2.error(Parser2.java:3160)
> =====================
>
> However, I also get a database started ok message:
>
> 31-Oct-2002 17:33:19 org.apache.xindice.server.XindiceServlet init
> INFO: Database successfully started
>
> And I can access the db via http://localhost:8080/xindice-1.1b
>
> So it looks like the exception may not be critical
>
> Anyone got any thoughts/suggestions?
>
> TIA
>
> -- Rob Walker
>
> ------- End of forwarded message -------
> SoftSell Business Systems, Ltd.
> ' testing solutions for a changing world '
>
> +44 (20) 7488 3470
> www.softsell.com
> robw@softsell.com
>
>