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

Microsoft.Web.Xdt #3077

Closed
chucklu opened this issue Apr 20, 2018 · 13 comments
Closed

Microsoft.Web.Xdt #3077

chucklu opened this issue Apr 20, 2018 · 13 comments

Comments

@chucklu
Copy link

chucklu commented Apr 20, 2018

Hi team,
I find a library on nuget https://www.nuget.org/packages/Microsoft.Web.Xdt/2.1.2
The project site is https://xdt.codeplex.com.

Source Code
You can browse the source code via the web or use git to clone the source repository.
git clone https://git01.codeplex.com/xdt

when I try to clone it, but failed with following info:

fatal: unable to update url base from redirection:
asked for: https://git01.codeplex.com/xdt/info/refs?service=git-upload-pack
redirect: https://archive.codeplex.com/?p=git01

Could you tell me the correct url?

I find a fork on github https://github.com/davidalpert/xdt. but it's not the latest version released two months ago.
Is it possible for you to publish this project on github https://github.com/aspnet

@Tratcher
Copy link
Member

@glennc @vijayrkn

@chucklu
Copy link
Author

chucklu commented Apr 23, 2018

@glennc @vijayrkn
I want to report a bug about No element in the source document matches '/configuration/appSettings'
which happened in xdt\XmlTransform\XmlTransforms.cs
SiblingElement property of InsertBase class

The bug occurred when the base source have an xml namespace while the target remove it.
The patch file apply to the source like this,

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

I am not sure when you remove the namespace from source(maybe in memory), but when I remove the namespace from source, the exception disappeared.

@chucklu
Copy link
Author

chucklu commented Apr 23, 2018

@glennc @vijayrkn
You can check the detail info here

@chucklu
Copy link
Author

chucklu commented Apr 28, 2018

Hi,
@Tratcher @glennc @vijayrkn Anyone knows something about this issue?

@vijayrkn
Copy link

@chucklu - I will take a look at the issue you mentioned and will get back.

@chucklu
Copy link
Author

chucklu commented May 8, 2018

Hi @vijayrkn , any progress?
Can you reproduce this issue reported on CameronWills/FatAntelope#6?
I guess when the patch file contains remove namespace, you remove it first.
Then XmlNodeList siblings = TargetNode.SelectNodes(xpath); can not find the node cause the namespace already removed.

@chucklu
Copy link
Author

chucklu commented May 23, 2018

@vijayrkn any update?
I have found bug in AttributeTransform class

private XmlNodeList GetAttributesFrom(XmlNode node, IList<string> arguments, bool warnIfEmpty) {
            string[] array = new string[arguments.Count];
            arguments.CopyTo(array, 0);
            string xpath = String.Concat("@", String.Join("|@", array));
            
            XmlNodeList attributes = node.SelectNodes(xpath);
            if (attributes.Count == 0 && warnIfEmpty) {
                Debug.Assert(arguments.Count == 1, "Should only call warnIfEmpty==true with one argument");
                if (arguments.Count == 1) {
                    Log.LogWarning(SR.XMLTRANSFORMATION_TransformArgumentFoundNoAttributes, arguments[0]);
                }
            }

            return attributes;
        }

XmlNodeList attributes = node.SelectNodes(xpath);
The SelectNodes did not consider the node could have xmlnamespace.

@chucklu
Copy link
Author

chucklu commented May 24, 2018

The node above is a target node, however when you record the log,
The CurrentReferenceNode is a transform node
Log.LogWarning(SR.XMLTRANSFORMATION_TransformArgumentFoundNoAttributes, arguments[0]);

public void LogWarning(string message, params object[] messageArgs) {
            if (SupressWarnings)
            {
                // SupressWarnings downgrade the Warning to LogMessage
                LogMessage(message, messageArgs);
            }
            else
            {
                if (CurrentReferenceNode != null)
                {
                    LogWarning(CurrentReferenceNode, message, messageArgs);
                }
                else if (externalLogger != null)
                {
                    externalLogger.LogWarning(message, messageArgs);
                }
            }
        }

@Eilon
Copy link
Member

Eilon commented Jul 13, 2018

Closing this issue because this is not part of ASP.NET Core.

@Eilon Eilon closed this as completed Jul 13, 2018
@chucklu
Copy link
Author

chucklu commented Jul 14, 2018

Hi @Eilon, who I supposed to contact?

@Eilon
Copy link
Member

Eilon commented Jul 16, 2018

@vijayrkn - what is the recommended place to report issues with XDT?

@vijayrkn
Copy link

At this point, aspnet/websdk would be the best place.

@Eilon
Copy link
Member

Eilon commented Jul 16, 2018

Here's the full link: https://github.com/aspnet/websdk/issues

@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants