Why was the choice made to use a random uuid in
"new-document-action.xpl"? Was this simply for illustration
purposes? It would seem in most applications the document would be filed
based on a user provided ID, or a count of documents would be performed and
then incremented for a new ID. Then the summary could be sorted by ID,
and names per previous comment. I have played a little with
replacing the generator by the incremental approach; have not been
successful yet but had to put it aside for several weeks.
Also BIZDOC related, are document-optional-info.rng, document-info.rng, and
document-id.rng actually ever used by either bizdoc or bizdoc2? I have
tried to find where, but have not had any luck. It appears to me only the
.xsd files are used?
>>> ebruchez@orbeon.com 08/03/05 09:11PM >>>
Hi
Olli,
I don't know if eXist has the concept of a unique sequence which
you
can retrieve with XQuery. If so, that would be an
easy
solution.
The BizDoc example generates a pseudo-UUID, sets it
into the new
document, and then inserts the document into the
collection.
You should probably try to ask this question in the
eXist
mailing-list, but be sure to report back the
findings!
-Erik
Oliver Charlet wrote:
> Hi
there,
>
> I am trying to find a general way to use the xmldb to
store xml
> entities. My first approach is the same as using a SQL
database.
> I want to insert an XML document into the xmldb. All my new
XML entities
> have an (empty) id attribute as their primary key.
>
Since I don't want to manage those ids on my own, I would like to use
>
the internal id, that is generated by eXist.
> I just dont know, how to
create a smart pipeline to both insert the
> document into the xmldb and
update the id attribute
> to the internal document-id. I started by
inserting the document and
> afterwards updating its attribute. But this
is very
> nasty, because it is not save (no transactions) and it depends
upon some
> way to retrieve the new document again, to
> update
it.
> What I am looking for is a way to insert the XML and either
>
1) return the new document-id as some kind of a result of the insert
>
(does ops's xdb:insert command support this?)
> or
> 2) read the
next document-id before I actually insert the document, so I
> can update
the id attribute before.
> Since for me this looks like a standard
pattern, somebody probably
> already developed a strategy for
that.
>
> Of course there might be other ways. Maybe not using a
distinct ID at
> all? But how to manage changes the clever
way?
>
> Can anybody help and give me some hints here,
please?
>
> Thanks in advance
>
:olli