Esempio n. 1
0
        // [WMR 20160421] Caller can safely dispose reader after calling this ctor
        public XmlDomFhirReader(XmlReader reader, bool disallowXsiAttributesOnRoot = false)
        {
            DisallowXsiAttributesOnRoot = disallowXsiAttributesOnRoot;

            var       internalReader = SerializationUtil.WrapXmlReader(reader);
            XDocument doc;

            try
            {
                doc = XDocument.Load(internalReader, LoadOptions.SetLineInfo);
            }
            catch (XmlException xec)
            {
                throw Error.Format("Cannot parse xml: " + xec.Message);
            }

            setRoot(doc);
        }