#151 Small caps, all caps, and double strikethrough; #199 Ability to use measurement unit other than twips

This commit is contained in:
Ivan Lanin 2014-05-01 23:56:55 +07:00
parent 1a1356a30b
commit 1d84c1db33
15 changed files with 197 additions and 43 deletions

View File

@ -39,7 +39,9 @@ This release marked heavy refactorings on internal code structure with the creat
- ODT Writer: Basic image writing - @ivanlanin - ODT Writer: Basic image writing - @ivanlanin
- ODT Writer: Link writing - @ivanlanin - ODT Writer: Link writing - @ivanlanin
- ODT Reader: Basic ODText Reader - @ivanlanin GH-71 - ODT Reader: Basic ODText Reader - @ivanlanin GH-71
- Section: Ability to define gutter and line numbering - Section: Ability to define gutter and line numbering - @ivanlanin
- Font: Small caps, all caps, and double strikethrough - @ivanlanin GH-151
- Settings: Ability to use measurement unit other than twips with `setMeasurementUnit` - @ivanlanin GH-199
### Bugfixes ### Bugfixes

View File

@ -112,9 +112,12 @@ Available font styles:
- ``subScript`` Subscript, *true* or *false* - ``subScript`` Subscript, *true* or *false*
- ``underline`` Underline, *dash*, *dotted*, etc. - ``underline`` Underline, *dash*, *dotted*, etc.
- ``strikethrough`` Strikethrough, *true* or *false* - ``strikethrough`` Strikethrough, *true* or *false*
- ``doubleStrikethrough`` Double strikethrough, *true* or *false*
- ``color`` Font color, e.g. *FF0000* - ``color`` Font color, e.g. *FF0000*
- ``fgColor`` Font highlight color, e.g. *yellow*, *green*, *blue* - ``fgColor`` Font highlight color, e.g. *yellow*, *green*, *blue*
- ``bgColor`` Font background color, e.g. *FF0000* - ``bgColor`` Font background color, e.g. *FF0000*
- ``smallCaps`` Small caps, *true* or *false*
- ``allCaps`` All caps, *true* or *false*
Paragraph style Paragraph style
^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^

View File

@ -515,9 +515,12 @@ Available font styles:
- `subScript` Subscript, *true* or *false* - `subScript` Subscript, *true* or *false*
- `underline` Underline, *dash*, *dotted*, etc. - `underline` Underline, *dash*, *dotted*, etc.
- `strikethrough` Strikethrough, *true* or *false* - `strikethrough` Strikethrough, *true* or *false*
- `doubleStrikethrough` Double strikethrough, *true* or *false*
- `color` Font color, e.g. *FF0000* - `color` Font color, e.g. *FF0000*
- `fgColor` Font highlight color, e.g. *yellow*, *green*, *blue* - `fgColor` Font highlight color, e.g. *yellow*, *green*, *blue*
- `bgColor` Font background color, e.g. *FF0000* - `bgColor` Font background color, e.g. *FF0000*
- `smallCaps` Small caps, *true* or *false*
- `allCaps` All caps, *true* or *false*
#### Paragraph style #### Paragraph style

View File

@ -4,7 +4,7 @@ include_once 'Sample_Header.php';
// New Word Document // New Word Document
echo date('H:i:s') , " Create new PhpWord object" , EOL; echo date('H:i:s') , " Create new PhpWord object" , EOL;
$phpWord = new \PhpOffice\PhpWord\PhpWord(); $phpWord = new \PhpOffice\PhpWord\PhpWord();
$phpWord->addFontStyle('rStyle', array('bold' => true, 'italic' => true, 'size' => 16)); $phpWord->addFontStyle('rStyle', array('bold' => true, 'italic' => true, 'size' => 16, 'allCaps' => true, 'doubleStrikethrough' => true));
$phpWord->addParagraphStyle('pStyle', array('align' => 'center', 'spaceAfter' => 100)); $phpWord->addParagraphStyle('pStyle', array('align' => 'center', 'spaceAfter' => 100));
$phpWord->addTitleStyle(1, array('bold' => true), array('spaceAfter' => 240)); $phpWord->addTitleStyle(1, array('bold' => true), array('spaceAfter' => 240));
@ -34,6 +34,7 @@ $fontStyle['strikethrough'] = true;
$fontStyle['superScript'] = true; $fontStyle['superScript'] = true;
$fontStyle['color'] = 'FF0000'; $fontStyle['color'] = 'FF0000';
$fontStyle['fgColor'] = 'yellow'; $fontStyle['fgColor'] = 'yellow';
$fontStyle['smallCaps'] = true;
$section->addText('I am inline styled.', $fontStyle); $section->addText('I am inline styled.', $fontStyle);
$section->addTextBreak(); $section->addTextBreak();

