Beispiel #1
0
 protected override void Commit()
 {
     /*XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
     xmlOptions.SaveSyntheticDocumentElement=(new QName(CTFootnotes.type.Name.NamespaceURI, "footnotes"));
     Dictionary<String,String> map = new Dictionary<String,String>();
     map.Put("http://schemas.Openxmlformats.org/officeDocument/2006/relationships", "r");
     map.Put("http://schemas.Openxmlformats.org/wordProcessingml/2006/main", "w");
     xmlOptions.SaveSuggestedPrefixes=(map);*/
     PackagePart part = GetPackagePart();
     Stream out1 = part.GetOutputStream();
     XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces(new[] {
         new XmlQualifiedName("w", "http://schemas.Openxmlformats.org/wordProcessingml/2006/main"),
         new XmlQualifiedName("r", "http://schemas.Openxmlformats.org/officeDocument/2006/relationships")
     });
     FootnotesDocument notesDoc = new FootnotesDocument(ctFootnotes);
     notesDoc.Save(out1, null);
     out1.Close();
 }
Beispiel #2
0
        /**
         * Creates an empty footnotes element for the document if one does not already exist
         * @return footnotes
         */
        public XWPFFootnotes CreateFootnotes()
        {
            if (footnotes == null)
            {
                FootnotesDocument footnotesDoc = new FootnotesDocument();

                XWPFRelation relation = XWPFRelation.FOOTNOTE;
                int i = GetRelationIndex(relation);

                XWPFFootnotes wrapper = (XWPFFootnotes)CreateRelationship(relation, XWPFFactory.GetInstance(), i);
                wrapper.SetFootnotes(footnotesDoc.Footnotes);
                footnotes = wrapper;
            }

            return footnotes;
        }
Beispiel #3
0
 protected internal override void Commit()
 {
     /*XmlOptions xmlOptions = new XmlOptions(DEFAULT_XML_OPTIONS);
     xmlOptions.SaveSyntheticDocumentElement=(new QName(CTFootnotes.type.Name.NamespaceURI, "footnotes"));
     Dictionary<String,String> map = new Dictionary<String,String>();
     map.Put("http://schemas.Openxmlformats.org/officeDocument/2006/relationships", "r");
     map.Put("http://schemas.Openxmlformats.org/wordProcessingml/2006/main", "w");
     xmlOptions.SaveSuggestedPrefixes=(map);*/
     PackagePart part = GetPackagePart();
     using (Stream out1 = part.GetOutputStream())
     {
         FootnotesDocument notesDoc = new FootnotesDocument(ctFootnotes);
         notesDoc.Save(out1);
     }
 }