Uwe Wojak writes:
> We use entities to system entities for "including" chapters.
> All these entities are replace, when I open the our file and save it again.

> <para>An entity: &amp;</para>
> becomes
> <para>An entity: &#38;</para>
> 
> Thats really bad for chapters included in a main file.
> 
> Is this behaviour configurable ?

Not with the current XXE.  You may find helpful the attached unxxe.pl 
perl script, which is an updated (and substantially improved) version of 
one I sent to this list a month ago.  It automatically restores most 
entity references, even including external entities (assuming you 
haven't edited them).  With a bit of document tweaking, you can force it 
to restore external entity references even if they were edited (or more 
likely, reformatted by XXE, e.g. reordered attributes).

Changes since the previous version include:

* fixed a bug with &lt;/&gt; replacement
* <?unxxe?> processing instructions mark sub-docs and force restoration
* improve word-boundary sensitivity for entity expansions
* correctly match entities with hex numeric entities (&#x0000)
* reduce combinatorial time for successful match of large entities
* <?xml?> PI in sub-document no longer prevents match
* fixed a bug with sgml-parent-document scanning
* fixed some warnings when unable to read an external entity
* better, though still minimal, documentation

If, as in your example, you want to use entities like &amp; in your 
sub-documents, this will work, but note that with the current version of 
XXE, if you open a sub-document that doesn't contain a DOCTYPE 
declaration XXE uses the DTD in an XXE configuration file with a 
matching <detect> clause.

This means that if a sub-document uses entities defined directly in the 
master document (as opposed to the DOCTYPE), XXE will be unable to load 
it (although the sub-document may be valid in the context of the master 
document).  And of course XML doesn't allow you to define entities in a 
sub-document, since it cannot have a DOCTYPE declaration.

So you will have to stick to standard entities in sub-documents that you 
plan to edit with XXE.  In master or standalone documents you can use 
your own entities, or even ones defined in external parameter entity 
files.  And anything you can generate with XXE, you can restore with 
unxxe.pl.

@alex
-- 
mailto:dupuy at sysd.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: unxxe.pl
Url: 
http://www.xmlmind.com/pipermail/xmleditor-support/attachments/20030113/e8a25a7d/attachment.bat
 

Reply via email to