XML Refactoring Tool adds xml attributes

Oxygen general issues.
urbanrobots
Posts: 86
Joined: Sun May 03, 2015 7:34 pm
Location: San Francisco

XML Refactoring Tool adds xml attributes

Post by urbanrobots »

Hi,

When I run the XSL script in the UI, the output looks and works fine. However, when I use the XML Refactoring Tool to run the script -- so that I can scale this to non-developers -- the output includes additional attributes that break other systems.

Example output after running script normally:

Code: Select all

 <topicref keyref="g_1080p" type="glossentry"/>
Example output after running the same script using the XML Refactoring Tool:

Code: Select all

<topicref keyref="g_1080p" type="glossentry" xra:oxy_AttrWS__oxy_ln_keys=" ###true" xra:oxy_AttrWS__oxy_ln_type=" ###true" xra:oxy_AttrWS__oxy_ln_href=" ###true" xra:oxy_StartTagInfo="#true" xra:oxy__attributes_order="keys type href" xra:oxy_oValue__oxy_ln_keys="g_1080p" xra:oxy_nonNormValue__oxy_ln_keys="g_1080p" xra:oxy_oValue__oxy_ln_type="glossentry" xra:oxy_nonNormValue__oxy_ln_type="glossentry" xra:oxy_oValue__oxy_ln_href="g_1080p.xml" xra:oxy_nonNormValue__oxy_ln_href="g_1080p.xml"/>
How can I stop this?

Thanks,
-Nick
radu_pisoi
Posts: 403
Joined: Thu Aug 21, 2003 11:36 am
Location: Craiova
Contact:

Re: XML Refactoring Tool adds xml attributes

Post by radu_pisoi »

Hi,

When an XSLT script is executed from the XML Refactoring tool, the XSLT transformation is executed in a safe mode. This implies the following:
  • The DOCTYPE will be preserved.
  • The DTD entities will be preserved as they are in the original document when the document is saved.
  • The attribute values will be kept in their original form without being normalized.
To achieve some of the previous goals, the XML Refactoring mechanism adds several attributes that are interpreted internally. The attributes belong to the http://www.oxygenxml.com/ns/xmlRefactor ... attributes namespace. These attributes should not be taken into account when processing the input XML document since they are discarded when the transformed document is serialized.

You can read more details about these constraints in our user manual, http://oxygenxml.com/doc/versions/18.1/ ... tools.html.

Therefore, could you check if your stylesheet interact accidentally with these attributes? Maybe you copy them and somehow change their namespaces.

If you are not able to fix the problem on your side, could you send us a sample XSLT script and XML data to reproduce the problem at support@oxygenxml.com?
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
urbanrobots
Posts: 86
Joined: Sun May 03, 2015 7:34 pm
Location: San Francisco

Re: XML Refactoring Tool adds xml attributes

Post by urbanrobots »

Hi Radu,

Thanks for your help.

My template looked like this:

Code: Select all

  <xsl:template match="keydef">
<topicref>
<xsl:apply-templates select="@* | node()"/>
</topicref>
</xsl:template>
But that apparently copied everything, even stuff from the refactoring tool's namespace? Being more specific in the template improved the outcome, and it's now valid DITA XML. :)

Code: Select all

<xsl:template match="keydef">
<topicref>
<xsl:attribute name="keyref">
<xsl:value-of select="@keys"/>
</xsl:attribute>
</topicref>
</xsl:template>
Thanks for your help!
Nicholas
Post Reply