Skip to content

Xml - don't automatically encode attribute values #1610

@belav

Description

@belav

Currently xml attributes are encoded when run through CSharpier, which results in them being less readable.

Input

<Target Name="Transform" BeforeTargets="Build">
  <Message Importance="high" Text="@(MyItems->'MyItems has %(Identity)', ', ')" />
</Target>

Output

<Target Name="Transform" BeforeTargets="Build">
  <Message Importance="high" Text="@(MyItems-&gt;'MyItems has %(Identity)', ', ')" />
</Target>

This happens automatically with XAttribute but the code does make use of that along with the associated XmlAttribute to keep the original new lines in attribute values. Does using only XmlAttribute cause some other issue? Can the code figure out how to keep unencoded values for everything?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions