text:id is deprecated

Thorsten Zachmann t.zachmann at zagge.de
Thu Dec 15 08:26:44 GMT 2011


On Thursday, December 15, 2011 09:14:28 Boudewijn Rempt wrote:
> On Thursday 15 December 2011 Dec, Thorsten Zachmann wrote:
> > for me this looks like a bit of overkill. Let me explain how the id stuff
> > in the animations work.
> 
> Right now, for animations, draw:id is used, isn't it?

right but it should use xml:id when we are finished with that.

> > The xml id is not kept. It is only used during loading to
> > be able to get the thinks it refers to. The e.g. we get us the shape for
> > the id and store the shape. The when writing out the stuff a id is
> > generated and we get the id again. During the runtime of the program the
> > xml:id is not usefull at all. That is also the case for the places where
> > the other id's are used.
> > 
> > Maybe the rdf stuff can use a same mechanism. That would also solve your
> > problem that it thinks all xml:id tags are used for rdf.
> 
> One big issue I have is that it is possible to identify an element with
> xml:id for more than one purpose, yet you can have only one id per
> element. Right now, all shapes appear to be tagged with draw:id. That
> should become xml:id. If I also want to tag that shape with rdf, I have to
> re-use the same id.

Looks I was not clear here. I think we should not identify the usage of the 
xml:id with the content. More e.g. use shape1 for a xml:id of a shape. If that 
is used in a animation or for rdf does not matter.

> > Sure when writing out the id's we need to make sure they are uniqe. But
> > instead of having the very long id's I would prefer to have speeking id's
> > where one knows what it is about.
> 
> But then we're encoding meaning into the id's, and we'll be using that
> meaning to figure out whether something is rdf, something indicates
> animation, a sub-item or whatever. Which basically means we're encoding
> information in a calligra-specific way, out of band to the proper ODF.
> There must be problems with that.

See my above comment. I think there should be no meaning we use during 
loading. Just some meaning when you look at the file by hand which makes it 
much simpler to see what is going on.

> It's what we do now, as a temporary measure, so I check whether the xml:id
> starts with rdfid- and then assume it's for rdf.

And that should go. The rdf stuff should use the same mechanism as e.g. the 
animations and resolve the ids during loading. There is already some code for 
that. It might work or need to be expanded.

> In any case, I will go through our loading code today to check whether more
> problems have appeared because of the text:id -> xml:id and draw:id ->
> xml:id patches. In the past week in any case, any odt loaded and then
> saved by Calligra was not just invalid ODF, but also invalid xml, since it
> will have containede elements with two xml:id tags...

right that is definitely something that should not happen.

Thorsten



More information about the calligra-devel mailing list