I did a bit of research...   My document is <account>.   If I
do a:
    xindice xpath -c /db/customers -q //account

Then I get all of my accounts.   Each account has a <name>.
If I do a:
    xindice xpath -c /db/customers -q //account/name

Then I only get the names from each document.   If I do a:
    xindice xpath -c /db/customers -q //account/@name

Then I get nothing.   However if I do a
    xindice xpath -c /db/customers -q //[EMAIL PROTECTED]

Then I get all the accounts with a name attribute.

Mark


"Mag. Josef Fritsch" wrote:

> Yes, I am sure, my syntax is legal. I tested following xpath expression
> with another software (xmlspy) and got the expected results:
> xpath="//thema/@index "
>
> With this query I want to get the "index" - Attributes of all "thema" nodes,
> this expression is in my opinion a legal xpath expression .
>
> At 13:59 13.03.2002 -0700, you wrote:
> >My java client is an application.   As part of the application, I do
> >"searches".
> >My searches are pretty much pre-defined.   The samples I listed below
> >really look like:
> >
> >..
> >..
> >..
> >     _tagName = _st.nextToken();
> >     xpath = "//*/"+_tagName+"[@"+_st.nextToken()+"='"+getText()+"']";
> >}
> >else if (_foundRootAttribute)
> >{
> >     _st = new StringTokenizer(getFieldName(), ".");
> >     _tagName = _st.nextToken();
> >     xpath = "/"+_tagName+"[@"+_st.nextToken()+"='"+getText()+"']";
> >}
> >else
> >{
> >     xpath = "//*/"+getFieldName()+"[text()='"+getText()+"']";
> >..
> >..
> >..
> >
> >However, I went to the xpath tutorial and all the attribute queries use
> >the "[EMAIL PROTECTED]'someText']".   I don't know if you can do it your way?
> >The final answer, as Tom has pointed out, is the XPath Documentation on
> >W3C.   Check there and see if you syntax is legal for XPath.   If it is, then
> >Xindice
> >should support it and if it doesn't then it is probably a bug.   Does it work
> >from the
> >command-line?
> >
> >HTH,
> >
> >Mark
> >
> >"Mag. Josef Fritsch" wrote:
> >
> > > What does your java client on following xpath-Expression:
> > >
> > > xpath="//myTag/@attribute"
> > >
> > > At 13:04 13.03.2002 -0700, you wrote:
> > > >Some samples...
> > > >
> > > >Looking for an attribute...
> > > >
> > > >     xpath = "//*/[EMAIL PROTECTED]'someText']";
> > > >
> > > >Looking for an attribute from the root:
> > > >
> > > >     xpath = "/[EMAIL PROTECTED]'someText']";
> > > >
> > > >Looking for a Tag:
> > > >
> > > >     xpath = "//*/myTag[text()='myTagText']";
> > > >
> > > >
> > > >XPath Tutorial:
> > > >
> > > >  http://www.zvon.org/xxl/XPathTutorial/General/examples.html
> > > >
> > > >
> > > >Mark
> > > >
> > > >"Mark J. Stang" wrote:
> > > >
> > > > > I have a java client that does xpath queries.   It queries on both
> > > > > attributes and tags.   I have tested most of the xpath searches as
> > > > > part of my application, so it does work.   Typically, your query isn't
> > > > > correct ;-).   What does your document look like and your
> > > > > query?
> > > > >
> > > > > Mark
> > > > >
> > > > > "Mag. Josef Fritsch" wrote:
> > > > >
> > > > > > Hey Mark,
> > > > > > thank you very much for answering. I know the problems with the
> > windows
> > > > > > command-line. I tested my xpath-Expressions with java-xsp under
> > > > cocoon2 and
> > > > > > i suspect this is a bug in xindice. It would be very interesting for
> > > > me if
> > > > > > anyone has tested similiar expressions with a java client.
> > > > > > Best Regards
> > > > > > Joe
> > > > > >
> > > > > > At 09:32 13.03.2002 -0700, you wrote:
> > > > > > >The best solution for windows is to put it in double
> > quotes.   If you
> > > > > > >send me your entire command-line, I can tell you where to put the
> > > > > > >quotes.  The problem is that windows is parsing your query rather
> > > > > > >than passing it into xindice.   So if you put quotes around it, 
> > > > > > >then
> > > > > > >windows will pass it in untouched.
> > > > > > >
> > > > > > >Mark
> > > > > > >
> > > > > > >Jan Metzner wrote:
> > > > > > >
> > > > > > > > > I have installed xml-xindice-1.0rc2 on Win2000. Everything
> > > > works fine,
> > > > > > > > > only xpath - Expressions like:
> > > > > > > > > //[EMAIL PROTECTED]'Sprenger']  or
> > > > > > > > I don't use windows, but it is possible that you have to
> > escape the
> > > > > > > > query if you use the command line client:
> > > > //[EMAIL PROTECTED]'Sprenger\']
> > > > > > > > > //[EMAIL PROTECTED]
> > > > > > > > this should work.
> > > > > > > >
> > > > > > > > Jan

Reply via email to