Code example for Element

Methods: getNodeName

0
 
	/** 
	 * @see org.newdawn.slick.svg.inkscape.ElementProcessor#handles(org.w3c.dom.Element) 
	 */ 
	public boolean handles(Element element) {
		return element.getNodeName().equals("use");
	} 
 
	/** 
	 * @see org.newdawn.slick.svg.inkscape.ElementProcessor#process(org.newdawn.slick.svg.Loader, org.w3c.dom.Element, org.newdawn.slick.svg.Diagram, org.newdawn.slick.geom.Transform) 
	 */ 
	public void process(Loader loader, Element element, Diagram diagram,
			Transform transform) throws ParsingException {
 
		String ref = element.getAttributeNS("http://www.w3.org/1999/xlink", "href");
		String href = Util.getAsReference(ref);
		 
		Figure referenced = diagram.getFigureByID(href);
		if (referenced == null) {
			throw new ParsingException(element, "Unable to locate referenced element: "+href);
		}