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

XmlPoke strips out DTD #5815

Open
ackh opened this issue Oct 20, 2020 · 0 comments
Open

XmlPoke strips out DTD #5815

ackh opened this issue Oct 20, 2020 · 0 comments
Labels
bug help wanted Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim. triaged
Milestone

Comments

@ackh
Copy link

ackh commented Oct 20, 2020

Issue Description

When modifying an XML file that contains DTD using the XmlPoke task the DTD is stripped out in the resulting XML file.

Steps to Reproduce

The following sample writes an XML file with DTD to the disk. It serves as input for the XmlPoke task which modifies the content and writes a new XML file. Comparing the two XML files shows that the modified file no longer contains the DTD.

<?xml version="1.0" encoding="UTF-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Target Name="Build">
    <PropertyGroup>
      <XmlFileOriginal>original.xml</XmlFileOriginal>
      <XmlFileModified>modified.xml</XmlFileModified>
      <XmlContent>
&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;https://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;
&lt;plist d1p1:version=&quot;&quot; xmlns:d1p1=&quot;1.0&quot;&gt;
  &lt;dict&gt;
    &lt;key&gt;archiveVersion&lt;/key&gt;
    &lt;string&gt;1&lt;/string&gt;
  &lt;/dict&gt;
&lt;/plist&gt;
      </XmlContent>
    </PropertyGroup>
    <WriteLinesToFile File="$(XmlFileOriginal)" Lines="$(XmlContent)" Overwrite="true" />
    <WriteLinesToFile File="$(XmlFileModified)" Lines="$(XmlContent)" Overwrite="true" />
    <XmlPoke XmlInputPath="$(XmlFileModified)" Query="/plist/dict/key" Value="test" />
  </Target>
</Project>

Expected Behavior

The file modified by the XmlPoke task contains the DTD just like before the modification.

@ackh ackh added bug needs-triage Have yet to determine what bucket this goes in. labels Oct 20, 2020
@benvillalobos benvillalobos added this to the Backlog milestone Oct 21, 2020
@benvillalobos benvillalobos added help wanted Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim. and removed needs-triage Have yet to determine what bucket this goes in. labels Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help wanted Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim. triaged
Projects
None yet
Development

No branches or pull requests

3 participants