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 Julie McCabe <ju...@qub.ac.uk> on 2003/07/18 16:16:17 UTC
XUpdateQueryService work around
Hello,
Has anybody got xupdate:modifications working with XUpdateQueryService? is
there a known list of problems as I cant get it working for a number of
collections. The work around I've had to do is query for the resource, get
the content, modify it using Java (substring etc) then remove the resource
from the database and create a new resource with the modified content.
I would prefer to use XUpdateQueryService for simplicity and scalabilty but
its falling over on a 641 error - as mentioned in a previous mail to the
list. My config is Java 1.4.1 and Xindice 1.1b1.
Thanks
Julie
Re: XUpdateQueryService work around
Posted by Charles Hsiao <ch...@mrxsolutions.com>.
I don't think it is a correct xupdate syntax.
I will suggest you to get the position of
On Friday, August 1, 2003, at 11:21 AM,
<ja...@phosphorix.co.uk> wrote:
> <xupdate:modifications version="1.0"
> xmlns:xupdate=http://www.xmldb.org/xupdate>
> <xupdate:update
> select="/learnerinformation/identification/contentype/
> referential[indexid =
> '211653']">
> testupdateofsourceid
> </xupdate:update>
> </xupdate:modifications>
Charles Hsiao
MRX Solutions Corp.
Smart Practice, Smart Solutions
http://www.mrxsolutions.com
Re: XUpdateQueryService work around
Posted by Charles Hsiao <ch...@mrxsolutions.com>.
Try this.
<xupdate:modifications version="1.0"
xmlns:xupdate=http://www.xmldb.org/xupdate>
<xupdate:update
select="/learnerinformation/identification/contentype[indexid=211653]/
referential>
testupdateofsourceid
</xupdate:update>
</xupdate:modifications>
On Friday, August 1, 2003, at 11:21 AM,
<ja...@phosphorix.co.uk> wrote:
> <xupdate:modifications version="1.0"
> xmlns:xupdate=http://www.xmldb.org/xupdate>
> <xupdate:update
> select="/learnerinformation/identification/contentype/
> referential[indexid =
> '211653']">
> testupdateofsourceid
> </xupdate:update>
> </xupdate:modifications>
Charles Hsiao
MRX Solutions Corp.
Smart Practice, Smart Solutions
http://www.mrxsolutions.com
Re: XUpdateQueryService work around
Posted by ja...@phosphorix.co.uk.
Hi All,
What exactly is meant by 'You have to match namespaces and everything up'?
I'm having a problem utilising XUpdate too.
I'm using the below xupdate
<xupdate:modifications version="1.0"
xmlns:xupdate=http://www.xmldb.org/xupdate>
<xupdate:update
select="/learnerinformation/identification/contentype/referential[indexid =
'211653']">
testupdateofsourceid
</xupdate:update>
</xupdate:modifications>
on a single document in the collection
<learnerinformation>
<comment>A basic example of creating a LIP record.</comment>
<identification>
<contentype>
<referential>
<indexid>211653</indexid>
</referential>
</contentype>
</identification>
</learnerinformation>
When I call the update method of the XUpdateQueryService I get the error
below.
XML:DB Exception occurred
Error Code : 1
Message : Query Style Not Found
Trace:
XUpdateQueryServiceImpl.java :
org.apache.xindice.client.xmldb.services.XUpdateQueryServiceImpl :
updateResult : 170 :
XUpdateQueryServiceImpl.java :
org.apache.xindice.client.xmldb.services.XUpdateQueryServiceImpl : update :
185 :
I'm running on a FreeBSD 4.8 with JDK1.4.1 and xindice 1.0
Please help. I'm new to java, and although I know the basics of XML as
markup and some idea of what namespace are and how they are used, I seem to
be clueless in this case as the only namespace I see is 'xupdate:'.
James
----- Original Message -----
From: "Mark J. Stang" <ma...@earthlink.net>
To: <xi...@xml.apache.org>
Sent: Friday, July 18, 2003 3:33 PM
Subject: Re: XUpdateQueryService work around
> I have XUpdate working just fine. I think there is something wrong with
your
> XML doc. Check out Kimbro's web page
> http://www.xmldatabases.org/projects/XUpdate-UseCases/
>
> You have to match the namespaces and everything up...
>
> HTH,
>
> Mark
>
> Julie McCabe wrote:
>
> > Hello,
> >
> > Has anybody got xupdate:modifications working with XUpdateQueryService?
is
> > there a known list of problems as I cant get it working for a number of
> > collections. The work around I've had to do is query for the resource,
get
> > the content, modify it using Java (substring etc) then remove the
resource
> > from the database and create a new resource with the modified content.
> >
> > I would prefer to use XUpdateQueryService for simplicity and scalabilty
but
> > its falling over on a 641 error - as mentioned in a previous mail to the
> > list. My config is Java 1.4.1 and Xindice 1.1b1.
> >
> > Thanks
> > Julie
>
> --
> Mark J Stang
> System Architect
> Cybershop Systems
>
>
Re: XUpdateQueryService work around
Posted by "Mark J. Stang" <ma...@earthlink.net>.
I have XUpdate working just fine. I think there is something wrong with your
XML doc. Check out Kimbro's web page
http://www.xmldatabases.org/projects/XUpdate-UseCases/
You have to match the namespaces and everything up...
HTH,
Mark
Julie McCabe wrote:
> Hello,
>
> Has anybody got xupdate:modifications working with XUpdateQueryService? is
> there a known list of problems as I cant get it working for a number of
> collections. The work around I've had to do is query for the resource, get
> the content, modify it using Java (substring etc) then remove the resource
> from the database and create a new resource with the modified content.
>
> I would prefer to use XUpdateQueryService for simplicity and scalabilty but
> its falling over on a 641 error - as mentioned in a previous mail to the
> list. My config is Java 1.4.1 and Xindice 1.1b1.
>
> Thanks
> Julie
--
Mark J Stang
System Architect
Cybershop Systems
Re: XUpdateQueryService work around
Posted by "Mark J. Stang" <ma...@earthlink.net>.
I concur, if you don't get the namespaces EXACTLY right it fails. Try Kimbros
examples and walk through them. XUpdate does work, I have been using
it for two years. I run it as part of my JUnit tests.
hth,
Mark
Jeff Greif wrote:
> It worked for me in a much older version of Xindice well about a year ago.
> I suggest that you try to get some of the XUpdate examples to work. I
> noticed a couple of things in your update query that might be problematical:
> 1. Some namespaces used in the query, and no namespace prefixes in the
> xpath used for select=. If your documents use namespaces, this won't work,
> because xpath steps whose names do not contain prefixes are assumed to be
> elements or attributes in *no* namespace (not the default namespace). If
> you need to put in namespaces, you also need to provide some namespace
> context (so the prefixes can be resolved to namespaces). I don't remember
> how to do this, but it is probably documented. If your documents use
> namespaces, you also have to worry about whether elements and attributes are
> qualified or not, as this also affects where or whether prefixes are needed
> in the xpaths.
> 2. When you query xindice, you cannot extract an attribute without its
> containing element. It may be that this limitation extends to XUpdate as
> well -- worth checking in the docs. This is why I recommend trying to get
> some documented example to work whose query is known to be OK, before moving
> on to your own uncharted territory.
>
> Jeff
> ----- Original Message -----
> From: "Julie McCabe" <ju...@qub.ac.uk>
> To: <xi...@xml.apache.org>
> Sent: Friday, July 18, 2003 7:16 AM
> Subject: XUpdateQueryService work around
>
> Hello,
>
> Has anybody got xupdate:modifications working with XUpdateQueryService? is
> there a known list of problems as I cant get it working for a number of
> collections. The work around I've had to do is query for the resource, get
> the content, modify it using Java (substring etc) then remove the resource
> from the database and create a new resource with the modified content.
>
> I would prefer to use XUpdateQueryService for simplicity and scalabilty but
> its falling over on a 641 error - as mentioned in a previous mail to the
> list. My config is Java 1.4.1 and Xindice 1.1b1.
>
> Thanks
> Julie
--
Mark J Stang
System Architect
Cybershop Systems
Re: XUpdateQueryService work around
Posted by Jeff Greif <jg...@alumni.princeton.edu>.
It worked for me in a much older version of Xindice well about a year ago.
I suggest that you try to get some of the XUpdate examples to work. I
noticed a couple of things in your update query that might be problematical:
1. Some namespaces used in the query, and no namespace prefixes in the
xpath used for select=. If your documents use namespaces, this won't work,
because xpath steps whose names do not contain prefixes are assumed to be
elements or attributes in *no* namespace (not the default namespace). If
you need to put in namespaces, you also need to provide some namespace
context (so the prefixes can be resolved to namespaces). I don't remember
how to do this, but it is probably documented. If your documents use
namespaces, you also have to worry about whether elements and attributes are
qualified or not, as this also affects where or whether prefixes are needed
in the xpaths.
2. When you query xindice, you cannot extract an attribute without its
containing element. It may be that this limitation extends to XUpdate as
well -- worth checking in the docs. This is why I recommend trying to get
some documented example to work whose query is known to be OK, before moving
on to your own uncharted territory.
Jeff
----- Original Message -----
From: "Julie McCabe" <ju...@qub.ac.uk>
To: <xi...@xml.apache.org>
Sent: Friday, July 18, 2003 7:16 AM
Subject: XUpdateQueryService work around
Hello,
Has anybody got xupdate:modifications working with XUpdateQueryService? is
there a known list of problems as I cant get it working for a number of
collections. The work around I've had to do is query for the resource, get
the content, modify it using Java (substring etc) then remove the resource
from the database and create a new resource with the modified content.
I would prefer to use XUpdateQueryService for simplicity and scalabilty but
its falling over on a 641 error - as mentioned in a previous mail to the
list. My config is Java 1.4.1 and Xindice 1.1b1.
Thanks
Julie
Re: XUpdateQueryService work around
Posted by Steven Cummings <st...@yahoo.com>.
Julie,
I'm not for certain that this is the same problem, but in the past I had one
with XUpdate as well and it was the common endorsed-libs problem with Tomcat.
The Xerces library used by Xindice has to be the one present in
$TOMCAT_HOME/common/endorsed. I've also found that a *newer* library can be
present there and things will work too. HTH.
/S
--- Julie McCabe <ju...@qub.ac.uk> wrote:
> Hello,
>
> Has anybody got xupdate:modifications working with XUpdateQueryService? is
> there a known list of problems as I cant get it working for a number of
> collections. The work around I've had to do is query for the resource, get
> the content, modify it using Java (substring etc) then remove the resource
> from the database and create a new resource with the modified content.
>
> I would prefer to use XUpdateQueryService for simplicity and scalabilty but
> its falling over on a 641 error - as mentioned in a previous mail to the
> list. My config is Java 1.4.1 and Xindice 1.1b1.
>
> Thanks
> Julie
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com