Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

Would you like to fix a bug about removing xmlns? #21

Closed
chucklu opened this issue May 24, 2018 · 6 comments
Closed

Would you like to fix a bug about removing xmlns? #21

chucklu opened this issue May 24, 2018 · 6 comments
Labels

Comments

@chucklu
Copy link

chucklu commented May 24, 2018

1.the target file

<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  <appSettings>
    <add key="test20180523" value="1" />
  </appSettings>
</configuration>

2.the transform file

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0" xdt:Transform="RemoveAttributes(xmlns)" xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform" />

when I try to apply the transform to the target,nothing happened.

@chucklu
Copy link
Author

chucklu commented May 24, 2018

I have tried to debug this, I have found the reason why it' not working.
You can check my comments in following issues
dotnet/aspnetcore#3077
CameronWills/FatAntelope#8

@nil4
Copy link
Owner

nil4 commented May 27, 2018

@chucklu I don't necessarily see this as a bug; removing xmlns attributes changes the meaning of the source document.

Is the inability to remove it blocking you? I'd be interested in understanding the use case a bit better.

Since you debugged the issue, would you be interested in submitting a pull request?

@chucklu
Copy link
Author

chucklu commented May 28, 2018

I know remove the xmlns attribute has changed the meaning of the source document.
But I have this demand to do this, just remove it.

I have debugged it, but can not fix it.
The source code is complicated for me, I just debugged to find when this bug happened.

@chucklu
Copy link
Author

chucklu commented May 28, 2018

I also tried to add a xmlns to a source file(without xmlns), it did not work either.

@nil4
Copy link
Owner

nil4 commented May 28, 2018

I don't plan to implement this feature. It's not a common use case, and I would like to avoid this tool drifting away from the original feature set Microsoft implemented.

@chucklu
Copy link
Author

chucklu commented May 28, 2018

when the xmlns is not modified between the target file and compared file.
once you encounter such case, then there is no choice to avoid this.
I skip the xmlns as a workaround now, hard code it which make the code ugly.

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

No branches or pull requests

2 participants