Solved

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

Posted on 2004-09-04
1
372 Views
Last Modified: 2010-04-15
setting xml:lang on an xml document using the dom? an XmlWriter? something?
0
Comment
Question by:sethUSer420
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

759 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now