Solved

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

Posted on 2004-09-04
1
383 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Syntax Error 2 62
Not showing JavaScript in the list 5 52
Simple Injector with Web Service 4 38
Where did System.Data.Objects go? 2 23
Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

813 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

12 Experts available now in Live!

Get 1:1 Help Now