Ejemplo n.º 1
0
        public static XRoot Parse(string text, LoadOptions options)
        {
            var root = new XRoot
            {
                _xDocument = XDocument.Parse(text, options)
            };
            var typedRoot = XTypedServices.ToXTypedElement(root._xDocument.Root, LinqToXsdTypeManager.Instance);

            if ((typedRoot == null))
            {
                throw new LinqToXsdException("Invalid root element in xml document.");
            }
            root._rootObject = typedRoot;
            return(root);
        }
Ejemplo n.º 2
0
        public static XRoot Load(XmlReader xmlReader)
        {
            var root = new XRoot
            {
                _xDocument = XDocument.Load(xmlReader)
            };
            var typedRoot = XTypedServices.ToXTypedElement(root._xDocument.Root, LinqToXsdTypeManager.Instance);

            if ((typedRoot == null))
            {
                throw new LinqToXsdException("Invalid root element in xml document.");
            }
            root._rootObject = typedRoot;
            return(root);
        }
Ejemplo n.º 3
0
 public static XRoot Parse(string text, LoadOptions options)
 {
     var root = new XRoot
            {
              _xDocument = XDocument.Parse(text, options)
            };
       var typedRoot = XTypedServices.ToXTypedElement(root._xDocument.Root, LinqToXsdTypeManager.Instance);
       if ((typedRoot == null))
       {
     throw new LinqToXsdException("Invalid root element in xml document.");
       }
       root._rootObject = typedRoot;
       return root;
 }
Ejemplo n.º 4
0
 public static XRoot Load(XmlReader xmlReader)
 {
     var root = new XRoot
            {
              _xDocument = XDocument.Load(xmlReader)
            };
       var typedRoot = XTypedServices.ToXTypedElement(root._xDocument.Root, LinqToXsdTypeManager.Instance);
       if ((typedRoot == null))
       {
     throw new LinqToXsdException("Invalid root element in xml document.");
       }
       root._rootObject = typedRoot;
       return root;
 }