PHP:
$new = new SimpleXMLElement('<g transform="matrix(8,-8,8,8,164,172)" preserveAspectRatio="none" >
<defs>
<g id="MyCircle" >
<circle fill="#FFFFFF" cx="77" cy="131" r="9"/>
</g>
</defs>
<use x="-101.5" y="-113.5" width="200" height="200" xlink:href="#MyCircle" />
</g>');
I am getting:
Warning: SimpleXMLElement::__construct(): namespace error : Namespace prefix xlink for href on use is not defined
Define the namespace in the xml <use> element:
$new = new SimpleXMLElement('<g transform="matrix(8,-8,8,8,164,172)" preserveAspectRatio="none" >
<defs>
<g id="MyCircle" >
<circle fill="#FFFFFF" cx="77" cy="131" r="9"/>
</g>
</defs>
<use xmlns:xlink="http://www.w3.org/1999/xlink" x="-101.5" y="-113.5" width="200"
height="200" xlink:href="#MyCircle" />
</g>');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With