Allow insert xml fragment that is invalid
Posted: Wed May 11, 2022 8:33 pm
Hi,
I'm using JavaScript:
I am copying some <iframe> tag from a site that doesn't format the tag correctly - some dubious attributes.
But this will not allow the paste due to some minor attribute issues in the copied tag.
So, I am using JavaScript:
But that won't allow me to insert without first fixing the xml.
the xml is a string taken from the clipboard.
if i try to convert it to a fragment I get the same error due to invalid xml.
The ability to force the insert to be allowed without losing the protection from other invalid inserts would be great.
is this possible?
Even the ability to convert the string to a fragment of invalid XML would at least give me a chance to fix the fragment before I insert it into the doc.
As a fragment - I can address the attributes easier than trying to pattern-match on a string.
Thanks
I'm using JavaScript:
I am copying some <iframe> tag from a site that doesn't format the tag correctly - some dubious attributes.
But this will not allow the paste due to some minor attribute issues in the copied tag.
So, I am using JavaScript:
Code: Select all
authorAccess.getDocumentController().insertXMLFragment(myFrag, caretOffset);
the xml is a string taken from the clipboard.
if i try to convert it to a fragment I get the same error due to invalid xml.
The ability to force the insert to be allowed without losing the protection from other invalid inserts would be great.
is this possible?
Even the ability to convert the string to a fragment of invalid XML would at least give me a chance to fix the fragment before I insert it into the doc.
As a fragment - I can address the attributes easier than trying to pattern-match on a string.
Thanks