View File

@ -17,6 +17,11 @@ use PhpOffice\PhpWord\Exception\InvalidStyleException;
*/ */
class Font extends AbstractStyle class Font extends AbstractStyle
{ {
/**
* Underline types
*
* @const string
*/
const UNDERLINE_NONE = 'none'; const UNDERLINE_NONE = 'none';
const UNDERLINE_DASH = 'dash'; const UNDERLINE_DASH = 'dash';
const UNDERLINE_DASHHEAVY = 'dashHeavy'; const UNDERLINE_DASHHEAVY = 'dashHeavy';
@ -35,6 +40,12 @@ class Font extends AbstractStyle
const UNDERLINE_WAVYDOUBLE = 'wavyDbl'; const UNDERLINE_WAVYDOUBLE = 'wavyDbl';
const UNDERLINE_WAVYHEAVY = 'wavyHeavy'; const UNDERLINE_WAVYHEAVY = 'wavyHeavy';
const UNDERLINE_WORDS = 'words'; const UNDERLINE_WORDS = 'words';
/**
* Foreground colors
*
* @const string
*/
const FGCOLOR_YELLOW = 'yellow'; const FGCOLOR_YELLOW = 'yellow';
const FGCOLOR_LIGHTGREEN = 'green'; const FGCOLOR_LIGHTGREEN = 'green';
const FGCOLOR_CYAN = 'cyan'; const FGCOLOR_CYAN = 'cyan';
@ -121,6 +132,13 @@ class Font extends AbstractStyle
*/ */
private $strikethrough = false; private $strikethrough = false;
/**
* Double strikethrough
*
* @var bool
*/
private $doubleStrikethrough = false;
/** /**
* Font color * Font color
* *
@ -161,6 +179,22 @@ class Font extends AbstractStyle
*/ */
private $hint = PhpWord::DEFAULT_FONT_CONTENT_TYPE; private $hint = PhpWord::DEFAULT_FONT_CONTENT_TYPE;
/**
* Small caps
*
* @var bool
* @link http://www.schemacentral.com/sc/ooxml/e-w_smallCaps-1.html
*/
private $smallCaps = false;
/**
* All caps
*
* @var bool
* @link http://www.schemacentral.com/sc/ooxml/e-w_caps-1.html
*/
private $allCaps = false;
/** /**
* Create new font style * Create new font style
* *
@ -387,6 +421,35 @@ class Font extends AbstractStyle
public function setStrikethrough($value = false) public function setStrikethrough($value = false)
{ {
$this->strikethrough = $this->setBoolVal($value, $this->strikethrough); $this->strikethrough = $this->setBoolVal($value, $this->strikethrough);
if ($this->strikethrough) {
$this->doubleStrikethrough = false;
}
return $this;
}
/**
* Get double strikethrough
*
* @return bool
*/
public function getDoubleStrikethrough()
{
return $this->doubleStrikethrough;
}
/**
* Set double strikethrough
*
* @param bool $value
* @return self
*/
public function setDoubleStrikethrough($value = false)
{
$this->doubleStrikethrough = $this->setBoolVal($value, $this->doubleStrikethrough);
if ($this->doubleStrikethrough) {
$this->strikethrough = false;
}
return $this; return $this;
} }
@ -534,4 +597,56 @@ class Font extends AbstractStyle
return $this; return $this;
} }
/**
* Get small caps
*
* @return bool
*/
public function getSmallCaps()
{
return $this->smallCaps;
}
/**
* Set small caps
*
* @param bool $value
* @return self
*/
public function setSmallCaps($value = false)
{
$this->smallCaps = $this->setBoolVal($value, $this->smallCaps);
if ($this->smallCaps) {
$this->allCaps = false;
}
return $this;
}
/**
* Get all caps
*
* @return bool
*/
public function getAllCaps()
{
return $this->allCaps;
}
/**
* Set all caps
*
* @param bool $value
* @return self
*/
public function setAllCaps($value = false)
{
$this->allCaps = $this->setBoolVal($value, $this->allCaps);
if ($this->allCaps) {
$this->smallCaps = false;
}
return $this;
}
} }

