<emptyTemplate/>

Having trouble installing Oxygen? Got a bug to report? Post it all here.
stdu
Posts: 81
Joined: Mon Mar 05, 2012 5:23 pm

<emptyTemplate/>

Post by stdu »

We have a customized oxygen framework (document types) for TEI files. In this framework we provide three file templates. When using the "New file"-Button to write - locally - a new file with the template all is okay. But when using the context menu in the database tree for insert a new file directly into the (online) database, almost all times the new file only contains

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<emptyTemplate/>
Sometimes (rare) the new file in the db is also generated correctly. But normally not. We're using an exist-db with webdav-access, which works usually fine. Strange to say, that you can make new files in the database with other template files (e.g. from the oxygenxml-build-in TEI framework) without any problem. After testing many hours, I have no clue, where the problem could be located. :? Has anyone an idea?
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: <emptyTemplate/>

Post by adrian »

Hi,

To clarify, you are accessing eXist in Oxygen via a WebDAV connection, not an eXist native connection. Right?

eXist has its quirks when it comes to DTD declarations(DOCTYPE), so that could be a possible cause. But these quirks only apply when using a native eXist connection AFAIK, so I'm not sure if it's the case here. Though that does not explain the missing content from the XML template.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
stdu
Posts: 81
Joined: Mon Mar 05, 2012 5:23 pm

Re: <emptyTemplate/>

Post by stdu »

adrian wrote: To clarify, you are accessing eXist in Oxygen via a WebDAV connection, not an eXist native connection. Right?
That's right, Adrian.

In the meantime I have figured out a strange thing: it seems that the attribute xml:id in the root element TEI causes the problems. Without this attribute in the template file the generating of an new file in the database works fine. Regardless wether the attribute is empty or full (string or editor variable) it results in a <emptyTemplate>-file. Is this a problem of oxygen or our eXist database?

Greets,
Stefan
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: <emptyTemplate/>

Post by adrian »

When using a WebDAV connection, Oxygen does not alter the XML content in any way. So, my guess is it's something eXist does. Maybe it expects the attribute xml:id to have a unique value?

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
stdu
Posts: 81
Joined: Mon Mar 05, 2012 5:23 pm

Re: <emptyTemplate/>

Post by stdu »

Yes, it seems that eXist has a problem with values which are not conform to the xml:id specification - i.e. when the value is empty or begins with an illegal character (i.e. numeric character or $). I don't know the point of time when the editor variable ${id} is transformed by oXygen in an id. But perhaps oXygen replaces the editor variable first after the creation of the file. And eXist has a problem with the ${id} in xml:id and rejected the uploading (= creation) of the file?!

However, you can prevent this behaviour if you insert a character string like xyz_ before the editor variable: after this, all works fine.
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: <emptyTemplate/>

Post by adrian »

Hi,

After further analysis this turned out to be a bug in the id generation implementation for ${id}. Sometimes the generated id would begin with a number, so it would not be a valid XML id.
We have already resolved this in the current development stream and it will be available in v14.
The workaround, as you've discovered, is to add a prefix in front of the ${id}.

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
adrian
Posts: 2855
Joined: Tue May 17, 2005 4:01 pm

Re: <emptyTemplate/>

Post by adrian »

Hi again,

I just wanted to let you know that this problem has been resolved in the latest maintenance build of Oxygen 13.2, 2012052412:
General: The editor variable ${id} (Application generated unique identifier) would sometimes generate an incorrect XML ID. The generated ID could start with a number.
You can download it from our web site:
http://www.oxygenxml.com/download.html

The list of bug-fixes can be found here:
http://www.oxygenxml.com/build_history.html#2012052412

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Post Reply