/** * Writes the representation to a XML writer. * * @param writer * The XML writer to write to. * @throws IOException */ @Override public void write(XmlWriter writer) throws IOException { try { writer.setPrefix(ATOM_NAMESPACE, ""); writer.setDataFormat(true); writer.setIndentStep(3); writer.startDocument(); writeElement(writer); writer.endDocument(); } catch (SAXException e) { IOException ioe = new IOException( "Unable to write the Atom feed document."); ioe.initCause(e); throw ioe; } }
/** * Writes the representation to a XML writer. * * @param writer * The XML writer to write to. * @throws IOException */ @Override public void write(XmlWriter writer) throws IOException { try { writer.setPrefix(ATOM_NAMESPACE, ""); writer.setDataFormat(true); writer.setIndentStep(3); writer.startDocument(); writeElement(writer); writer.endDocument(); } catch (SAXException e) { IOException ioe = new IOException( "Unable to write the Atom entry document."); ioe.initCause(e); throw ioe; } }
/** * Writes the representation to a XML writer. * * @param writer * The XML writer to write to. * @throws IOException */ @Override public void write(XmlWriter writer) throws IOException { try { writer.setPrefix(ATOM_NAMESPACE, ""); writer.setDataFormat(true); writer.setIndentStep(3); writer.startDocument(); writeElement(writer); writer.endDocument(); } catch (SAXException e) { IOException ioe = new IOException( "Unable to write the Atom feed document."); ioe.initCause(e); throw ioe; } }
/** * Writes the representation to a XML writer. * * @param writer * The XML writer to write to. * @throws IOException */ @Override public void write(XmlWriter writer) throws IOException { try { writer.setPrefix(ATOM_NAMESPACE, ""); writer.setDataFormat(true); writer.setIndentStep(3); writer.startDocument(); writeElement(writer); writer.endDocument(); } catch (SAXException e) { IOException ioe = new IOException( "Unable to write the Atom entry document."); ioe.initCause(e); throw ioe; } }
/** * Writes the representation to a XML writer. * * @param writer * The XML writer to write to. * @throws SAXException */ public void writeElement(XmlWriter writer) throws SAXException { writer.startElement(APP_NAMESPACE, "categories"); for (final Category entry : getEntries()) { entry.writeElement(writer); } writer.endElement(APP_NAMESPACE, "categories"); writer.endDocument(); } }
/** * Writes the representation to a XML writer. * * @param writer * The XML writer to write to. * @throws IOException */ @Override public void write(XmlWriter writer) throws IOException { try { writer.setPrefix(APP_NAMESPACE, ""); writer.setPrefix(ATOM_NAMESPACE, "atom"); writer.setDataFormat(true); writer.setIndentStep(3); writer.startDocument(); writeElement(writer); writer.endDocument(); } catch (SAXException e) { IOException ioe = new IOException( "Unable to write the AtomPub categories document."); ioe.initCause(e); throw ioe; } }
/** * Writes the representation to a XML writer. * * @param writer * The XML writer to write to. * @throws SAXException */ public void writeElement(XmlWriter writer) throws SAXException { writer.startElement(APP_NAMESPACE, "categories"); for (final Category entry : getEntries()) { entry.writeElement(writer); } writer.endElement(APP_NAMESPACE, "categories"); writer.endDocument(); } }
/** * Writes the representation to a XML writer. * * @param writer * The XML writer to write to. * @throws IOException */ @Override public void write(XmlWriter writer) throws IOException { try { writer.setPrefix(APP_NAMESPACE, ""); writer.setPrefix(ATOM_NAMESPACE, "atom"); writer.setDataFormat(true); writer.setIndentStep(3); writer.startDocument(); writeElement(writer); writer.endDocument(); } catch (SAXException e) { IOException ioe = new IOException( "Unable to write the AtomPub categories document."); ioe.initCause(e); throw ioe; } }
@Override public void write(XmlWriter writer) throws IOException { try { writer.forceNSDecl(APP_NAMESPACE, ""); writer.setDataFormat(true); writer.setIndentStep(3); writer.processingInstruction("xml", "version=\"1.0\" standalone=\"yes\""); writer.processingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"wadl2html.xslt\""); this.application.writeElement(writer); writer.endDocument(); } catch (SAXException e) { Context.getCurrentLogger().log(Level.SEVERE, "Error when writing the WADL Representation.", e); } } }
/** * Writes the representation to a XML writer. * * @param writer * The XML writer to write to. * @throws IOException */ @Override public void write(XmlWriter writer) throws IOException { try { writer.forceNSDecl(APP_NAMESPACE, ""); writer.forceNSDecl(ATOM_NAMESPACE, "atom"); writer.setDataFormat(true); writer.setIndentStep(3); writer.startDocument(); writer.startElement(APP_NAMESPACE, "service"); for (final Workspace workspace : getWorkspaces()) { workspace.writeElement(writer); } writer.endElement(APP_NAMESPACE, "service"); writer.endDocument(); } catch (SAXException se) { throw new IOException("Couldn't write the service representation: " + se.getMessage()); } }
/** * Writes the representation to a XML writer. * * @param writer * The XML writer to write to. * @throws IOException */ @Override public void write(XmlWriter writer) throws IOException { try { writer.forceNSDecl(APP_NAMESPACE, ""); writer.forceNSDecl(ATOM_NAMESPACE, "atom"); writer.setDataFormat(true); writer.setIndentStep(3); writer.startDocument(); writer.startElement(APP_NAMESPACE, "service"); for (final Workspace workspace : getWorkspaces()) { workspace.writeElement(writer); } writer.endElement(APP_NAMESPACE, "service"); writer.endDocument(); } catch (SAXException se) { throw new IOException("Couldn't write the service representation: " + se.getMessage()); } }
public void write(org.restlet.ext.xml.XmlWriter writer) throws IOException { try { // Start document writer.startDocument(); // Append the root node writer.startElement("mail"); // Append the child nodes and set their text content writer.startElement("status"); writer.characters("received"); writer.endElement("status"); writer.startElement("subject"); writer.characters("Message to self"); writer.endElement("subject"); writer.startElement("content"); writer.characters("Doh!"); writer.endElement("content"); writer.startElement("accountRef"); writer.characters(new Reference(getReference(), "..") .getTargetRef().toString()); writer.endElement("accountRef"); // End the root node writer.endElement("mail"); // End the document writer.endDocument(); } catch (SAXException e) { throw new IOException(e.getMessage()); } }; };