/** * Constructor for an empty document. * * @param mediaType * The representation's media type. */ public DomRepresentation(MediaType mediaType) { super(mediaType); this.dom = XMLParser.createDocument(); }
/** * Constructor for an empty document. * * @param mediaType * The representation's media type. */ public XmlRepresentation(MediaType mediaType) { super(mediaType); this.dom = XMLParser.createDocument(); }
protected XMLPacketImplGWT(final String name, @Nullable final String namespace) { document = XMLParser.createDocument(); element = document.createElement(name); if (namespace != null) { element.setAttribute("xmlns", namespace); } document.appendChild(element); }
/** * Returns the wrapped DOM document. If no document is defined yet, it * attempts to parse the XML representation eventually given at construction * time. Otherwise, it just creates a new document. * * @return The wrapped DOM document. * @throws IOException */ public Document getDocument() throws IOException { if (this.dom == null) { if (this.xmlRepresentation != null) { this.dom = XMLParser.parse(this.xmlRepresentation.getText()); } else { this.dom = XMLParser.createDocument(); } } return this.dom; }
/** * Returns the wrapped DOM document. If no document is defined yet, it * attempts to parse the XML representation eventually given at construction * time. Otherwise, it just creates a new document. * * @return The wrapped DOM document. */ public Document getDocument() { if (this.dom == null) { if (this.xmlRepresentation != null) { this.dom = XMLParser.parse(this.xmlRepresentation.getText()); } else { this.dom = XMLParser.createDocument(); } } return this.dom; }
public XmlDebugPanel(TreeTableModel model) { this.model = model; nodes = new IdentityHashMap<Object, Element>(); document = XMLParser.createDocument(); root = document.createElement("debug-panel"); initWidget(textArea = new TextArea()); textArea.ensureDebugId("debug-panel-xml"); textArea.setStyleName(Utils.style() + "-xml"); // Build the XML document based on the current state. document.appendChild(root); nodes.put(model.getRoot(), root); build(model.getRoot()); model.addTreeTableModelListener(this); }
public String convertToXml( IDatabaseConnection dbConn ) { Document document = XMLParser.createDocument(); try { Element databaseConnection = document.createElement( DATABASE_CONNECTION );