View File

@ -52,6 +52,8 @@ class LineNumbering extends AbstractStyle
/** /**
* Create a new instance * Create a new instance
*
* @param array $style
*/ */
public function __construct($style = null) public function __construct($style = null)
{ {

View File

@ -162,6 +162,9 @@ class Section extends Border
/** /**
* Set orientation * Set orientation
*
* @param string $value
* @return self
*/ */
public function setOrientation($value = null) public function setOrientation($value = null)
{ {
@ -177,6 +180,8 @@ class Section extends Border
$this->pageSizeW = $longSize; $this->pageSizeW = $longSize;
$this->pageSizeH = $shortSize; $this->pageSizeH = $shortSize;
} }
return $this;
} }
/** /**
@ -191,18 +196,22 @@ class Section extends Border
/** /**
* Set Portrait Orientation * Set Portrait Orientation
*
* @return self
*/ */
public function setPortrait() public function setPortrait()
{ {
$this->setOrientation(self::ORIENTATION_PORTRAIT); return $this->setOrientation(self::ORIENTATION_PORTRAIT);
} }
/** /**
* Set Landscape Orientation * Set Landscape Orientation
*
* @return self
*/ */
public function setLandscape() public function setLandscape()
{ {
$this->setOrientation(self::ORIENTATION_LANDSCAPE); return $this->setOrientation(self::ORIENTATION_LANDSCAPE);
} }
/** /**

View File

@ -31,8 +31,8 @@ class Text extends Element
$html = ''; $html = '';
// Paragraph style // Paragraph style
$paragraphStyle = $this->element->getParagraphStyle(); $paragraphStyle = $this->element->getParagraphStyle();
$paragraphStyleIsObject = ($paragraphStyle instanceof Paragraph); $pStyleIsObject = ($paragraphStyle instanceof Paragraph);
if ($paragraphStyleIsObject) { if ($pStyleIsObject) {
$styleWriter = new ParagraphStyleWriter($paragraphStyle); $styleWriter = new ParagraphStyleWriter($paragraphStyle);
$paragraphStyle = $styleWriter->write(); $paragraphStyle = $styleWriter->write();
} }
@ -45,7 +45,7 @@ class Text extends Element
} }
if ($paragraphStyle && !$this->withoutP) { if ($paragraphStyle && !$this->withoutP) {
$attribute = $paragraphStyleIsObject ? 'style' : 'class'; $attribute = $pStyleIsObject ? 'style' : 'class';
$html .= "<p {$attribute}=\"{$paragraphStyle}\">"; $html .= "<p {$attribute}=\"{$paragraphStyle}\">";
} }
if ($fontStyle) { if ($fontStyle) {

View File

@ -31,13 +31,13 @@ class TextRun extends Element
if (count($elements) > 0) { if (count($elements) > 0) {
// Paragraph style // Paragraph style
$paragraphStyle = $this->element->getParagraphStyle(); $paragraphStyle = $this->element->getParagraphStyle();
$paragraphStyleIsObject = ($paragraphStyle instanceof Paragraph); $pStyleIsObject = ($paragraphStyle instanceof Paragraph);
if ($paragraphStyleIsObject) { if ($pStyleIsObject) {
$styleWriter = new ParagraphStyleWriter($paragraphStyle); $styleWriter = new ParagraphStyleWriter($paragraphStyle);
$paragraphStyle = $styleWriter->write(); $paragraphStyle = $styleWriter->write();
} }
$tag = $this->withoutP ? 'span' : 'p'; $tag = $this->withoutP ? 'span' : 'p';
$attribute = $paragraphStyleIsObject ? 'style' : 'class'; $attribute = $pStyleIsObject ? 'style' : 'class';
$html .= "<{$tag} {$attribute}=\"{$paragraphStyle}\">"; $html .= "<{$tag} {$attribute}=\"{$paragraphStyle}\">";
foreach ($elements as $element) { foreach ($elements as $element) {
$elementWriter = new Element($this->parentWriter, $element, true); $elementWriter = new Element($this->parentWriter, $element, true);

View File

@ -52,21 +52,13 @@ class Font extends AbstractStyle
} }
$font = $this->style->getName(); $font = $this->style->getName();
$bold = $this->style->getBold();
$italic = $this->style->getItalic();
$color = $this->style->getColor(); $color = $this->style->getColor();
$size = $this->style->getSize(); $size = $this->style->getSize();
$fgColor = $this->style->getFgColor();
$bgColor = $this->style->getBgColor(); $bgColor = $this->style->getBgColor();
$strikethrough = $this->style->getStrikethrough();
$underline = $this->style->getUnderline();
$superscript = $this->style->getSuperScript();
$subscript = $this->style->getSubScript();
$hint = $this->style->getHint();
$this->xmlWriter->startElement('w:rPr'); $this->xmlWriter->startElement('w:rPr');
// Font // Font name/family
if ($font != PhpWord::DEFAULT_FONT_NAME) { if ($font != PhpWord::DEFAULT_FONT_NAME) {
$this->xmlWriter->startElement('w:rFonts'); $this->xmlWriter->startElement('w:rFonts');
$this->xmlWriter->writeAttribute('w:ascii', $font); $this->xmlWriter->writeAttribute('w:ascii', $font);
@ -74,13 +66,12 @@ class Font extends AbstractStyle
$this->xmlWriter->writeAttribute('w:eastAsia', $font); $this->xmlWriter->writeAttribute('w:eastAsia', $font);
$this->xmlWriter->writeAttribute('w:cs', $font); $this->xmlWriter->writeAttribute('w:cs', $font);
//Font Content Type //Font Content Type
if ($hint != PhpWord::DEFAULT_FONT_CONTENT_TYPE) { if ($this->style->getHint() != PhpWord::DEFAULT_FONT_CONTENT_TYPE) {
$this->xmlWriter->writeAttribute('w:hint', $hint); $this->xmlWriter->writeAttribute('w:hint', $this->style->getHint());
} }
$this->xmlWriter->endElement(); $this->xmlWriter->endElement();
} }
// Color // Color
if ($color != PhpWord::DEFAULT_FONT_COLOR) { if ($color != PhpWord::DEFAULT_FONT_COLOR) {
$this->xmlWriter->startElement('w:color'); $this->xmlWriter->startElement('w:color');
@ -99,32 +90,37 @@ class Font extends AbstractStyle
} }
// Bold // Bold
if ($bold) { if ($this->style->getBold()) {
$this->xmlWriter->writeElement('w:b', null); $this->xmlWriter->writeElement('w:b', null);
} }
// Italic // Italic
if ($italic) { if ($this->style->getItalic()) {
$this->xmlWriter->writeElement('w:i', null); $this->xmlWriter->writeElement('w:i', null);
$this->xmlWriter->writeElement('w:iCs', null); $this->xmlWriter->writeElement('w:iCs', null);
} }
// Underline // Underline
if (!is_null($underline) && $underline != 'none') { if ($this->style->getUnderline() != 'none') {
$this->xmlWriter->startElement('w:u'); $this->xmlWriter->startElement('w:u');
$this->xmlWriter->writeAttribute('w:val', $underline); $this->xmlWriter->writeAttribute('w:val', $this->style->getUnderline());
$this->xmlWriter->endElement(); $this->xmlWriter->endElement();
} }
// Strikethrough // Strikethrough
if ($strikethrough) { if ($this->style->getStrikethrough()) {
$this->xmlWriter->writeElement('w:strike', null); $this->xmlWriter->writeElement('w:strike', null);
} }
// Double strikethrough
if ($this->style->getDoubleStrikethrough()) {
$this->xmlWriter->writeElement('w:dstrike', null);
}
// Foreground-Color // Foreground-Color
if (!is_null($fgColor)) { if (!is_null($this->style->getFgColor())) {
$this->xmlWriter->startElement('w:highlight'); $this->xmlWriter->startElement('w:highlight');
$this->xmlWriter->writeAttribute('w:val', $fgColor); $this->xmlWriter->writeAttribute('w:val', $this->style->getFgColor());
$this->xmlWriter->endElement(); $this->xmlWriter->endElement();
} }
@ -138,12 +134,22 @@ class Font extends AbstractStyle
} }
// Superscript/subscript // Superscript/subscript
if ($superscript || $subscript) { if ($this->style->getSuperScript() || $this->style->getSubScript()) {
$this->xmlWriter->startElement('w:vertAlign'); $this->xmlWriter->startElement('w:vertAlign');
$this->xmlWriter->writeAttribute('w:val', $superscript ? 'superscript' : 'subscript'); $this->xmlWriter->writeAttribute('w:val', $this->style->getSuperScript() ? 'superscript' : 'subscript');
$this->xmlWriter->endElement(); $this->xmlWriter->endElement();
} }
// Small caps
if ($this->style->getSmallCaps()) {
$this->xmlWriter->writeElement('w:smallCaps', null);
}
// All caps
if ($this->style->getAllCaps()) {
$this->xmlWriter->writeElement('w:caps', null);
}
$this->xmlWriter->endElement(); $this->xmlWriter->endElement();
} }

View File

@ -9,8 +9,6 @@
namespace PhpOffice\PhpWord\Writer\Word2007\Style; namespace PhpOffice\PhpWord\Writer\Word2007\Style;
use PhpOffice\PhpWord\Settings;
/** /**
* Margin border style writer * Margin border style writer
* *
@ -46,7 +44,6 @@ class MarginBorder extends AbstractStyle
{ {
$sides = array('top', 'left', 'right', 'bottom', 'insideH', 'insideV'); $sides = array('top', 'left', 'right', 'bottom', 'insideH', 'insideV');
$sizeCount = count($this->sizes) - 1; $sizeCount = count($this->sizes) - 1;
$unit = Settings::getMeasurementUnit();
for ($i = 0; $i < $sizeCount; $i++) { for ($i = 0; $i < $sizeCount; $i++) {
if (!is_null($this->sizes[$i])) { if (!is_null($this->sizes[$i])) {

View File

@ -130,7 +130,6 @@ class Table extends AbstractStyle
for ($i = 0; $i < 6; $i++) { for ($i = 0; $i < 6; $i++) {
if (!is_null($brdSz[$i])) { if (!is_null($brdSz[$i])) {
$hasBorders = true; $hasBorders = true;
break;
} }
} }
if ($hasBorders) { if ($hasBorders) {

View File

@ -52,4 +52,14 @@ class SettingsTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($domPdfPath, Settings::getPdfRendererPath()); $this->assertEquals($domPdfPath, Settings::getPdfRendererPath());
$this->assertFalse(Settings::setPdfRendererPath('dummy/path')); $this->assertFalse(Settings::setPdfRendererPath('dummy/path'));
} }
/**
* Test set/get measurement unit
*/
public function testSetGetMeasurementUnit()
{
$this->assertEquals(Settings::UNIT_TWIP, Settings::getMeasurementUnit());
$this->assertTrue(Settings::setMeasurementUnit(Settings::UNIT_INCH));
$this->assertFalse(Settings::setMeasurementUnit('foo'));
}
} }

