You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an XML file that is not well-formed - it may or may not have a DOCTYPE, but the real problem is that the XML contains a character entity that is not resolved. This currently causes the doctype tool to stop outputting the file contents to STDOUT. In other words, if there is an error, the tool will only pass the content to STDOUT until that point.
The larger issue is that I have a bunch of XML files with character entities but mostly without DOCTYPE declarations that are being linked to a main XML (with DOCTYPE) via XInclude by a system that doesn't appear to think that this is a problem. In order to process the XInclude targets outside this system, I need to first inject them with a DOCTYPE declaration so the character entities can be resolved in a later step.
Many thanks.
The text was updated successfully, but these errors were encountered:
Hi Ari,
Thanks for reporting this.
I believe the immediate cause is that the wrapper around the parser I am using (expat) understandably abandons the parse after encountering a well-formedness error -- so output ceases as soon as an undeclared entity appears.
I have delved into the lower-level callbacks expat provides as part of investigating some of the other feature requests for this tool, but have not yet discovered a way to preserve the value of the undeclared entity.
It does however provide location information, so a hack might be to simply append the rest of the document as unparsed text from that point. But like I say, a hack...
Andrew
Hi Andrew,
I have an XML file that is not well-formed - it may or may not have a DOCTYPE, but the real problem is that the XML contains a character entity that is not resolved. This currently causes the doctype tool to stop outputting the file contents to STDOUT. In other words, if there is an error, the tool will only pass the content to STDOUT until that point.
The larger issue is that I have a bunch of XML files with character entities but mostly without DOCTYPE declarations that are being linked to a main XML (with DOCTYPE) via XInclude by a system that doesn't appear to think that this is a problem. In order to process the XInclude targets outside this system, I need to first inject them with a DOCTYPE declaration so the character entities can be resolved in a later step.
Many thanks.
The text was updated successfully, but these errors were encountered: