56 $objWriter->startDocument(
'1.0',
'UTF-8',
'yes');
59 $objWriter->startElement(
'Relationships');
60 $objWriter->writeAttribute(
'xmlns',
'http://schemas.openxmlformats.org/package/2006/relationships');
62 $customPropertyList = $pPHPExcel->getProperties()->getCustomProperties();
63 if (count($customPropertyList) > 0) {
68 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties',
78 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties',
86 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties',
94 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument',
98 $objWriter->endElement();
101 return $objWriter->getData();
122 $objWriter->startDocument(
'1.0',
'UTF-8',
'yes');
125 $objWriter->startElement(
'Relationships');
126 $objWriter->writeAttribute(
'xmlns',
'http://schemas.openxmlformats.org/package/2006/relationships');
132 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',
140 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',
148 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',
153 $sheetCount = $pPHPExcel->getSheetCount();
154 for ($i = 0; $i < $sheetCount; ++$i) {
158 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',
159 'worksheets/sheet' . ($i + 1) .
'.xml'
163 $objWriter->endElement();
166 return $objWriter->getData();
192 $objWriter->startDocument(
'1.0',
'UTF-8',
'yes');
195 $objWriter->startElement(
'Relationships');
196 $objWriter->writeAttribute(
'xmlns',
'http://schemas.openxmlformats.org/package/2006/relationships');
199 if ($pWorksheet->getDrawingCollection()->count() > 0) {
203 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing',
204 '../drawings/drawing' . $pWorksheetId .
'.xml'
210 foreach ($pWorksheet->getHyperlinkCollection() as $hyperlink) {
211 if (!$hyperlink->isInternal()) {
215 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink',
216 $hyperlink->getUrl(),
226 if (count($pWorksheet->getComments()) > 0) {
229 '_comments_vml' . $i,
230 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing',
231 '../drawings/vmlDrawing' . $pWorksheetId .
'.vml'
237 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments',
238 '../comments' . $pWorksheetId .
'.xml'
244 if (count($pWorksheet->getHeaderFooter()->getImages()) > 0) {
247 '_headerfooter_vml' . $i,
248 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing',
249 '../drawings/vmlDrawingHF' . $pWorksheetId .
'.vml'
253 $objWriter->endElement();
256 return $objWriter->getData();
277 $objWriter->startDocument(
'1.0',
'UTF-8',
'yes');
280 $objWriter->startElement(
'Relationships');
281 $objWriter->writeAttribute(
'xmlns',
'http://schemas.openxmlformats.org/package/2006/relationships');
285 $iterator = $pWorksheet->getDrawingCollection()->getIterator();
286 while ($iterator->valid()) {
293 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image',
294 '../media/' . str_replace(
' ',
'', $iterator->current()->getIndexedFilename())
302 $objWriter->endElement();
305 return $objWriter->getData();
326 $objWriter->startDocument(
'1.0',
'UTF-8',
'yes');
329 $objWriter->startElement(
'Relationships');
330 $objWriter->writeAttribute(
'xmlns',
'http://schemas.openxmlformats.org/package/2006/relationships');
333 foreach ($pWorksheet->getHeaderFooter()->getImages() as $key => $value) {
338 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image',
339 '../media/' . $value->getIndexedFilename()
343 $objWriter->endElement();
346 return $objWriter->getData();
361 if ($pType !=
'' && $pTarget !=
'') {
363 $objWriter->startElement(
'Relationship');
364 $objWriter->writeAttribute(
'Id',
'rId' . $pId);
365 $objWriter->writeAttribute(
'Type', $pType);
366 $objWriter->writeAttribute(
'Target', $pTarget);
368 if ($pTargetMode !=
'') {
369 $objWriter->writeAttribute(
'TargetMode', $pTargetMode);
372 $objWriter->endElement();
374 throw new Exception(
"Invalid parameters passed.");