Hi Guy please i Need your help. i have some XML File like this one at the bigining<?xml version="1.0" encoding="utf-8" ?><Orders> <Order OrderID ="104710" Priority="normal"> <Informations> <Infos InfosID="1047101" MatName="mat1" Status="Free"> <exam> </exam> </Infos> <Infos InfosID="1047102" MatName="mat2" Status="Free"> <exam> </exam> </Infos> <Infos InfosID="1047103" MatName="mat3" Status="Free"> <exam> </exam> </Infos> <Infos InfosID="1047104" MatName="mat4" Status="Busy"> <exam> </exam> </Infos> <Infos InfosID="1047105" MatName="mat4" Status="Free"> <exam> </exam> </Infos> <Infos InfosID="1047106" MatName="EX-11445GF" QTY="40" Status="Busy"> <exam> </exam> </Infos> </Informations> </Order> <Order OrderID ="123788" Priority="normal"> <Informations> <Infos InfosID="1237881" MatName="mat1" Status="Busy"> <exam> </exam> </Infos> <Infos InfosID="1237882" MatName="mat2" Status="Busy"> <exam> </exam> </Infos> <Infos InfosID="1237883" MatName="mat3" Status="Free"> <exam> </exam> </Infos> <Infos InfosID="1237884" MatName="mat4" Status="Busy"> <exam> </exam> </Infos> <Infos InfosID="1237885" MatName="mat4" Status="Free"> <exam> </exam> </Infos> <Infos InfosID="1237886" MatName="EX-11445GF" QTY="40" Status="Busy"> <exam> </exam> </Infos> </Informations> </Order></Orders>Please how can i get the Parents attributs where Status = "Busy" that means OrderID Priority, InfosID, and MatName. i didnt found a good request. hier ist my request var InfosAttribut = from xml in xdoc.Descendants("Infos") where (string)xml.Attribute("Status") == "Busy" select xml.Attributes();with this LinQ Request i just get Attribut of Tag "Infos" but i want to get all this Thing in one time. is it possible?thx 解决方案 这篇关于如何在C#中使用linq制作xml过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
09-21 18:17