.net - How do I sort elements by the attributes of the elements' children? -


for xelement like

<a>  <b><c id="2"></b>  <b><c id="3"></b>  <b><c id="1"></b> </a> 

is there way list of <b> ordered <c> id values?

i unsuccessfully tried

belements.orderby(function b xelement) b.elements.attributes("id")) , belements.orderby(function b xelement) b.elements.tostring).

depending on precise needs, this:

belements.orderby(function (b xelement) b.elements.attributes("id").first().value) 

or this:

belements.orderby(function (b xelement) b.elements.first().attribute("id").value) 

or this:

belements.orderby(function (b xelement) b.<c>.@id) 

Comments

Popular posts from this blog

iphone - Three second countdown in cocos2d -

hyperlink - how to do url routing in php -

c - Avoiding Extra Malloc in Linked List (node->next = NULL) -