Merge XElement into XDocument and resolve namespaces

后端 未结 1 1376
隐瞒了意图╮
隐瞒了意图╮ 2021-01-21 17:06

Given the following XDocument, initialized into variable xDoc:



        
1条回答
  •  自闭症患者
    2021-01-21 17:58

    I'm not sure why this is happening, but removing the xmlns attribute from the body element seems to work:

    var report = XDocument.Parse(
    @"
      
        
        
      
    ");
    
    var body = XElement.Parse(
    @"