Unwanted namespace prefix "_0"

Here should go questions about transforming XML with XSLT and FOP.
martindholmes
Posts: 178
Joined: Wed Apr 20, 2005 5:43 pm
Location: Victoria, BC, Canada

Unwanted namespace prefix "_0"

Post by martindholmes »

I've come across a rather annoying thing when using Saxon 9 to do XSLT transforms both in the debugger and through a Transformation Scenario. The problem doesn't occur when running Saxon on the command line, so it must be something to do with the Oxygen setup, although I can't figure out what.

I have a TEI file with an embedded example in the TEI Examples namespace, like this:

Code: Select all


<TEI xmlns="http://www.tei-c.org/ns/1.0" version="5.0">
[...]
<div>
<egXML xmlns="http://www.tei-c.org/ns/Examples" valid="true">
For more information, consult the
<ref target="mol:linking#linking_graphics"> guide to
linking graphic content</ref>.</egXML>
</div>
[...]
</TEI>
If I do an identity transform on that file, there are unwanted namespace prefixes in the results, like this:

Code: Select all


<_0:egXML xmlns:_0="http://www.tei-c.org/ns/Examples" valid="true">
For more information, consult the
<_0:ref target="mol:linking#linking_graphics"> guide to
linking graphic content</_0:ref>.</_0:egXML>
This happens whether or not I have an explicit namespace prefix declaration for the Examples namespace, and whatever settings I use in exclude-result-prefixes.

Since it doesn't happen with Saxon on the command line, I assume it must be something added by a serialization phase, but I can't find anything that looks relevant in the options, searching for prefix, serialize, namespace, or anything else I can think of.
radu_pisoi
Posts: 403
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: Unwanted namespace prefix "_0"

Post by radu_pisoi »

Hi Martin,

I already answered you on the XSLT list, http://www.mulberrytech.com/xsl/xsl-list/. I will add my answer below in case somebody else encountered this issue.

We investigated the issue and I would like to confirm that it can be obtained only when running the transformation from oXygen. The issue is related to the option that adds the default attributes values when parsing an XML document with a RelaxNG schema associated.

When this option is enabled, the XML reader that it is provided by Oxygen to the Saxon transformer does not emmit the namespace events properly.

I will add an issue to our bug tracking tool and we'll try to resolve it in Oxygen 15.2 which will be released at the beginning of 2014.

Meanwhile, to avoid this problem you can disable the option 'Add default attribute values' by opening the application Options -> Preferences dialog and selecting the 'XML / XML Parser / RELAX NG' options page.
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Unwanted namespace prefix "_0"

Post by Radu »

Hi Martin,

Oxygen 15.2 was released a about week ago and should also contain a fix for this issue.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply