rechtsfrage at web.de wrote:
> 
> While trying to paste XML-code from the clipboard into a docbook article 
> element "programmlisting" opened with the XMLmindViewEditor (Standard Edition 
> 3.5.2), the paste failes or to be more detailled, the paste operation is 
> silently ignored...
> I want to document some special XML syntax and want to give some examples.
> 
> Is it not possible to have XML-code within docbook? Will it not automatically 
> being quoted as it is, when typing XML code manually? I tried several docbook 
> tags (equation, programmlisting, para, code, etc.) but it does not work.
> Even the context menu has a grayed out Paste-command when having XML code in 
> it (enabled again, if no XML code)...
> 
> Is there a trick to do such a thing or is it simply not possible...?

This is possible. We do that all the time. And yes, there is a trick.

You need to force XMLmind XML Editor to consider what's found in the 
clipboard as being plain text and not XML.

The trick is that non-well-formed XML is considered as being plain text.

Example: let's suppose, you want to paste what follows inside a 
programlisting:

---
<?xml version="1.0" encoding="ISO-8859-1"?>
<mediaobject>
   <imageobject>
     <imagedata fileref="images/new02.gif" format="GIF" />
   </imageobject>
</mediaobject>
---

* If you copy all the text (from "<?xml" to "/mediaobject>"), XXE will 
be able to parse it as a <mediaobject> and the DocBook DTD does not 
allow to paste a <mediaobject> inside a <programlisting>.

* TRICK: If you copy nearly all the text, from "?xml" to 
"/mediaobject>", (i.e. omit the leading "<"), XXE cannot parse it as XML 
and therefore will consider it as being plain text. This allows you (1) 
to paste the text in the programlisting (2) to type the leading "<" by hand.





Reply via email to