ser.startDocument("1.0", "UTF-8");
boolean isSVG = resource.getMediaType().equals("image/svg+xml");
if (isSVG) {
Iterator s = styleResources();
while (s.hasNext()) {
ResourceRef sr = (ResourceRef) s.next();
String href = resource.makeReference(sr.getResourceName(), null);
ser.processingInstruction("xml-stylesheet", "href=\"" + href + "\" type=\"text/css\"");
}
getBody().serialize(ser);
} else {
ser.startElement(xhtmlns, "html", null, true);
ser.newLine();
ser.startElement(xhtmlns, "head", null, false);
ser.newLine();
ser.startElement(xhtmlns, "title", null, false);
ser.endElement(xhtmlns, "title");
ser.newLine();
Iterator s = styleResources();
while (s.hasNext()) {
ResourceRef sr = (ResourceRef) s.next();
String href = resource.makeReference(sr.getResourceName(), null);
SMapImpl attr = new SMapImpl();
attr.put(null, "rel", "stylesheet");
attr.put(null, "type", "text/css");
attr.put(null, "href", href);
ser.startElement(xhtmlns, "link", attr, false);