"""Inspect only the two built-in teaching examples; no network, no external XML input."""
import xml.etree.ElementTree as ET
import json
EXAMPLES = {'A': '<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"><path d="M20 90 L60 20 L100 90 Z" fill="#4290C6"/><path d="M40 75 L60 40 L80 75 Z" fill="#A39BDB"/></svg>', 'B': '<svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="0 0 120 120"><image x="0" y="0" width="120" height="120" href="example-raster.png"/></svg>'}
if __name__ == "__main__":
    result={}
    for name,source in EXAMPLES.items():
        root=ET.fromstring(source)
        tags=[n.tag.rsplit("}",1)[-1] for n in root.iter()]
        result[name]={"path_count":tags.count("path"),"image_count":tags.count("image")}
    assert result=={"A":{"path_count":2,"image_count":0},"B":{"path_count":0,"image_count":1}}
    print(json.dumps(result,indent=2))
