Page 1 of 1

Empty xmlns generated by actions

Posted: Fri Aug 30, 2013 2:15 pm
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

Re: Empty xmlns generated by actions

Posted: Mon Sep 02, 2013 10:52 am
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

Re: Empty xmlns generated by actions

Posted: Wed Sep 04, 2013 11:43 am
by yann1806
Thanks Radu.