You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by "Mark J. Stang" <ma...@earthlink.net> on 2002/02/02 08:39:47 UTC

XUpdate

Hi,
I have been working with XUpdate and have a question.
If I use a select, such as

        "//account/customer/name/first[text()='Mark']"

for an XUpdate, aren't I telling it to change every first name that is
'Mark'
to the new value.   How do I specify a particular document, rather than
all?
This seems to be a "global change".   I could embed the key in the
document
but then I have to have a "select" AND "select".   Is there someway to
specify
a key to a document and its' path?

thanks,

Mark


Re: XUpdate

Posted by Kimbro Staken <ks...@dbxmlgroup.com>.
Oops, that's what I get for not reading backwards through the thread. Glad 
you found it.

On Saturday, February 2, 2002, at 03:03 PM, Mark J. Stang wrote:

> Well, six hours later, I found "updateResource()".   It updates a
> single document based on document Id.   Very nice!
>
> Now the only question is how to update those pesky attributes...
>

It's in the use cases. 
http://www.xmldatabases.org/projects/XUpdate-UseCases/


> :-)
>
> Mark
>
> "Mark J. Stang" wrote:
>
>> Vadim,
>> Thanks for the suggestion.   I think you are suggesting that
>> I make my updates based on my data.   I don't think I
>> should have to do so.   Also, I don't want to have to
>> customize my updates around my data.  I have a
>> document key, a path to it and a new value.   That is
>> all that should be necessary to make the update.
>>
>>> From my research, XUpdate and the XPath selection seem
>> to be designed around a single document, not a database.
>>
>> I guess what I am saying is that Xindice doesn't
>> provide an api to update a specific document with
>> xupdate.   Tom/Kimbro said that I could update the
>> entire document, but that seems a bit of overhead.   Also,
>> I have a client that is sending a change, why should
>> the client have to send the entire document?
>>
>> Tom/Kimbro have stated in the past that we shouldn't
>> create one big document, that we should create a bunch
>> of little documents.   If I had one big document, then I
>> wouldn't have this problem, because the absolute path
>> would identify what should be updated.   Since we
>> have broken the one big document in pieces, it is
>> now harder to identify which piece of the one big
>> document should be changed.
>>
>> Don't get me wrong, I perfectly happy with not
>> having one big document.   I think Xindice is a
>> great product!   I was hoping for a way to
>> specify which document I wanted updated.   I
>> can fix this by pre-appending everyone one of
>> my documents by their key value and then
>> my update path will be unique.   Xindice already
>> knows this, the api doesn't let me specify it.
>>
>> Sorry for the rant and the length :-)
>>
>> thanks,
>> Mark
>>
>> Vadim Gritsenko wrote:
>>
>>>> From: Mark J. Stang [mailto:markstang@earthlink.net]
>>>>
>>>> Kimbro/Tom/et. al.,
>>>> I haven't been able to figure out how to do an "and".
>>>
>>> What's the problem?
>>>
>>> "//account/customer/name/first[text()='Mark' and ../last='Stang']"
>>>
>>> Vadim
>>>
>>>>   The only
>>>> solution I can think of is to make the document key the root
>>>> of my document.   That way I can guarantee that my "select"
>>>> will be unique.   Does anyone have any other suggestions?
>>>> Does everyone agree this is the only solution using "xupdate"?
>>>>
>>>> thanks,
>>>>
>>>> Mark
>>>>
>>>> "Mark J. Stang" wrote:
>>>>
>>>>> Hi,
>>>>> I have been working with XUpdate and have a question.
>>>>> If I use a select, such as
>>>>>
>>>>>         "//account/customer/name/first[text()='Mark']"
>>>>>
>>>>> for an XUpdate, aren't I telling it to change every first name that
>>> is
>>>>> 'Mark'
>>>>> to the new value.   How do I specify a particular document, rather
>>> than
>>>>> all?
>>>>> This seems to be a "global change".   I could embed the key in the
>>>>> document
>>>>> but then I have to have a "select" AND "select".   Is there someway
>>> to
>>>>> specify
>>>>> a key to a document and its' path?
>>>>>
>>>>> thanks,
>>>>>
>>>>> Mark
>
>
>
Kimbro Staken
XML Database Software, Consulting and Writing
http://www.xmldatabases.org/


Re: XUpdate

Posted by "Mark J. Stang" <ma...@earthlink.net>.
Well, six hours later, I found "updateResource()".   It updates a
single document based on document Id.   Very nice!

Now the only question is how to update those pesky attributes...

:-)

Mark

"Mark J. Stang" wrote:

