Empty xmlns generated by actions

Having trouble installing Oxygen? Got a bug to report? Post it all here.
yann1806
Posts: 22
Joined: Fri Aug 09, 2013 11:03 am

Empty xmlns generated by actions

Post by yann1806 »

Hi guys,

I have an add-on XSD with the following header:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://www.oxygenxml.com/ns/labtest"
xmlns="http://www.oxygenxml.com/ns/labtest">
Eventhough I have the elementFormDefault="qualified", Author actions generate: xmlns="" when a tag is inserted; for example my "bold" action is define to surround with the tag <b/> (which works fine in the document), but in fact it generates <b xmlns=""/>, which breaks my document.

I know I can specify that the insert fragment should be <b xmlns="http://www.oxygenxml.com/ns/labtest"/> but that will make for heavy documents.

Thanks for any help,

Yann
Radu
Posts: 9046
Joined: Fri Jul 09, 2004 5:18 pm

Re: Empty xmlns generated by actions

Post by Radu »

Hi Yann,

When defining the XML fragment which will be inserted by an Author Operation that fragment needs to have specified on it the proper namespaces declarations. So indeed it has to be defined something like:

Code: Select all

<b xmlns="http://www.oxygenxml.com/ns/labtest"/>
But when the fragment gets inserted, if the namespace mapping is already available in the insertion context the extra xmlns="http://www.oxygenxml.com/ns/labtest" attribute will not be added to the final XML content.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
yann1806
Posts: 22
Joined: Fri Aug 09, 2013 11:03 am

Re: Empty xmlns generated by actions

Post by yann1806 »

Thanks Radu.
Post Reply