当前位置: 首页>>代码示例>>PHP>>正文


PHP XMLWriter::writeRaw方法代码示例

本文整理汇总了PHP中PhpOffice\PhpWord\Shared\XMLWriter::writeRaw方法的典型用法代码示例。如果您正苦于以下问题:PHP XMLWriter::writeRaw方法的具体用法?PHP XMLWriter::writeRaw怎么用?PHP XMLWriter::writeRaw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PhpOffice\PhpWord\Shared\XMLWriter的用法示例。


在下文中一共展示了XMLWriter::writeRaw方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: writeCustomProperty

 /**
  * Write individual property
  *
  * @param \PhpOffice\PhpWord\Shared\XMLWriter $xmlWriter
  * @param string $property
  * @param string $value
  * @return void
  *
  * @todo Handle other `$type`: double|date|dateTime|duration|boolean (4th arguments)
  */
 private function writeCustomProperty(XMLWriter $xmlWriter, $property, $value)
 {
     $xmlWriter->startElement('meta:user-defined');
     $xmlWriter->writeAttribute('meta:name', $property);
     // if ($type !== null) {
     //     $xmlWriter->writeAttribute('meta:value-type', $type);
     // }
     $xmlWriter->writeRaw($value);
     $xmlWriter->endElement();
     // meta:user-defined
 }
开发者ID:Senasum,项目名称:PHPWord,代码行数:21,代码来源:Meta.php

示例2: writeFieldMark

 /**
  * Write TOC Field
  */
 private function writeFieldMark(XMLWriter $xmlWriter, TOCElement $element)
 {
     $minDepth = $element->getMinDepth();
     $maxDepth = $element->getMaxDepth();
     $xmlWriter->startElement('w:r');
     $xmlWriter->startElement('w:fldChar');
     $xmlWriter->writeAttribute('w:fldCharType', 'begin');
     $xmlWriter->endElement();
     $xmlWriter->endElement();
     $xmlWriter->startElement('w:r');
     $xmlWriter->startElement('w:instrText');
     $xmlWriter->writeAttribute('xml:space', 'preserve');
     $xmlWriter->writeRaw("TOC \\o {$minDepth}-{$maxDepth} \\h \\z \\u");
     $xmlWriter->endElement();
     $xmlWriter->endElement();
     $xmlWriter->startElement('w:r');
     $xmlWriter->startElement('w:fldChar');
     $xmlWriter->writeAttribute('w:fldCharType', 'separate');
     $xmlWriter->endElement();
     $xmlWriter->endElement();
 }
开发者ID:FabianoFaria,项目名称:ULA_front,代码行数:24,代码来源:TOC.php

示例3: writeNote

 /**
  * Write note item
  *
  * @param \PhpOffice\PhpWord\Shared\XMLWriter $xmlWriter
  * @param \PhpOffice\PhpWord\Element\Footnote|\PhpOffice\PhpWord\Element\Endnote $element
  */
 protected function writeNote(XMLWriter $xmlWriter, $element)
 {
     $xmlWriter->startElement($this->elementNode);
     $xmlWriter->writeAttribute('w:id', $element->getRelationId());
     $xmlWriter->startElement('w:p');
     // Paragraph style
     $styleWriter = new ParagraphStyleWriter($xmlWriter, $element->getParagraphStyle());
     $styleWriter->setIsInline(true);
     $styleWriter->write();
     // Reference symbol
     $xmlWriter->startElement('w:r');
     $xmlWriter->startElement('w:rPr');
     $xmlWriter->startElement('w:rStyle');
     $xmlWriter->writeAttribute('w:val', $this->refStyle);
     $xmlWriter->endElement();
     // w:rStyle
     $xmlWriter->endElement();
     // w:rPr
     $xmlWriter->writeElement($this->refNode);
     $xmlWriter->endElement();
     // w:r
     // Empty space after refence symbol
     $xmlWriter->startElement('w:r');
     $xmlWriter->startElement('w:t');
     $xmlWriter->writeAttribute('xml:space', 'preserve');
     $xmlWriter->writeRaw(' ');
     $xmlWriter->endElement();
     // w:t
     $xmlWriter->endElement();
     // w:r
     $this->writeContainerElements($xmlWriter, $element);
     $xmlWriter->endElement();
     // w:p
     $xmlWriter->endElement();
     // $this->elementNode
 }
开发者ID:kaantunc,项目名称:MYK-BOR,代码行数:42,代码来源:Footnotes.php

示例4: writeSeriesItem

 /**
  * Write series items.
  *
  * @param \PhpOffice\PhpWord\Shared\XMLWriter $xmlWriter
  * @param string $type
  * @param array $values
  * @return void
  */
 private function writeSeriesItem(XMLWriter $xmlWriter, $type, $values)
 {
     $types = array('cat' => array('c:cat', 'c:strLit'), 'val' => array('c:val', 'c:numLit'), 'xVal' => array('c:xVal', 'c:strLit'), 'yVal' => array('c:yVal', 'c:numLit'));
     list($itemType, $itemLit) = $types[$type];
     $xmlWriter->startElement($itemType);
     $xmlWriter->startElement($itemLit);
     $index = 0;
     foreach ($values as $value) {
         $xmlWriter->startElement('c:pt');
         $xmlWriter->writeAttribute('idx', $index);
         $xmlWriter->startElement('c:v');
         $xmlWriter->writeRaw($value);
         $xmlWriter->endElement();
         // c:v
         $xmlWriter->endElement();
         // c:pt
         $index++;
     }
     $xmlWriter->endElement();
     // $itemLit
     $xmlWriter->endElement();
     // $itemType
 }
开发者ID:doit05,项目名称:relProject,代码行数:31,代码来源:Chart.php


注:本文中的PhpOffice\PhpWord\Shared\XMLWriter::writeRaw方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。