Пример #1
0
        protected virtual IList <XmlNode> _GetGeneratedNodes
        (
            Action <System.Xml.XmlWriter> generateOutput
        )
        {
            StringBuilder stringBuilder = new StringBuilder();

            using (System.IO.StringWriter writer = new System.IO.StringWriter(stringBuilder))
            {
                using (System.Xml.XmlWriter xmlWriter = System.Xml.XmlTextWriter.Create(writer, this._GetWriterSettings()))
                {
                    this._WriteStartRootNode
                    (
                        xmlWriter,
                        "testNode",
                        "http://www.craighawker.co.uk/xcri/1.1/tests",
                        NamespaceList.GetNamespaces(NamespaceList.Namespaces.None)
                    );
                    xmlWriter.Flush();
                    int startAt = stringBuilder.ToString().Length;
                    generateOutput(xmlWriter);
                    xmlWriter.Flush();
                    xmlWriter.WriteEndElement();
                }
            }
            XmlDocument document = new XmlDocument();

            document.LoadXml(stringBuilder.ToString());
            List <XmlNode> toReturn = new List <XmlNode>();

            foreach (XmlNode child in document.DocumentElement.ChildNodes)
            {
                toReturn.Add(child);
            }
            return(toReturn);
        }
Пример #2
0
 internal Generator()
     : base()
 {
     base._Namespaces = NamespaceList.GetNamespaces(NamespaceList.Namespaces.XCRICAP11_All);
 }