Reply to: How to escapse " charecter while saving the fileOctober 27, 2009 at 6:43 pm
I'm not sure which textbox you mean. However, I can point out how the product behaves in the 5.1 and 5.5 versions:
1. If you are typing text into a document in PlainText view you will need to manually 'escape' double quotes where necessary according to the XML Recommendation. This means typing out the full entity name " if required for the document to be valid, for example when they appear inside an attribute value that is double quoted. Likewise, you need to manually 'escape' the ampersand, less-than and greater-than characters.
2. If you are typing text into a document in TagsOn or Normal view in an element with PCDATA content or a CDATA section, escaping the double quote and single quote characters (entering them as entities) is not necessary and XMetaL will not do this for you. The ampersand, less-than and greater-than characters will need to be entered as entities however.
3. If you are typing text into the Attribute Inspector with the document open in any view in a recent version of XMetaL the following should occur:
* If you enter double quotes into a CDATA attribute then XMetaL Author should wrap the attribute value in single quotes.
* If you enter single quotes into a CDATA attribute then XMetaL Author should wrap the attribute value in double quotes.
* If you enter both double and single quotes XMetaL Author should wrap the attribute value in double quotes and then use the " entity for any double quotes inside the attribute.
After the attribute value has been set (you do this by exiting the field you are editing in the Attribute Inspector) if any values have been entered as entities (") then they will appear as such (spelt out in full with the opening ampersand and closing semicolon) and subsequent changes to them basically force you to work as though you were working in PlainText view so you need to know what you are doing at this point. For our clients that have authors that will be doing a lot of work like this we usually recommend implementing a method of entering such attribute values using XFT forms and steering their authors away from the Attribute Inspector to avoid confusion. Otherwise, more extensive training in what XML validity means may be required.
By default (when no special quoting is required) XMetaL wraps attribute values in double quotes.
4. If you are typing text into a dialog box and that dialog box ends up entering whatever you typed (or something based on what you typed or chose) into the document then the behavior could really be anything and will depend on which view you are in and the APIs and logic that was used to insert the text.
All of these behaviors could be altered by customizing the product so if you see different behavior it may be due to customization(s) you have installed.