Strange encoding behavior when adding a value to a xelement
11:53 29 Dec 2025

enter code hereI have the following payload, in which I need to parse a value in the format of an HTML link at a specific location. However, the HTML link must appear betweed “>”.



    
        
            
                
                    R1
                
            
            
                
                    =
                        
                            
                            R1
                        
                    
                
            
            
                
                    
                        
                        R1
                    
                    asc
                
            
        
        public
        GridView
        
        Grid View 1
    

Now I want to write the link after <rql:e2> in the WHERE element.

To do this, I parse the element as follows:

Dim ModNode = _PayloadModContent.Descendants(_DsxKeyContainer.MyNamespace("rql") + "where").Elements(_DsxKeyContainer.MyNamespace("rdf") + "_1").Elements(_DsxKeyContainer.MyNamespace("rql") + "e2").FirstOrDefault

Now I set the value:

ModNode.Add(System.Web.HttpUtility.HtmlEncode("<") + "https://my.server.com.io:9444/rm/resources/MD_vZJaEH4sEe6q_p0A0jNIEQ" + System.Web.HttpUtility.HtmlEncode(">"))

I need the following line for beeing accepted on my server:

<https://my.server.com.io:9444/rm/resources/MD_vZJaEH4sEe6q_p0A0jNIEQ>

But I got this:

&lt;https://my.server.com.io:9443/rm/resources/MD_vZJaEH4sEe6q_p0A0jNIEQ&gt;

What I am doing wrong?

html xml vb.net