Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-09-04
1
Medium Priority
?
418 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 1000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

722 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