Get the xml language node attribute "name" instead of child node?

Vote:
 

Ok this seems like a silly question, but how do you access the "name" attribute in the language node?

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<languages>
  <language name="English" id="en">
    <document>
      <download>Download:</download>
    </document>

 

I know you can do Translate("/document") OR <asp:Literal runat="server" Text="<%$ Resources: EPiServer, document %>" />, but how would I get just the attribute, instead of a child node? Seems like it would be something simple.

Thanks,
Christine

#36055
Jan 12, 2010 16:25
Vote:
 

You have the GetLanguages method that returns a collection of the languages, but not sure if that is what you want.. You can just parse the XML document with Linq to XML or XmlDocument etc.

#36058
Jan 12, 2010 23:47
Vote:
 

Thanks anyways.

I just created a new child node called <languagetitle>United States</languagetitle> instead. It was easier, and I couldn't find a solution to reading the name attribute.

#36293
Jan 22, 2010 20:18
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.