示例#1
0
 internal CanonicalXml(
     Stream inputStream,
     bool includeComments,
     XmlResolver resolver,
     string strBaseUri)
 {
     if (inputStream == null)
     {
         throw new ArgumentNullException(nameof(inputStream));
     }
     m_c14nDoc             = new CanonicalXmlDocument(true, includeComments);
     m_c14nDoc.XmlResolver = resolver;
     m_c14nDoc.Load(PreProcessStreamInput(inputStream, resolver, strBaseUri));
     m_ancMgr = new C14NAncestralNamespaceContextManager();
 }
示例#2
0
        internal CanonicalXml(XmlNodeList nodeList, XmlResolver resolver, bool includeComments)
        {
            if (nodeList == null)
            {
                throw new ArgumentNullException(nameof(nodeList));
            }
            XmlDocument ownerDocument = Exml.GetOwnerDocument(nodeList);

            if (ownerDocument == null)
            {
                throw new ArgumentException(nameof(nodeList));
            }
            m_c14nDoc             = new CanonicalXmlDocument(false, includeComments);
            m_c14nDoc.XmlResolver = resolver;
            m_c14nDoc.Load(new XmlNodeReader(ownerDocument));
            m_ancMgr = new C14NAncestralNamespaceContextManager();
            MarkInclusionStateForNodes(nodeList, ownerDocument, m_c14nDoc);
        }