示例#1
0
        public xmlElem open()
        {
            try
            {
                //load xml file as a single element representing the root node
                XDocument temp = new XDocument(XDocument.Load(pFilePath));

                xmlFile = new xmlDoc(temp);

                return(new xmlElem(xmlFile.root));
            }
            catch
            {
                return(null);
            }
        }
        public xmlDoc(xmlDoc source)
        {
            xmlDeclaration = new XDeclaration(source.xmlDeclaration);

            rootElem = new xmlElem(source.root);
        }
        public xmlDoc(xmlDoc source)
        {
            xmlDeclaration = new XDeclaration(source.xmlDeclaration);

            rootElem = new xmlElem(source.root);
        }
示例#4
0
        //public void save(XElement data)
        //{
        //    String temp = handledDirectory + handledFileName;

        //    if (File.Exists(pFilePath))
        //    {
        //        data.Save(pFilePath);
        //    }
        //}

        static public void save(xmlDoc data, String filePath)
        {
            File.WriteAllText(filePath, data.ToString(), System.Text.Encoding.UTF8);
        }
        public xmlElem open()
        {
            try
            {
                //load xml file as a single element representing the root node
                XDocument temp = new XDocument(XDocument.Load(pFilePath));

                xmlFile = new xmlDoc(temp);

                return new xmlElem(xmlFile.root);
            }
            catch
            {
                return null;
            }
        }
 //public void save(XElement data)
 //{
 //    String temp = handledDirectory + handledFileName;
 //    if (File.Exists(pFilePath))
 //    {
 //        data.Save(pFilePath);
 //    }
 //}
 public static void save(xmlDoc data, String filePath)
 {
     File.WriteAllText(filePath, data.ToString(), System.Text.Encoding.UTF8);
 }