Here you can find the source of CreateSimpleImage(XMLStreamWriter serializer, URL url, int w, int h)
public static XMLStreamWriter CreateSimpleImage(XMLStreamWriter serializer, URL url, int w, int h) throws XMLStreamException
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); you may import java.net.URL; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamWriter; public class Main { public static XMLStreamWriter CreateSimpleImage(XMLStreamWriter serializer, URL url, int w, int h) throws XMLStreamException { serializer.writeStartElement("img"); serializer.writeAttribute("src", url.toString()); if (w != 0) serializer.writeAttribute("width", String.valueOf(w)); if (h != 0) serializer.writeAttribute("height", String.valueOf(h)); //serializer.writeEndElement(); return serializer; }//from ww w . j a va 2 s. co m }