Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个带有一些属性的 xml,我想重新排列这些属性。而且我有不同属性的不同元素。我希望所有元素 'id' 作为我的第一个属性。
这里的小例子,
<item name="product" dep="DE" id="I001">Item</item>
我想重新排列属性
<item id="I001" name="product" dep="DE">Item</item>
Dim x As XElement = <item name="product" dep="DE" id="I001">Item</item> x.ReplaceAttributes(x.Attributes("id").Concat(x.Attributes().Where(Function(a) a.Name <> "id")))