XmlReader - I need to edit an element and produce a new one

前端 未结 5 2112
花落未央
花落未央 2020-12-20 15:54

I am overriding a method which has an XmlReader being passed in, I need to find a specific element, add an attribute and then either create a new XmlReader or just replace t

5条回答
  •  粉色の甜心
    2020-12-20 16:28

    I fixed it using the following duct tape coding

        public XmlReader FixUpReader(XmlReader reader)
        {
           reader.MoveToContent();
    
            string xml = reader.ReadOuterXml();
    
            string dslVersion = GetDSLVersion();
            string Id = GetID();
    
            string processedValue = string.Format("

    I feel dirty for doing it this way but it is working....

提交回复
热议问题