General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › XMetaL Author 8.0 Error with XML declaration in external entity
-
MarcB November 12, 2013 at 5:03 pm
XMetaL Author 8.0 Error with XML declaration in external entity
November 12, 2013 at 5:03 pmParticipants 3Replies 4Last Activity 9 years, 2 months agoWe have XML documents that declare and reference external entity files and have worked this way successfully with XMetaL 6.0. After upgrading to XMetaL 8.0, we now get the error message on open: “The target names “XML”, “xml”, and so on are reserved for standardization. Processing instruction cannot use it as target name. Error occurred in the content of entity “simple”.” The document opened:
]>
&simple;
The file simple.ent has in the first line:
Without the declaration in the external entity file, everything is fine. With the declaration, we get the error. But only in XMetaL 8.0.
We literally have hundreds of these files, never a problem before. Is this a bug in XMetaL 8.0?Derek Read November 12, 2013 at 11:39 pm
Reply to: XMetaL Author 8.0 Error with XML declaration in external entity
November 12, 2013 at 11:39 pmYes, this is a bug that affects XMetaL Author Essential 8.0 and XMetaL Author Enterprise 8.0, which share the same validation engine.
It was introduced when we tightened the XML validation engine to flag processing instructions containing the string “xml” as being invalid (which is correct behaviour). Unfortunately, that code does not differentiate between a regular PI (where it is invalid) and the PI contained in the XML file's Prolog (the “XML Declaration”). When you reference an external parsed entity (aka: file entity) it is expanded in place inside the referencing file. The XML Declaration PI is included in that expansion and then incorrectly indicated as being an illegal PI because it now appears inside the referencing document outside that document's own Prolog.
The solution in your case is to revert to the old behaviour by setting the following INI variable:
enable_pi_validation = falseSetting that INI variable will also stop the validation engine from catching “regular” PIs that contain the string “xml” which is the new behaviour implemented that causes your particular issue.
Derek Read November 12, 2013 at 11:57 pm
Reply to: XMetaL Author 8.0 Error with XML declaration in external entity
November 12, 2013 at 11:57 pmThe following is a representation of what the resulting expansion looks like and the portion (marked in red) that XMetaL Author is flagging incorrectly as invalid:
External Parsed Entity File:
(made up by me and representing the contents of “simple.ent”)foo bar Your Referencing File:
]>&simple; Resulting Expansion:
]>
xml version="1.0" encoding="utf-8"?>foo bar The XML Recommendation does not seem to explicitly state anything about this exception, but a validating XML processor should not flag it as invalid (most do not). And we agree, otherwise external parsed entities would not be allowed to contain an XML declaration (the PI) but the recommendation clearly states that they “SHOULD” in http://www.w3.org/TR/REC-xml/#sec-TextDecl.
Hopefully we'll fix it at some point so that invalid PIs containing “xml” are caught but external parsed entities are not incorrectly flagged.
MarcB November 13, 2013 at 9:21 am
Reply to: XMetaL Author 8.0 Error with XML declaration in external entity
November 13, 2013 at 9:21 amThanks, Derek, that works for us.
-
AuthorPosts
- You must be logged in to reply to this topic.