Philippe Nobili wrote:
> 
> 
> Something completely different related to ID-generation; in our XML
> dialect, all elements need to be uniquely identified by XML IDs; these
> IDs are used internally, so we want to avoid at all price our authors to
> bother about them.
> 
> So, we added the *generateIds="true"* property to the 
> *newElementContent*  element in our .xxe file. And this works fine. We
> have a couple of additional questions to definitely improve ID's
> management for our XXE plugin:
> 
> 1)* [minor]* Is there a way to control how these IDs are generated ?
> (e.g. providing a common prefix or so)
> 
> 2) *[important]* If we write templates for some elements, is there a way
> to add automatically generated IDs in the generated elements, i.e. a
> kind of equivalent to the XSL "*generate-id(.)*" function call ?   So
> far all we could do is assign erroneous IDs, e.g. id="???" to the new
> elements (so, we removed the use of templates since we cannot end-up
> with invalid files).
> 
> 3) *[vital] *The copy/paste feature of XXE is really great; is there is
> a way to "override" (this is probably a wrong terminology) it to force
> IDs of new elements to be re-generated ? (otherwise we end-up with
> duplcate IDs which has very bad consequences in our case).   What we had
> in mind is a mechanism which would allow us to automatically change
> copied elements.
> 

We have nothing against improving the automatic generation of IDs. But
let me ask you a question first. Given the fact that all elements
eventually have unique, automatically generated IDs, is it really
important for an author to have access to these IDs, immediately, in
real time. I mean, the author inserts a new element and must be
immediately be able to use its unique, automatically generated ID, to
create a cross-reference for example.

If the answer is no, then a validateHook can automatically generate
automatic IDs and also can automatically fix duplicate IDs.



 
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to