19package org.openoffice.xmerge.converter.xml;
21import java.io.InputStream;
22import java.io.OutputStream;
24import java.io.BufferedReader;
25import java.io.StringReader;
26import java.io.StringWriter;
27import java.io.InputStreamReader;
28import java.io.ByteArrayOutputStream;
29import java.io.ByteArrayInputStream;
30import java.io.IOException;
31import java.util.Iterator;
33import java.util.HashMap;
35import javax.xml.parsers.DocumentBuilderFactory;
36import javax.xml.parsers.DocumentBuilder;
37import javax.xml.parsers.ParserConfigurationException;
39import org.w3c.dom.Node;
40import org.w3c.dom.Element;
41import org.w3c.dom.Document;
42import org.w3c.dom.DOMImplementation;
43import org.w3c.dom.DocumentType;
44import org.w3c.dom.NodeList;
45import org.xml.sax.InputSource;
46import org.w3c.dom.NamedNodeMap;
47import org.xml.sax.SAXException;
49import javax.xml.transform.*;
50import javax.xml.transform.dom.*;
51import javax.xml.transform.stream.*;
58public abstract class OfficeDocument
59 implements org.openoffice.xmerge.
Document, OfficeConstants {
62 private static DocumentBuilderFactory factory =
63 DocumentBuilderFactory.newInstance();
80 private String documentName =
null;
81 private String fileName =
null;
90 private OfficeZip zip =
null;
93 private Map<String, EmbeddedObject> embeddedObjects =
null;
100 public OfficeDocument(String name) {
101 this(
name,
true,
false);
113 public OfficeDocument(String name,
boolean namespaceAware,
boolean validating) {
114 factory.setValidating(validating);
115 factory.setNamespaceAware(namespaceAware);
116 this.documentName = trimDocumentName(name);
117 this.fileName = documentName + getFileExtension();
127 private String trimDocumentName(String name) {
129 String ext = getFileExtension();
131 if (temp.endsWith(ext)) {
133 int nlen =
name.length();
134 int endIndex = nlen - ext.length();
188 public void setContentDOM( Node newDom) {
197 public void setMetaDOM (Node newDom) {
206 public void setSettingsDOM (Node newDom) {
215 public void setStyleDOM (Node newDom) {
251 public String getFileName() {
261 protected abstract String getFileExtension();
269 private Iterator<EmbeddedObject> getEmbeddedObjects() {
271 if (embeddedObjects ==
null && manifestDoc !=
null) {
272 embeddedObjects =
new HashMap<String, EmbeddedObject>();
275 NodeList nl = manifestDoc.getElementsByTagName(TAG_MANIFEST_FILE);
278 int len = nl.getLength();
279 for (
int i = 0;
i < len;
i++) {
282 NamedNodeMap attrs =
n.getAttributes();
284 String type = attrs.getNamedItem(ATTRIBUTE_MANIFEST_FILE_TYPE).getNodeValue();
285 String path = attrs.getNamedItem(ATTRIBUTE_MANIFEST_FILE_PATH).getNodeValue();
297 if (
type.startsWith(
"application/vnd.sun.xml"))
299 if (path.equals(
"/")) {
304 String name = path.substring(0, path.length() - 1);
305 embeddedObjects.put(name,
new EmbeddedXMLObject(name, type, zip));
307 else if (
type.equals(
"text/xml")) {
313 embeddedObjects.put(path,
new EmbeddedBinaryObject(path, type, zip));
318 if (embeddedObjects ==
null) {
322 return embeddedObjects.values().iterator();
332 public void read(InputStream is)
throws IOException {
334 Debug.log(Debug.INFO,
"reading Office file");
335 DocumentBuilder builder =
null;
338 builder = factory.newDocumentBuilder();
339 }
catch (ParserConfigurationException ex) {
340 throw new OfficeDocumentException(ex);
344 zip =
new OfficeZip();
349 byte contentBytes[] = zip.getContentXMLBytes();
350 if (contentBytes ==
null) {
351 throw new OfficeDocumentException(
"Entry content.xml not found in file");
354 contentDoc =
parse(builder, contentBytes);
355 }
catch (SAXException ex) {
356 throw new OfficeDocumentException(ex);
361 byte styleBytes[] = zip.getStyleXMLBytes();
362 if (styleBytes !=
null) {
364 styleDoc =
parse(builder, styleBytes);
365 }
catch (SAXException ex) {
366 throw new OfficeDocumentException(ex);
370 byte metaBytes[] = zip.getMetaXMLBytes();
371 if (metaBytes !=
null) {
373 metaDoc =
parse(builder, metaBytes);
374 }
catch (SAXException ex) {
375 throw new OfficeDocumentException(ex);
379 byte settingsBytes[] = zip.getSettingsXMLBytes();
380 if (settingsBytes !=
null) {
382 settingsDoc =
parse(builder, settingsBytes);
384 }
catch (SAXException ex) {
385 throw new OfficeDocumentException(ex);
390 byte manifestBytes[] = zip.getManifestXMLBytes();
391 if (manifestBytes !=
null) {
393 manifestDoc =
parse(builder, manifestBytes);
394 }
catch (SAXException ex) {
395 throw new OfficeDocumentException(ex);
408 public void read(InputStream is,
boolean isZip)
throws IOException {
410 Debug.log(Debug.INFO,
"reading Office file");
412 DocumentBuilder builder =
null;
415 builder = factory.newDocumentBuilder();
416 }
catch (ParserConfigurationException ex) {
417 throw new OfficeDocumentException(ex);
424 Reader r = secondHack(is);
425 InputSource ins =
new InputSource(r);
426 org.w3c.dom.Document newDoc = builder.parse(ins);
427 Element rootElement = newDoc.getDocumentElement();
431 Node rootNode = rootElement;
434 contentDoc = createDOM(TAG_OFFICE_DOCUMENT_CONTENT);
435 rootElement = contentDoc.getDocumentElement();
436 rootNode = rootElement;
440 .getElementsByTagName(TAG_OFFICE_FONT_DECLS);
441 if (nodeList.getLength() > 0) {
442 tmpNode = contentDoc.importNode(nodeList.item(0),
true);
443 rootNode.appendChild(tmpNode);
447 .getElementsByTagName(TAG_OFFICE_AUTOMATIC_STYLES);
448 if (nodeList.getLength() > 0) {
449 tmpNode = contentDoc.importNode(nodeList.item(0),
true);
450 rootNode.appendChild(tmpNode);
453 nodeList = newDoc.getElementsByTagName(TAG_OFFICE_BODY);
454 if (nodeList.getLength() > 0) {
455 tmpNode = contentDoc.importNode(nodeList.item(0),
true);
456 rootNode.appendChild(tmpNode);
460 styleDoc = createDOM(TAG_OFFICE_DOCUMENT_STYLES);
461 rootElement = styleDoc.getDocumentElement();
462 rootNode = rootElement;
466 .getElementsByTagName(TAG_OFFICE_FONT_DECLS);
467 if (nodeList.getLength() > 0) {
468 tmpNode = styleDoc.importNode(nodeList.item(0),
true);
469 rootNode.appendChild(tmpNode);
472 nodeList = newDoc.getElementsByTagName(TAG_OFFICE_STYLES);
473 if (nodeList.getLength() > 0) {
474 tmpNode = styleDoc.importNode(nodeList.item(0),
true);
475 rootNode.appendChild(tmpNode);
480 .getElementsByTagName(TAG_OFFICE_AUTOMATIC_STYLES);
481 if (nodeList.getLength() > 0) {
482 tmpNode = styleDoc.importNode(nodeList.item(0),
true);
483 rootNode.appendChild(tmpNode);
488 .getElementsByTagName(TAG_OFFICE_MASTER_STYLES);
489 if (nodeList.getLength() > 0) {
490 tmpNode = styleDoc.importNode(nodeList.item(0),
true);
491 rootNode.appendChild(tmpNode);
495 settingsDoc = createDOM(TAG_OFFICE_DOCUMENT_SETTINGS);
496 rootElement = settingsDoc.getDocumentElement();
497 rootNode = rootElement;
498 nodeList = newDoc.getElementsByTagName(TAG_OFFICE_SETTINGS);
499 if (nodeList.getLength() > 0) {
500 tmpNode = settingsDoc
501 .importNode(nodeList.item(0),
true);
502 rootNode.appendChild(tmpNode);
505 metaDoc = createDOM(TAG_OFFICE_DOCUMENT_META);
506 rootElement = metaDoc.getDocumentElement();
507 rootNode = rootElement;
508 nodeList = newDoc.getElementsByTagName(TAG_OFFICE_META);
509 if (nodeList.getLength() > 0) {
510 tmpNode = metaDoc.importNode(nodeList.item(0),
true);
511 rootNode.appendChild(tmpNode);
513 }
catch (SAXException ex) {
514 throw new OfficeDocumentException(ex);
532 throws SAXException, IOException {
536 ByteArrayInputStream is =
new ByteArrayInputStream(
bytes);
541 InputSource ins =
new InputSource(r);
542 doc = builder.parse(ins);
552 protected abstract String getDocumentMimeType();
561 public void write(OutputStream os)
throws IOException {
563 zip =
new OfficeZip();
569 Element manifestRoot = manifestDoc.getDocumentElement();
572 Iterator<EmbeddedObject> embObjs = getEmbeddedObjects();
573 if (embObjs !=
null) {
574 while (embObjs.hasNext()) {
575 EmbeddedObject obj = embObjs.next();
576 obj.writeManifestData(manifestDoc);
583 domEntry = manifestDoc.createElement(TAG_MANIFEST_FILE);
584 domEntry.setAttribute(ATTRIBUTE_MANIFEST_FILE_PATH,
"Pictures/");
585 domEntry.setAttribute(ATTRIBUTE_MANIFEST_FILE_TYPE,
"");
586 manifestRoot.appendChild(domEntry);
590 zip.setContentXMLBytes(docToBytes(contentDoc));
592 domEntry = manifestDoc.createElement(TAG_MANIFEST_FILE);
593 domEntry.setAttribute(ATTRIBUTE_MANIFEST_FILE_PATH,
"content.xml");
594 domEntry.setAttribute(ATTRIBUTE_MANIFEST_FILE_TYPE,
"text/xml");
596 manifestRoot.appendChild(domEntry);
598 if (styleDoc !=
null) {
599 zip.setStyleXMLBytes(docToBytes(styleDoc));
601 domEntry = manifestDoc.createElement(TAG_MANIFEST_FILE);
602 domEntry.setAttribute(ATTRIBUTE_MANIFEST_FILE_PATH,
"styles.xml");
603 domEntry.setAttribute(ATTRIBUTE_MANIFEST_FILE_TYPE,
"text/xml");
604 manifestRoot.appendChild(domEntry);
607 if (metaDoc !=
null) {
608 zip.setMetaXMLBytes(docToBytes(metaDoc));
610 domEntry = manifestDoc.createElement(TAG_MANIFEST_FILE);
611 domEntry.setAttribute(ATTRIBUTE_MANIFEST_FILE_PATH,
"meta.xml");
612 domEntry.setAttribute(ATTRIBUTE_MANIFEST_FILE_TYPE,
"text/xml");
613 manifestRoot.appendChild(domEntry);
616 if (settingsDoc !=
null) {
617 zip.setSettingsXMLBytes(docToBytes(settingsDoc));
619 domEntry = manifestDoc.createElement(TAG_MANIFEST_FILE);
620 domEntry.setAttribute(ATTRIBUTE_MANIFEST_FILE_PATH,
"settings.xml");
621 domEntry.setAttribute(ATTRIBUTE_MANIFEST_FILE_TYPE,
"text/xml");
622 manifestRoot.appendChild(domEntry);
625 zip.setManifestXMLBytes(docToBytes(manifestDoc));
638 public void write(OutputStream os,
boolean isZip)
throws IOException {
645 DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
646 DocumentBuilder builder= builderFactory.newDocumentBuilder();
647 DOMImplementation domImpl = builder.getDOMImplementation();
648 domImpl.createDocumentType(
"office:document",
"-//OpenOffice.org//DTD OfficeDocument 1.0//EN",
null);
649 org.w3c.dom.Document newDoc = domImpl.createDocument(
"http://openoffice.org/2000/office",
"office:document",
null);
651 Element rootElement=newDoc.getDocumentElement();
652 rootElement.setAttribute(
"xmlns:office",
"http://openoffice.org/2000/office");
653 rootElement.setAttribute(
"xmlns:style",
"http://openoffice.org/2000/style" );
654 rootElement.setAttribute(
"xmlns:text",
"http://openoffice.org/2000/text");
655 rootElement.setAttribute(
"xmlns:table",
"http://openoffice.org/2000/table");
657 rootElement.setAttribute(
"xmlns:draw",
"http://openoffice.org/2000/drawing");
658 rootElement.setAttribute(
"xmlns:fo",
"http://www.w3.org/1999/XSL/Format" );
659 rootElement.setAttribute(
"xmlns:xlink",
"http://www.w3.org/1999/xlink" );
660 rootElement.setAttribute(
"xmlns:dc",
"http://purl.org/dc/elements/1.1/" );
661 rootElement.setAttribute(
"xmlns:meta",
"http://openoffice.org/2000/meta" );
662 rootElement.setAttribute(
"xmlns:number",
"http://openoffice.org/2000/datastyle" );
663 rootElement.setAttribute(
"xmlns:svg",
"http://www.w3.org/2000/svg" );
664 rootElement.setAttribute(
"xmlns:chart",
"http://openoffice.org/2000/chart" );
665 rootElement.setAttribute(
"xmlns:dr3d",
"http://openoffice.org/2000/dr3d" );
666 rootElement.setAttribute(
"xmlns:math",
"http://www.w3.org/1998/Math/MathML" );
667 rootElement.setAttribute(
"xmlns:form",
"http://openoffice.org/2000/form" );
668 rootElement.setAttribute(
"xmlns:script",
"http://openoffice.org/2000/script" );
669 rootElement.setAttribute(
"xmlns:config",
"http://openoffice.org/2001/config" );
671 if(getDocumentMimeType().equals(SXC_MIME_TYPE))
672 rootElement.setAttribute(
"office:class",
"spreadsheet" );
673 else if(getDocumentMimeType().equals(SXW_MIME_TYPE))
674 rootElement.setAttribute(
"office:class",
"text" );
675 rootElement.setAttribute(
"office:version",
"1.0");
679 Node rootNode = rootElement;
680 if (metaDoc !=
null) {
681 nodeList= metaDoc.getElementsByTagName(TAG_OFFICE_META);
682 if (nodeList.getLength()>0) {
683 tmpNode = newDoc.importNode(nodeList.item(0),
true);
684 rootNode.appendChild(tmpNode);
686 }
if (styleDoc !=
null) {
687 nodeList= styleDoc.getElementsByTagName(TAG_OFFICE_STYLES);
688 if (nodeList.getLength()>0){
689 tmpNode = newDoc.importNode(nodeList.item(0),
true);
690 rootNode.appendChild(tmpNode);
692 }
if (settingsDoc !=
null) {
693 nodeList= settingsDoc.getElementsByTagName(TAG_OFFICE_SETTINGS);
694 if (nodeList.getLength()>0){
695 tmpNode = newDoc.importNode(nodeList.item(0),
true);
696 rootNode.appendChild(tmpNode);
698 }
if (contentDoc !=
null) {
699 nodeList= contentDoc.getElementsByTagName(TAG_OFFICE_AUTOMATIC_STYLES);
700 if (nodeList.getLength()>0){
701 tmpNode = newDoc.importNode(nodeList.item(0),
true);
702 rootNode.appendChild(tmpNode);
704 nodeList= contentDoc.getElementsByTagName(TAG_OFFICE_BODY);
705 if (nodeList.getLength()>0){
706 tmpNode = newDoc.importNode(nodeList.item(0),
true);
707 rootNode.appendChild(tmpNode);
711 byte contentBytes[] = docToBytes(newDoc);
712 os.write(contentBytes);
713 }
catch(Exception exc){
714 System.out.println(
"\nException in OfficeDocument.write():" +exc);
733 static byte[] docToBytes(Document doc)
736 ByteArrayOutputStream baos =
new ByteArrayOutputStream();
738 java.lang.reflect.Constructor<?>
con;
739 java.lang.reflect.Method meth;
741 String domImpl = doc.getClass().getName();
752 if (domImpl.equals(
"com.sun.xml.tree.XmlDocument")) {
754 Debug.log(Debug.INFO,
"Using JAXP");
756 Class<?> jaxpDoc =
Class.forName(
"com.sun.xml.tree.XmlDocument");
759 meth = jaxpDoc.getMethod(
"write",
760 new Class[] {
Class.forName(
"java.io.OutputStream") } );
762 meth.invoke(doc,
new Object [] { baos } );
763 }
else if (domImpl.equals(
"org.apache.crimson.tree.XmlDocument")) {
764 Debug.log(Debug.INFO,
"Using Crimson");
766 Class<?> crimsonDoc =
Class.forName(
"org.apache.crimson.tree.XmlDocument");
768 meth = crimsonDoc.getMethod(
"write",
769 new Class[] {
Class.forName(
"java.io.OutputStream") } );
771 meth.invoke(doc,
new Object [] { baos } );
772 }
else if (domImpl.equals(
"org.apache.xerces.dom.DocumentImpl")
773 || domImpl.equals(
"org.apache.xerces.dom.DeferredDocumentImpl")) {
775 Debug.log(Debug.INFO,
"Using Xerces");
779 Class.forName(
"org.apache.xml.serialize.XMLSerializer");
783 con = xercesSer.getConstructor(
new Class []
784 {
Class.forName(
"java.io.OutputStream"),
785 Class.forName(
"org.apache.xml.serialize.OutputFormat") } );
788 meth = xercesSer.getMethod(
"serialize",
789 new Class [] {
Class.forName(
"org.w3c.dom.Document") } );
792 Object serializer =
con.newInstance(
new Object [] { baos,
null } );
795 meth.invoke(serializer,
new Object [] { doc } );
796 }
else if (domImpl.equals(
"gnu.xml.dom.DomDocument")) {
797 Debug.log(Debug.INFO,
"Using GNU");
799 Class<?> gnuSer =
Class.forName(
"gnu.xml.dom.ls.DomLSSerializer");
802 meth = gnuSer.getMethod(
"serialize",
803 new Class [] {
Class.forName(
"org.w3c.dom.Node"),
804 Class.forName(
"java.io.OutputStream") } );
807 Object serializer = gnuSer.newInstance();
810 meth.invoke(serializer,
new Object [] { doc, baos } );
813 DOMSource domSource =
new DOMSource(doc);
814 StringWriter writer =
new StringWriter();
815 StreamResult
result =
new StreamResult(writer);
816 TransformerFactory tf = TransformerFactory.newInstance();
817 Transformer transformer = tf.newTransformer();
818 transformer.transform(domSource, result);
819 return writer.toString().getBytes();
820 }
catch (Exception e) {
822 IOException newEx =
new IOException(
"No appropriate API (JAXP/Xerces) to serialize XML document: " + domImpl);
828 catch (Exception e) {
831 IOException newEx =
new IOException(e.getMessage());
836 byte bytes[] = baos.toByteArray();
847 public final void initContentDOM() throws IOException {
849 contentDoc = createDOM(TAG_OFFICE_DOCUMENT_CONTENT);
853 Element root = contentDoc.getDocumentElement();
855 Element child = contentDoc.createElement(TAG_OFFICE_FONT_DECLS);
856 root.appendChild(child);
858 child = contentDoc.createElement(TAG_OFFICE_AUTOMATIC_STYLES);
859 root.appendChild(child);
861 child = contentDoc.createElement(TAG_OFFICE_BODY);
862 root.appendChild(child);
871 public final void initSettingsDOM() throws IOException {
873 settingsDoc = createSettingsDOM(TAG_OFFICE_DOCUMENT_SETTINGS);
877 Element root = settingsDoc.getDocumentElement();
879 Element child = settingsDoc.createElement(TAG_OFFICE_SETTINGS);
880 root.appendChild(child);
889 public final void initStyleDOM() throws IOException {
891 styleDoc = createDOM(TAG_OFFICE_DOCUMENT_STYLES);
904 private final Document createSettingsDOM(String rootName)
throws IOException {
909 DocumentBuilder builder = factory.newDocumentBuilder();
910 doc = builder.newDocument();
911 }
catch (ParserConfigurationException ex) {
912 throw new OfficeDocumentException(ex);
915 Element root = doc.createElement(rootName);
916 doc.appendChild(root);
918 root.setAttribute(
"xmlns:office",
"http://openoffice.org/2000/office");
919 root.setAttribute(
"xmlns:xlink",
"http://openoffice.org/1999/xlink");
920 root.setAttribute(
"xmlns:config",
"http://openoffice.org/2001/config");
921 root.setAttribute(
"office:version",
"1.0");
936 private final Document createDOM(String rootName)
throws IOException {
941 DocumentBuilder builder = factory.newDocumentBuilder();
942 doc = builder.newDocument();
943 }
catch (ParserConfigurationException ex) {
944 throw new OfficeDocumentException(ex);
947 Element root = doc.createElement(rootName);
948 doc.appendChild(root);
950 root.setAttribute(
"xmlns:office",
"http://openoffice.org/2000/office");
951 root.setAttribute(
"xmlns:style",
"http://openoffice.org/2000/style");
952 root.setAttribute(
"xmlns:text",
"http://openoffice.org/2000/text");
953 root.setAttribute(
"xmlns:table",
"http://openoffice.org/2000/table");
954 root.setAttribute(
"xmlns:draw",
"http://openoffice.org/2000/drawing");
955 root.setAttribute(
"xmlns:fo",
"http://www.w3.org/1999/XSL/Format");
956 root.setAttribute(
"xmlns:xlink",
"http://www.w3.org/1999/xlink");
957 root.setAttribute(
"xmlns:number",
"http://openoffice.org/2000/datastyle");
958 root.setAttribute(
"xmlns:svg",
"http://www.w3.org/2000/svg");
959 root.setAttribute(
"xmlns:chart",
"http://openoffice.org/2000/chart");
960 root.setAttribute(
"xmlns:dr3d",
"http://openoffice.org/2000/dr3d");
961 root.setAttribute(
"xmlns:math",
"http://www.w3.org/1998/Math/MathML");
962 root.setAttribute(
"xmlns:form",
"http://openoffice.org/2000/form");
963 root.setAttribute(
"xmlns:script",
"http://openoffice.org/2000/script");
964 root.setAttribute(
"office:class", getOfficeClassAttribute());
965 root.setAttribute(
"office:version",
"1.0");
975 protected abstract String getOfficeClassAttribute();
1001 private static Reader hack(InputStream is)
throws IOException {
1003 BufferedReader br =
new BufferedReader(
new InputStreamReader(is,
"UTF-8"));
1004 StringBuffer buffer =
new StringBuffer();
1007 while ((str = br.readLine()) !=
null) {
1009 int sIndex = str.indexOf(
"<!DOCTYPE");
1012 buffer.append(str.substring(0, sIndex));
1014 int eIndex = str.indexOf(
'>', sIndex + 8 );
1017 buffer.append(str.substring(eIndex + 1, str.length()));
1019 buffer.append(
"\n");
1024 boolean bOK =
false;
1025 while ((str = br.readLine())!=
null) {
1026 eIndex = str.indexOf(
'>');
1028 buffer.append(str.substring(eIndex+1));
1030 buffer.append(
"\n");
1036 if (!bOK) {
throw new IOException(
"Invalid XML"); }
1043 buffer.append(
"\n");
1047 StringReader r =
new StringReader(buffer.toString());
1065 private static Reader secondHack(InputStream is)
throws IOException {
1067 BufferedReader br =
new BufferedReader(
new InputStreamReader(is,
"UTF-8"));
1068 char[] charArray =
new char[4096];
1069 StringBuffer sBuf =
new StringBuffer();
1071 while ((n=br.read(charArray, 0, charArray.length)) > 0) {
1072 sBuf.append(charArray, 0, n);
1076 int sIndex = sBuf.lastIndexOf(
"</office:document>");
1077 sBuf.delete(sIndex, sBuf.length());
1078 sBuf.append(
"</office:document>");
1079 StringReader r =
new StringReader(sBuf.toString());
1087 private void initManifestDOM() throws IOException {
1090 DocumentBuilder builder = factory.newDocumentBuilder();
1091 DOMImplementation domImpl = builder.getDOMImplementation();
1093 DocumentType docType = domImpl.createDocumentType(TAG_MANIFEST_ROOT,
1094 "-//OpenOffice.org//DTD Manifest 1.0//EN",
1096 manifestDoc = domImpl.createDocument(
"manifest", TAG_MANIFEST_ROOT, docType);
1097 }
catch (ParserConfigurationException ex) {
1098 throw new OfficeDocumentException(ex);
1102 Element manifestRoot = manifestDoc.getDocumentElement();
1104 manifestRoot.setAttribute(
"xmlns:manifest",
"http://openoffice.org/2001/manifest");
1106 Element docRoot = manifestDoc.createElement(TAG_MANIFEST_FILE);
1108 docRoot.setAttribute(ATTRIBUTE_MANIFEST_FILE_PATH,
"/");
1109 docRoot.setAttribute(ATTRIBUTE_MANIFEST_FILE_TYPE, getDocumentMimeType());
1111 manifestRoot.appendChild(docRoot);
This class is used for logging debug messages.
Provides general purpose utilities.
Provides interfaces for converting between two Document formats, and supports a "merge" interface for...
bool parse(OUString const &uri, SourceProviderScannerData *data)
std::vector< sal_uInt8 > bytes