Skrol29 / tinybutstrong

TBS is a PHP template engine for pro and beginners. Only 1 class with few methods properties, but it can do may things for any text templates, including HTML and XML. The only engine that enables W3C compliant templates. It has many plugins including OpenTBS.
http://www.tinybutstrong.com
60 stars 18 forks source link

Random XML rendering #12

Closed matll42 closed 6 years ago

matll42 commented 6 years ago

Hello,

Thanks again for sharing your Library. I'm embedding images on a Word (docx) document and I'm actually facing a strange issue. There are somes XML attributes that are html encoded and some not.

On a file with 23 embed attributes, 2 are wrong like this one

<a:blip r:embed=&quot;rId12" cstate="print">

Other are corrects like the Following :

<a:blip r:embed="rId12" cstate="print">

When I checked function that generate this line, the quote symbol is correct

// phpdocx/classes/CreateElement.php:180
protected function generateBLIP($cstate = 'print')
    {
        $xml = '<' . CreateImage::NAMESPACEWORD1 .
                ':blip r:embed="rId' . $this->getRId() .
                '" cstate="' . $cstate .
                '"></' . CreateImage::NAMESPACEWORD1 .
                ':blip>__GENERATEBLIPFILL__';

        $this->_xml = str_replace('__GENERATEBLIPFILL__', $xml, $this->_xml);
    }

Did I do something wrong?

Version used: 3.10.1 PHP: 5.5.9 & 7.2.7

matll42 commented 6 years ago

Wrong repository