New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve XML processing instructions #3
Comments
Looks like the implementation in #6 only handles XML declarations and Per the spec, regular processing instructions don't begin with <?oxy_delete author="Bob" timestamp="20191115T162115+0100" content="deleted words"?> Since processing instructions are currently deleted, I suggest you re-open this issue. It looks like the current code also inserts an extra space before the closing While this is not exactly wrong, I think it's less common practice in most cases — but this is perhaps better treated as a separate issue. (UPDATE: now governed by |
@kddeisz See previous comment:
|
The processing Instructions should appear in the Parser's output |
Although they are consumed as a single large token: We should probably properly parse their parts to allow for "pretty" re-printing. |
@infotexture this is working on v0.5.0. Are you having trouble with it? |
@kddeisz Yes, even in 0.6.0, processing instructions that don't start with <?pagebreak?> <?oxy_delete author="Bob" timestamp="20191115T162115+0100" content="deleted words"?> |
Ahh I didn't understand until I continued messing with it that you meant processing instructions inside of other elements as opposed to outside the root element. I've opened #50 to handle that. |
This plug-in currently preserves the optional XML declaration on the first line of XML files, but strips any subsequent processing instructions from the rest of the file.
For example, in many XML workflows,
<?xml-model … ?>
processing instructions are used to provide validation support via schema languages like RELAX NG, W3C XML Schema, DTD and Schematron.For more information, see http://www.w3.org/TR/xml-model/ and http://xml-model.info.
Other use cases may depend heavily on other (proprietary) processing instructions, so it would be best to provide an option to handle all processing instructions, regardless of their content.
If the project prefers to remove processing instructions by default, at least consider adding a configuration option that would allow users to preserve them if necessary.
The text was updated successfully, but these errors were encountered: