redhat-developer / redhat-developer/vscode-xml
Validation fails when xi:include elements are mixed with directly incldued ones
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 328
- Forks
- 101
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 7
Description
I have docbook xml content that uses xi:include elements. Validation finds the following correct (which is the expected behavior):
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.docbook.org/xml/4.4/docbookx.dtd" [
<!ENTITY % xinclude SYSTEM "http://www.docbook.org/xml/4.4/xinclude.mod">
%xinclude;
]>
<chapter id="chapterCloud">
<title>Enabling stuff</title>
<para>This chapter describes the deployment process. </para>
<xi:include href="deploy_database.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
<xi:include href="add_new_customer.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</chapter>
However, the plugin considers the following invalid :
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.docbook.org/xml/4.4/docbookx.dtd" [
<!ENTITY % xinclude SYSTEM "http://www.docbook.org/xml/4.4/xinclude.mod">
%xinclude;
]>
<chapter id="chapterCloud">
<title>Enabling stuff</title>
<para>This chapter describes the deployment process. </para>
<xi:include href="deploy_database.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
<section><title>title</title>
<para>dsd</para>
</section>
<xi:include href="add_new_customer.xml"
xmlns:xi="http://www.w3.org/2001/XInclude" />
</chapter>
This content should also be considered valid, as the files referenced by the xi:include elements are also <section> elements.
P.s.: I realized that this is probably simply because xi:include functionality is not actually supported, so the second example is considered invalid because there is something between </section> and </chapter>. So maybe this is the same issue/feature request as in
https://github.com/redhat-developer/vscode-xml/issues/175.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the related issue #175 and the validation behavior for DocBook xi:include elements. Reproduce both XML examples and compare validation results, especially when direct content is mixed with included sections. Done means the second example is accepted when the referenced files contain section elements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100