gui version possible bug with handling xml attributes?
Tuesday, 25 May 2010 · 5 messages · last reply 26 May 2010
SS
Sandra Maria Silcot25 May 2010 04:03 #
Hello all,
I am experiencing this odd behaviour in the gui version of basex v6.1 on windows xp. When using the Explorer panel and I choose an attribute (prefixed with "@"), the query info panel reports:
Error: [XPST0003] Unexpected end of query: '@seriesId[text(...'.
It presents the attribute values correctly in the drop down display, but if I select a value or try to filter, nothing happens and the error message is repeated.
It looks like it thinks its processing an element. Shouldn't attribute queries be written as "data(@attrName)"?
I am not sure when this crept in. Is anyone else experiencing this behavior? I am getting this on any xml document having attributes in the gui version.
Thanks for any insight.
Cheers all,
Sandra
LK
Lukas Kircher25 May 2010 12:00 #
Hello Sandra,
in fact this looks like a bug in BaseX 6.1. A code review of our current repository version showed that this has already been taken care of.
For a fixed version of BaseX, feel free to check out our repository. Please keep in mind that the repository content is not rated stable.
Please don't hesitate to ask if you have further problems.
Kind regards,
Lukas
Quoted text · Sandra Maria Silcot · 37 lines
On May 25, 2010, at 4:03 AM, Sandra Maria Silcot wrote: > Hello all, > > I am experiencing this odd behaviour in the gui version of basex > v6.1 on > windows xp. When using the Explorer panel and I choose an attribute > (prefixed with "@"), the query info panel reports: > > Error: [XPST0003] Unexpected end of query: '@seriesId[text(...'. > > It presents the attribute values correctly in the drop down display, > but > if I select a value or try to filter, nothing happens and the error > message is repeated. > > It looks like it thinks its processing an element. Shouldn't attribute > queries be written as "data(@attrName)"? > > I am not sure when this crept in. Is anyone else experiencing this > behavior? I am getting this on any xml document having attributes in > the > gui version. > > Thanks for any insight. > > Cheers all, > Sandra > > > > > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
LK
Hello again,
you can download a jar-file for BaseX 6.1.2 here.
Hope this helps ...
Kind regards,
Lukas
Quoted text · Sandra Maria Silcot · 37 lines
On May 25, 2010, at 4:03 AM, Sandra Maria Silcot wrote: > Hello all, > > I am experiencing this odd behaviour in the gui version of basex > v6.1 on > windows xp. When using the Explorer panel and I choose an attribute > (prefixed with "@"), the query info panel reports: > > Error: [XPST0003] Unexpected end of query: '@seriesId[text(...'. > > It presents the attribute values correctly in the drop down display, > but > if I select a value or try to filter, nothing happens and the error > message is repeated. > > It looks like it thinks its processing an element. Shouldn't attribute > queries be written as "data(@attrName)"? > > I am not sure when this crept in. Is anyone else experiencing this > behavior? I am getting this on any xml document having attributes in > the > gui version. > > Thanks for any insight. > > Cheers all, > Sandra > > > > > > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
SS
Sandra Maria Silcot26 May 2010 11:34 #
Lukas,
I can confirm that the latest version 6.1.3 solves the attribute access problem in the Gui. Thankyou very much.
One other strangeness, unrelated, concerning xml:id attributes.
I have an element like so:
<hgf xml:id="hgf182400002" n="182400002" >
...
</hgf>
Approaching 200,000 or so. Attribute index exists.
Queries like this are very very fast:
XQUERY //hgf[@n="182400002"] OK 1.12 ms
but queries like this:
XQUERY //hgf[@xml:id="hgf182400002"] OK 646.69 ms
are positively glacial in comparison,
whilst this "direct access" to the index is quick:
XQUERY basex:index("hgf182400001","attribute")/.. OK 1.02 ms
I find it quite useful to have @xml:id's in documents without schemas as I can get a quick xml well formedness and basic id/idref validation by parsing with LibXML2 in Perl. But basex is so slow on these I am thinking of stripping out the '@xml:' part of the id attributes prior to loading in basex. If possible I'd like to avoid this.
So my query -- does basex support @xml:id and if so why is accessing such ids so slow in comparison to other attributes? Some kind of namespace issue perhaps?
http://www.w3.org/TR/xml-id/
cheers all.
Sandra
Quoted text · Lukas Kircher · 51 lines
> Hello again, > > you can download a jar-file for BaseX 6.1.2 here. > > Hope this helps ... > > Kind regards, > Lukas > > > > On May 25, 2010, at 4:03 AM, Sandra Maria Silcot wrote: > >> Hello all, >> >> I am experiencing this odd behaviour in the gui version of basex >> v6.1 on >> windows xp. When using the Explorer panel and I choose an attribute >> (prefixed with "@"), the query info panel reports: >> >> Error: [XPST0003] Unexpected end of query: '@seriesId[text(...'. >> >> It presents the attribute values correctly in the drop down display, >> but >> if I select a value or try to filter, nothing happens and the error >> message is repeated. >> >> It looks like it thinks its processing an element. Shouldn't attribute >> queries be written as "data(@attrName)"? >> >> I am not sure when this crept in. Is anyone else experiencing this >> behavior? I am getting this on any xml document having attributes in >> the >> gui version. >> >> Thanks for any insight. >> >> Cheers all, >> Sandra >> >> >> >> >> >> >> _______________________________________________ >> BaseX-Talk mailing list >> BaseX-Talk at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > >
CG
Christian Grün26 May 2010 12:19 #
Sandra,
nice to see your problem has aready been solved.
Quoted text · Sandra Maria Silcot · 6 lines
> Queries like this are very very fast: > XQUERY //hgf[@n="182400002"] OK 1.12 ms > > but queries like this: > XQUERY //hgf[@xml:id="hgf182400002"] OK 646.69 ms > are positively glacial in comparison,
You got it right; the index is not chosen as a prefix is specified in the predicate test. The complexity of the Namespace specification makes optimizations pretty nasty (although the static xml prefix could be handled rather easy), which is why we skip some compilation steps if a prefix is given. The following query should be evaluated much faster (although it's not exactly the same as yours):
//hgf[@*:id="hgf182400002"]
If you want to get sure that your id attribute belongs to the xml namespace, you can add a second, more specific attribute:
//*[@*:id = 'jff001'][@xml:id = 'jff001']
Hope this helps,
Christian
Written for BaseX 6. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery