ImageEn, unit iexSVG

IEGetSVGTagAttribute


Declaration

function IEGetSVGTagAttribute(const Tag: string; const SeekAttribute: string; ParseAll: Boolean = False): string;


Description

Parse a tag and find a value for an attribute whether it is standalone or embedded in a style.
It can also parse a CSS style if it is wrapped in {...}, e.g. "{fill:#ffffff;fill-rule:evenodd;fill-opacity:1;stroke:none;}" .
If ParseAll=True, it keeps processing the string until the attribute is found (even if there are multiple tags within the string).



Demo

Demo  Demos\InputOutput\SVGParsing\SVGParsing.dpr


Examples

s := IEGetSVGTagAttribute( '<text x="205" y="430" fill="Orange" font-size="35">ImageEn!</text>', 'x' );
// Would return '205'

s := IEGetSVGTagAttribute( '{fill:#ffffff;fill-rule:evenodd;fill-opacity:1;stroke:none;}', 'fill-rule' );
// Would return 'evenodd'

s := IEGetSVGTagAttribute( 'fill="white"', 'fill' );
// Would return 'white'


See Also

ParseSVG
IEParseSVGFontAttributes
IEParseSVGStyleAttributes