Solved

setting xml:lang on an xml document using the dom? an XmlWriter? something?

Posted on 2004-09-04
1
396 Views
Last Modified: 2010-04-15
setting xml:lang on an xml document using the dom? an XmlWriter? something?
0
Comment
Question by:sethUSer420
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 12

Accepted Solution

by:
vascov earned 250 total points
ID: 11981022
Hi,

Note that xml:lang isn't just a doc feature, it can be applied to any element throughout the doc.

Here's a sample on how to set the attribute:

            XmlDocument d = new XmlDocument();
            d.LoadXml( "<doc><a xml:lang='en-gb'/>I'm a doc</doc>" );

            XmlAttribute a = d.CreateAttribute( "xml", "lang", "http://www.w3.org/XML/1998/namespace" );
            a.Value = "en-us";

            d.DocumentElement.Attributes.Append( a );
            Console.WriteLine( d.OuterXml );

hth

Vasco
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question