Click here to Skip to main content
15,896,538 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

This is kranthi,

currently i am working in silverlight-4, so silverlight project canot support xmldocument(My thought).So i am using xdocument.can anybody please convert the bellow code to xdocument,xelement manner..

please help me......

the code is:

C#
private XmlElement getNode(ref XmlDocument xmlNode, string nodeName, string value)
    {
        //Create root element
        XmlElement nodeElement = xmlNode.CreateElement("", nodeName, sqlServerNamespace);
        //if DefaultValues
        if (nodeName == "DefaultValues")
        {
            //create Value node
            XmlElement valueElement = xmlNode.CreateElement("", "Value", sqlServerNamespace);
            valueElement.InnerText = value;

            //append to root node created above 
            nodeElement.AppendChild(valueElement);

        }
        else
        {
            //set the value
            nodeElement.InnerText = value;
        }

        //return the constructed node
        return nodeElement;
    }



Thanks,
kranthi...
Posted
Updated 14-Dec-11 18:51pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900