Re: doctype-declaration for nbsp gets lost after saving a file
Hussein Shafie <[email protected]> Fri, 26 Nov 2021 17:19:51 +0100
| Newsgroups | gmane.editors.xxe.general |
|---|---|
| Message-ID | <[email protected]> |
Hello,
On 11/26/21 08:20, Madlik, Monika (LNG-VIE) wrote:
>
> we are using XMLMind Professional Edition 9.5.1 and I recognized a
> problem with my templates.
>
> I created templates that include a doctype-declaration for .
>
> My template looks like this:
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE artikel [<!ENTITY nbsp " ">]>
> <artikel typ="aufsatz">
> ...
> </artikel>
>
> When I open this template via XMLMind and save this file - the
> doctype-declaration for the nbsp gets lost.
>
> My file looks like this after saving it:
> <?xml version="1.0" encoding="UTF-8"?>
> <artikel typ="aufsatz">
> ...
> </artikel>
>
> But this is a problem, because often our users use nbsp's and when they
> try to transform these files they get an error message.
>
> Do you have an idea why the declaration gets lost and how to correct this?
>
No, sorry.
I cannot reproduce the issue.
I've added:
---
<!DOCTYPE article [<!ENTITY nbsp " ">]>
---
to the DocBook v5 article.xml stock template.
When I save a document created using this modified template, it works
fine for me. I get:
---
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article [
<!ENTITY nbsp " ">
]>
<article version="5.0" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:db="http://docbook.org/ns/docbook">
...
---
---
PS: Not related to your issue, but as the UTF-8 encoding natively
supports the No-Break Space (NBSP = U+00A0) character, you'll never find
" " in the documents you save.
You'll find the U+00A0 character but not the " " character entity.
In order to have " " in the documents you save, you must change the
save options as depicted in attached screenshot.
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support
Save_Preferences.png
(image/png, 117.2 KB) - not displayed