Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

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


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"?>
  <language name="English" id="en">


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.


Jan 12, 2010 16:25

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.

Jan 12, 2010 23:47

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.

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.