> Vadim,
> Thanks for the suggestion.   I think you are suggesting that
> I make my updates based on my data.   I don't think I
> should have to do so.   Also, I don't want to have to
> customize my updates around my data.  I have a
> document key, a path to it and a new value.   That is
> all that should be necessary to make the update.
>
> >From my research, XUpdate and the XPath selection seem
> to be designed around a single document, not a database.
>
> I guess what I am saying is that Xindice doesn't
> provide an api to update a specific document with
> xupdate.   Tom/Kimbro said that I could update the
> entire document, but that seems a bit of overhead.   Also,
> I have a client that is sending a change, why should
> the client have to send the entire document?
>
> Tom/Kimbro have stated in the past that we shouldn't
> create one big document, that we should create a bunch
> of little documents.   If I had one big document, then I
> wouldn't have this problem, because the absolute path
> would identify what should be updated.   Since we
> have broken the one big document in pieces, it is
> now harder to identify which piece of the one big
> document should be changed.
>
> Don't get me wrong, I perfectly happy with not
> having one big document.   I think Xindice is a
> great product!   I was hoping for a way to
> specify which document I wanted updated.   I
> can fix this by pre-appending everyone one of
> my documents by their key value and then
> my update path will be unique.   Xindice already
> knows this, the api doesn't let me specify it.
>
> Sorry for the rant and the length :-)
>
> thanks,
> Mark
>
> Vadim Gritsenko wrote:
>
> > > From: Mark J. Stang [mailto:markstang@earthlink.net]
> > >
> > > Kimbro/Tom/et. al.,
> > > I haven't been able to figure out how to do an "and".
> >
> > What's the problem?
> >
> > "//account/customer/name/first[text()='Mark' and ../last='Stang']"
> >
> > Vadim
> >
> > >   The only
> > > solution I can think of is to make the document key the root
> > > of my document.   That way I can guarantee that my "select"
> > > will be unique.   Does anyone have any other suggestions?
> > > Does everyone agree this is the only solution using "xupdate"?
> > >
> > > thanks,
> > >
> > > Mark
> > >
> > > "Mark J. Stang" wrote:
> > >
> > > > Hi,
> > > > I have been working with XUpdate and have a question.
> > > > If I use a select, such as
> > > >
> > > >         "//account/customer/name/first[text()='Mark']"
> > > >
> > > > for an XUpdate, aren't I telling it to change every first name that
> > is
> > > > 'Mark'
> > > > to the new value.   How do I specify a particular document, rather
> > than
> > > > all?
> > > > This seems to be a "global change".   I could embed the key in the
> > > > document
> > > > but then I have to have a "select" AND "select".   Is there someway
> > to
> > > > specify
> > > > a key to a document and its' path?
> > > >
> > > > thanks,
> > > >
> > > > Mark


Re: XUpdate

Posted by Kimbro Staken <ks...@dbxmlgroup.com>.
On Saturday, February 2, 2002, at 08:52 AM, Mark J. Stang wrote:
>
> my update path will be unique.   Xindice already
> knows this, the api doesn't let me specify it.
>

Sure it does, use updateResource instead of update in the XML:DB API. Or 
am I misunderstanding what you're asking for?

> Sorry for the rant and the length :-)
>

> thanks,
> Mark
>
>
Kimbro Staken
XML Database Software, Consulting and Writing
http://www.xmldatabases.org/


Re: XUpdate

Posted by "Mark J. Stang" <ma...@earthlink.net>.
Vadim,
Thanks for the suggestion.   I think you are suggesting that
I make my updates based on my data.   I don't think I
should have to do so.   Also, I don't want to have to
customize my updates around my data.  I have a
document key, a path to it and a new value.   That is
all that should be necessary to make the update.

RE: XUpdate

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Mark J. Stang [mailto:markstang@earthlink.net]
> 
> Kimbro/Tom/et. al.,
> I haven't been able to figure out how to do an "and".

What's the problem?

"//account/customer/name/first[text()='Mark' and ../last='Stang']"

Vadim

>   The only
> solution I can think of is to make the document key the root
> of my document.   That way I can guarantee that my "select"
> will be unique.   Does anyone have any other suggestions?
> Does everyone agree this is the only solution using "xupdate"?
> 
> thanks,
> 
> Mark
> 
> "Mark J. Stang" wrote:
> 
> > Hi,
> > I have been working with XUpdate and have a question.
> > If I use a select, such as
> >
> >         "//account/customer/name/first[text()='Mark']"
> >
> > for an XUpdate, aren't I telling it to change every first name that
is
> > 'Mark'
> > to the new value.   How do I specify a particular document, rather
than
> > all?
> > This seems to be a "global change".   I could embed the key in the
> > document
> > but then I have to have a "select" AND "select".   Is there someway
to
> > specify
> > a key to a document and its' path?
> >
> > thanks,
> >
> > Mark


Re: XUpdate

Posted by "Mark J. Stang" <ma...@earthlink.net>.
Kimbro/Tom/et. al.,
I haven't been able to figure out how to do an "and".   The only
solution I can think of is to make the document key the root
of my document.   That way I can guarantee that my "select"
will be unique.   Does anyone have any other suggestions?
Does everyone agree this is the only solution using "xupdate"?

thanks,

Mark

"Mark J. Stang" wrote:

> Hi,
> I have been working with XUpdate and have a question.
> If I use a select, such as
>
>         "//account/customer/name/first[text()='Mark']"
>
> for an XUpdate, aren't I telling it to change every first name that is
> 'Mark'
> to the new value.   How do I specify a particular document, rather than
> all?
> This seems to be a "global change".   I could embed the key in the
> document
> but then I have to have a "select" AND "select".   Is there someway to
> specify
> a key to a document and its' path?
>
> thanks,
>
> Mark