Re: [Xsltforms-support] Unable to remove xml:id attributes
Brought to you by:
alain-couthures
|
From: Alain C. <ala...@ag...> - 2025-11-30 13:54:28
|
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
|