-
Notifications
You must be signed in to change notification settings - Fork 20
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
Incorrect condition? #9
Comments
I'm experiencing the same issue
Target web.config
Transformation
Again i believe the condition should be xdt:Locator="Condition([(@value='KeyA')])"? It seens like an issue when the transform should remove a lonely leaf node and add new.. |
I gave up using this library, currently I am using the linq to xml to migrate the configuration file. |
When writing the XDT patch, we were incorrectly using the new tree's values for the xdt:Locator. This was done previously for the scenario when calculating the locator XPath for child nodes after applying changes to the parent node that affected the parent's unique trait / XPath, as locators in the patch need to be valid in current state of transformed document, and Microsoft's XDT library applies the transforms in depth-first order.
Hi All, I've put up a fix now. Apologies for the delay in addressing this - dad life got in the way and then it fell off the radar. It's a tricky one, the xdt:Locator needs to be valid for the current state of the transformed document. And you can omit the xdt:Locator altogether if there is only one node with that name. So after this fix the working patch for @myasoex example looks like:
And similarly for your example @Hans-MartinHannibalLauridsen , the working generated patch doesn't include an xdt:Locator:
I'll package up and push into nuget shortly. Cheers, |
Thanks, much obliged😀 |
Closing as I think that change has addressed the issue? |
Hi there
Check it out
Source web.config
Target web.config
Transformation
What gives us the next result
Should not the condition to be xdt:Locator="Condition([(@value='0')])"?
The text was updated successfully, but these errors were encountered: