示例#1
0
        internal CanonicalXml(XmlDocument document, bool includeComments)
        {
            if (document == null)
            {
                throw new ArgumentNullException(nameof(document));
            }

            _c14nDoc = new CanonicalXmlDocument(true, includeComments);
            _c14nDoc.LoadXml(document.OuterXml);
            _ancMgr = new C14NAncestralNamespaceContextManager();
        }
示例#2
0
        internal CanonicalXml(XmlNodeList nodeList, bool includeComments)
        {
            if (nodeList == null)
            {
                throw new ArgumentNullException(nameof(nodeList));
            }

            XmlDocument doc = Utils.GetOwnerDocument(nodeList);

            if (doc == null)
            {
                throw new ArgumentException("nodeList");
            }

            _c14nDoc = new CanonicalXmlDocument(false, includeComments);
            _c14nDoc.LoadXml(doc.OuterXml);
            _ancMgr = new C14NAncestralNamespaceContextManager();

            MarkInclusionStateForNodes(nodeList, doc, _c14nDoc);
        }