Solved

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

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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Name Space error VS2015 1 48
Where is this file? 3 42
Input parameteres to DragOver 2 58
Unprotect Visio drawing page in C# 4 22
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

734 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