View File

@ -24,19 +24,17 @@ class SettingsTest extends \PHPUnit_Framework_TestCase
*/ */
public function testSettingValue() public function testSettingValue()
{ {
// Section Settings
$oSettings = new Section(); $oSettings = new Section();
$this->assertEquals('portrait', $oSettings->getOrientation());
$this->assertEquals(11906, $oSettings->getPageSizeW());
$this->assertEquals(16838, $oSettings->getPageSizeH());
$oSettings->setSettingValue('orientation', 'landscape'); $oSettings->setSettingValue('orientation', 'landscape');
$this->assertEquals('landscape', $oSettings->getOrientation()); $this->assertEquals('landscape', $oSettings->getOrientation());
$this->assertEquals(16838, $oSettings->getPageSizeW()); $this->assertEquals(16838, $oSettings->getPageSizeW());
$this->assertEquals(11906, $oSettings->getPageSizeH()); $this->assertEquals(11906, $oSettings->getPageSizeH());
$oSettings->setSettingValue('orientation', null);
$this->assertEquals('portrait', $oSettings->getOrientation());
$this->assertEquals(11906, $oSettings->getPageSizeW());
$this->assertEquals(16838, $oSettings->getPageSizeH());
$iVal = rand(1, 1000); $iVal = rand(1, 1000);
$oSettings->setSettingValue('borderSize', $iVal); $oSettings->setSettingValue('borderSize', $iVal);
$this->assertEquals(array($iVal, $iVal, $iVal, $iVal), $oSettings->getBorderSize()); $this->assertEquals(array($iVal, $iVal, $iVal, $iVal), $oSettings->getBorderSize());
@ -55,6 +53,13 @@ class SettingsTest extends \PHPUnit_Framework_TestCase
$iVal = rand(1, 1000); $iVal = rand(1, 1000);
$oSettings->setSettingValue('headerHeight', $iVal); $oSettings->setSettingValue('headerHeight', $iVal);
$this->assertEquals($iVal, $oSettings->getHeaderHeight()); $this->assertEquals($iVal, $oSettings->getHeaderHeight());
$oSettings->setSettingValue('lineNumbering', array());
$oSettings->setSettingValue('lineNumbering', array('start' => 1, 'increment' => 1, 'distance' => 240, 'restart' => 'newPage'));
$this->assertInstanceOf('PhpOffice\\PhpWord\\Style\\LineNumbering', $oSettings->getLineNumbering());
$oSettings->removeLineNumbering();
$this->assertNull($oSettings->getLineNumbering());
} }
/** /**
@ -105,7 +110,7 @@ class SettingsTest extends \PHPUnit_Framework_TestCase
$oSettings = new Section(); $oSettings = new Section();
$oSettings->setPortrait(); $oSettings->setPortrait();
$this->assertNull($oSettings->getOrientation()); $this->assertEquals('portrait', $oSettings->getOrientation());
$this->assertEquals(11906, $oSettings->getPageSizeW()); $this->assertEquals(11906, $oSettings->getPageSizeW());
$this->assertEquals(16838, $oSettings->getPageSizeH()); $this->assertEquals(16838, $oSettings->getPageSizeH());
} }

View File

@ -113,7 +113,7 @@ class DocumentTest extends \PHPUnit_Framework_TestCase
$phpWord = new PhpWord(); $phpWord = new PhpWord();
$phpWord->addParagraphStyle('pStyle', array('align' => 'center')); // Style #1 $phpWord->addParagraphStyle('pStyle', array('align' => 'center')); // Style #1
$phpWord->addFontStyle('fStyle', array('size' => '20')); // Style #2 $phpWord->addFontStyle('fStyle', array('size' => '20', 'doubleStrikethrough' => true, 'allCaps' => true)); // Style #2
$phpWord->addTitleStyle(1, array('color' => '333333', 'bold' => true)); // Style #3 $phpWord->addTitleStyle(1, array('color' => '333333', 'bold' => true)); // Style #3
$fontStyle = new Font('text', array('align' => 'center')); $fontStyle = new Font('text', array('align' => 'center'));
$section = $phpWord->addSection(); $section = $phpWord->addSection();
@ -391,6 +391,7 @@ class DocumentTest extends \PHPUnit_Framework_TestCase
$styles['fgColor'] = 'yellow'; $styles['fgColor'] = 'yellow';
$styles['bgColor'] = 'FFFF00'; $styles['bgColor'] = 'FFFF00';
$styles['hint'] = 'eastAsia'; $styles['hint'] = 'eastAsia';
$styles['smallCaps'] = true;
$section = $phpWord->addSection(); $section = $phpWord->addSection();
$section->addText('Test', $styles); $section->addText('Test', $styles);
@ -406,6 +407,7 @@ class DocumentTest extends \PHPUnit_Framework_TestCase
$this->assertEquals('superscript', $doc->getElementAttribute("{$parent}/w:vertAlign", 'w:val')); $this->assertEquals('superscript', $doc->getElementAttribute("{$parent}/w:vertAlign", 'w:val'));
$this->assertEquals($styles['color'], $doc->getElementAttribute("{$parent}/w:color", 'w:val')); $this->assertEquals($styles['color'], $doc->getElementAttribute("{$parent}/w:color", 'w:val'));
$this->assertEquals($styles['fgColor'], $doc->getElementAttribute("{$parent}/w:highlight", 'w:val')); $this->assertEquals($styles['fgColor'], $doc->getElementAttribute("{$parent}/w:highlight", 'w:val'));
$this->assertTrue($doc->elementExists("{$parent}/w:smallCaps"));
} }
/** /**