Skip to content
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 DOCTYPE declarations #5

Closed
infotexture opened this issue Nov 13, 2019 · 3 comments
Closed

Preserve DOCTYPE declarations #5

infotexture opened this issue Nov 13, 2019 · 3 comments

Comments

@infotexture
Copy link
Contributor

This plug-in currently preserves the optional XML declaration on the first line of XML files:

<?xml version="1.0" encoding="UTF-8"?>

but strips any subsequent DOCTYPE declarations that are required for DTD-based validation in XML dialects, such as DocBook or DITA.

These declarations should be preserved to allow editors and parsers to validate the file content.

DocBook example

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
                         "http://docbook.org/xml/4.5/docbookx.dtd">
<article>
    <title/>
    <sect1>
        <title/>
        <para/>
    </sect1>
</article>

DITA example

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="ID">
    <title></title>
    <shortdesc></shortdesc>
    <taskbody>
        <context>
            <p></p>
        </context>
        <steps>
            <step>
                <cmd></cmd>
            </step>
        </steps>
    </taskbody>
</task>
rart added a commit to rart/plugin-xml that referenced this issue Dec 16, 2019
rart added a commit to rart/plugin-xml that referenced this issue Dec 16, 2019
This reverts commit f230921. Reverting since, including a new expression on the tagPattern regex changes indexes used by `parse` function breaking some of the parsing. This was breaking the `leaf` tests only apparently. Needs more careful inclusion to not break some of the other use cases.
@ghost
Copy link

ghost commented Dec 23, 2019

This is a major issue with hibernate mappings and the config xml in java projects. A solution would be greatly appreciated.

@kddnewton
Copy link
Member

At the moment I can't get them out of the parser, but I'm working on it here: SAP/xml-tools#81

@kddnewton
Copy link
Member

Fixed by #43, will be released in upcoming v0.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants