/** * Generates XML in the Atom format. * * @param w * output writer * * @param elementName * Atom element name * * @throws IOException */ @Override public void generateAtom(XmlWriter w, String elementName) throws IOException { ArrayList<XmlWriter.Attribute> attrs = new ArrayList<XmlWriter.Attribute>(2); attrs.add(new XmlWriter.Attribute("type", "xhtml")); if (lang != null) { attrs.add(new XmlWriter.Attribute("xml:lang", lang)); } XmlBlob.startElement(w, Namespaces.atomNs, elementName, xhtml, attrs, null); XmlBlob.endElement(w, Namespaces.atomNs, elementName, xhtml); }
/** * Generates XML in the Atom format. * * @param w * output writer * * @param elementName * Atom element name * * @throws IOException */ @Override public void generateAtom(XmlWriter w, String elementName) throws IOException { ArrayList<XmlWriter.Attribute> attrs = new ArrayList<XmlWriter.Attribute>(2); attrs.add(new XmlWriter.Attribute("type", "xhtml")); if (lang != null) { attrs.add(new XmlWriter.Attribute("xml:lang", lang)); } XmlBlob.startElement(w, Namespaces.atomNs, elementName, xhtml, attrs, null); XmlBlob.endElement(w, Namespaces.atomNs, elementName, xhtml); }
/** * Generates XML in the Atom format. * * @param w * output writer * * @param elementName * Atom element name * * @throws IOException */ @Override public void generateAtom(XmlWriter w, String elementName) throws IOException { ArrayList<XmlWriter.Attribute> attrs = new ArrayList<XmlWriter.Attribute>(2); attrs.add(new XmlWriter.Attribute("type", "xhtml")); if (lang != null) { attrs.add(new XmlWriter.Attribute("xml:lang", lang)); } XmlBlob.startElement(w, Namespaces.atomNs, elementName, xhtml, attrs, null); XmlBlob.endElement(w, Namespaces.atomNs, elementName, xhtml); }
/** * Reverses {@link #generateCumulativeXmlBlob(ExtensionProfile)}. This * operation overwrites the current contents of this extension point. */ public void parseCumulativeXmlBlob(XmlBlob blob, ExtensionProfile extProfile, Class<? extends ExtensionPoint> extendedClass) throws IOException, ParseException { this.xmlBlob = new XmlBlob(); nonRepeatingExtensionMap.clear(); repeatingExtensionMap.clear(); // Prepare a fake XML document from the blob. StringWriter sw = new StringWriter(); XmlWriter w = new XmlWriter(sw); XmlBlob.startElement(w, null, "CUMULATIVE_BLOB", blob, null, null); XmlBlob.endElement(w, null, "CUMULATIVE_BLOB", blob); // Now parse it. StringReader sr = new StringReader(sw.toString()); XmlParser parser = new XmlParser(); parser.parse(sr, new CumulativeBlobHandler(extProfile, extendedClass), "", "CUMULATIVE_BLOB"); }
/** * Reverses {@link #generateCumulativeXmlBlob(ExtensionProfile)}. This * operation overwrites the current contents of this extension point. */ public void parseCumulativeXmlBlob(XmlBlob blob, ExtensionProfile extProfile, Class<? extends ExtensionPoint> extendedClass) throws IOException, ParseException { this.xmlBlob = new XmlBlob(); nonRepeatingExtensionMap.clear(); repeatingExtensionMap.clear(); // Prepare a fake XML document from the blob. StringWriter sw = new StringWriter(); XmlWriter w = new XmlWriter(sw); XmlBlob.startElement(w, null, "CUMULATIVE_BLOB", blob, null, null); XmlBlob.endElement(w, null, "CUMULATIVE_BLOB", blob); // Now parse it. StringReader sr = new StringReader(sw.toString()); XmlParser parser = new XmlParser(); parser.parse(sr, new CumulativeBlobHandler(extProfile, extendedClass), "", "CUMULATIVE_BLOB"); }
/** * Reverses {@link #generateCumulativeXmlBlob(ExtensionProfile)}. This * operation overwrites the current contents of this extension point. */ public void parseCumulativeXmlBlob(XmlBlob blob, ExtensionProfile extProfile, Class<? extends ExtensionPoint> extendedClass) throws IOException, ParseException { this.xmlBlob = new XmlBlob(); nonRepeatingExtensionMap.clear(); repeatingExtensionMap.clear(); // Prepare a fake XML document from the blob. StringWriter sw = new StringWriter(); XmlWriter w = new XmlWriter(sw); XmlBlob.startElement(w, null, "CUMULATIVE_BLOB", blob, null, null); XmlBlob.endElement(w, null, "CUMULATIVE_BLOB", blob); // Now parse it. StringReader sr = new StringReader(sw.toString()); XmlParser parser = new XmlParser(); parser.parse(sr, new CumulativeBlobHandler(extProfile, extendedClass), "", "CUMULATIVE_BLOB"); }
} else if (xml != null) { XmlBlob.startElement(w, Namespaces.atomNs, "content", xml, attrs, null); XmlBlob.endElement(w, Namespaces.atomNs, "content", xml); } else {
} else if (xml != null) { XmlBlob.startElement(w, Namespaces.atomNs, "content", xml, attrs, null); XmlBlob.endElement(w, Namespaces.atomNs, "content", xml); } else {
} else if (xml != null) { XmlBlob.startElement(w, Namespaces.atomNs, "content", xml, attrs, null); XmlBlob.endElement(w, Namespaces.atomNs, "content", xml); } else {