Re: [Xsltforms-support] Unable to remove xml:id attributes
Brought to you by:
alain-couthures
|
From: Josselin M. <mor...@gm...> - 2025-12-04 19:23:48
|
Hi Alain,
Thank you for the quick fix!
Best,
Josselin
Envoyé de mon iPhone
> Le 30 nov. 2025 à 14:40, Alain Couthures <ala...@ag...> a écrit :
>
> Hi Josselin,
>
> It appears that removeAttributeNS() method does not work as expected in browsers for xml:id because of its namespace.
>
> Please find below a simple workaround for this, in xsltforms.js within XsltForms_delete.prototype.run definition:
>
> if (oldOwnerElement.removeAttributeNS) {
>
> becoming
>
> if (oldOwnerElement.removeAttributeNS && node.namespaceURI !== 'http://www.w3.org/XML/1998/namespace') {
>
> This way, removeAttributeNode() is used instead and it now works correctly for both Chrome and Firefox.
>
> Thank you for your feedback!
>
> --Alain
>
>> Le 27/11/2025 21:02 CET, Josselin Morvan <mor...@gm...> a écrit :
>>
>>
>> Hi Alain, hi everyone,
>> I'm having trouble removing xml:id attributes with XSLTForms.
>> I can insert xml:id attributes, but I cannot delete them using xf:delete.
>> As you can see in the attached example, other attributes are removed correctly, but xml:id attributes are not. Is there something I'm missing?
>> I'm using XSLTForms 1.7, with Firefox and Chrome.
>> Many thanks for you help,
>> Josselin
>>
>>
>>
>>
>> ------------------------------
>>
>> _______________________________________________ Xsltforms-support mailing list Xsl...@li... https://lists.sourceforge.net/lists/listinfo/xsltforms-support
|