Philippe Nobili wrote:
> (message re-sent as it did not appear in discussion threads)
> Dear M. Shafie,
> 
> It seems that we have a small issue with XInclude and references.
> Nothing lethal, but thanks for your advice (we might be doing something
> wrong as usual). Here is the problem:
> 
> 1) We use internal  IDs to identify persons names (typically: <ulink
> id="theName" url="mailto:theName at org.com">theName</ulink>).
> The purpose is to recall this name later on in the document without
> having to type the full name. So we include it as a reference to this
> internal element: Shift+Ctrl+c, then Ctrl+v. The untranscluded reference
> would look like:  (note than href is empty).
> 
> {http://www.w3.org/2001/XInclude}include href= xpointer=theName
> 
> So far, so good: the validity tool show a status OK.
> 
> 2) We save the file as, say *myFile.xml*.
> 3) Later on, we save this file under another name, say *myFile2.xml*.
> 
> Now, the validity check complains about ID "theName" being duplicated in
> the document and indeed if we look at the unstranscluded reference, we
> now obtain:
> 
> {http://www.w3.org/2001/XInclude}include href=myFile.xml xpointer=theName
> 
> The href attribute has been filled-in with the name of the original file
> and XMLMind considers than two elements haev the same ID. If we remove
> the href attribute by hand, the document is considered as valid again.
> Since we extensively use references to name persons, products,
> technologies, etc etc... this is sometimes annoying. Do we do something
> bad, or could it be considered as a bug (feature ?) and fixed ?
> 

Hussein Shafie wrote:
> I understand the problem. This is clearly a bug. We'll fix it in next
> release.

After further study, it appears that this is not really a bug (well, at
least not in the general case).

In XXE v4, "File|Save As" merely preserves the links to inclusions and
other document resources (e.g. image file). And the behavior you
describe is consistent with this spec.

Example:

* /foo/doc1.xml contains a para (id=my_para) iself containing <imagedata
fileref="images/image1.png"/>. /foo/doc1.xml includes this para at
different places of the document.

* /foo/doc1.xml is saved as /bar/doc2.xml. If we replace (current behavior):

<xi:include href="../foo/doc2.xml" xpointer="my_para"/>

by (the behavior you expect):

<xi:include href="" xpointer="my_para"/>

then <imagedata fileref="images/image1.png"/> becomes broken.

However the problems you have are real and need to be solved. We'll try
to come up with a solution for next version.






Reply via email to