/** * Converts a jsoup document into the provided W3C Document. If required, you can set options on the output document * before converting. * @param in jsoup doc * @param out w3c doc * @see org.jsoup.helper.W3CDom#fromJsoup(org.jsoup.nodes.Document) */ public void convert(org.jsoup.nodes.Document in, Document out) { if (!StringUtil.isBlank(in.location())) out.setDocumentURI(in.location()); org.jsoup.nodes.Element rootEl = in.child(0); // skip the #root node NodeTraversor.traverse(new W3CBuilder(out), rootEl); }
/** * @inheritDoc */ public void setDocumentURI(String documentURI) { dom.setDocumentURI(documentURI); }
public void setDocumentURI(String documentURI) { this.doc.setDocumentURI(documentURI); }
@Override public void setDocumentURI(String documentURI) { original_.setDocumentURI(documentURI); }
/** * produce a schema B' identical to the overridden schema document B for override transformations */ private Document cloneOverridenSchema(Element overridenRoot){ final Document newDoc = fDOMImpl.createDocument(null, null, null); final Node newRoot = newDoc.importNode(overridenRoot, true); // Document URI need to be set for proper schema resolving newDoc.setDocumentURI(overridenRoot.getOwnerDocument().getDocumentURI()); newDoc.appendChild(newRoot); return newDoc; }
/** * @param arg0 * @see org.w3c.dom.Document#setDocumentURI(java.lang.String) */ public void setDocumentURI(String arg0) { getParent().setDocumentURI(arg0); }
public static Document read(DocumentBuilder builder, XMLStreamReader reader, boolean repairing) throws XMLStreamException { Document doc = builder == null ? DOMUtils.createDocument() : builder.newDocument(); if (reader.getLocation().getSystemId() != null) { try { doc.setDocumentURI(new String(reader.getLocation().getSystemId())); } catch (Exception e) { //ignore - probably not DOM level 3 } } readDocElements(doc, reader, repairing); return doc; }
public static Document read(DocumentBuilder builder, XMLStreamReader reader, boolean repairing) throws XMLStreamException { Document doc = builder == null ? DOMUtils.createDocument() : builder.newDocument(); if (reader.getLocation().getSystemId() != null) { try { doc.setDocumentURI(new String(reader.getLocation().getSystemId())); } catch (Exception e) { //ignore - probably not DOM level 3 } } readDocElements(doc, reader, repairing); return doc; }
public static Document read(XMLStreamReader reader, boolean recordLoc) throws XMLStreamException { Document doc = DOMUtils.createDocument(); if (reader.getLocation().getSystemId() != null) { try { doc.setDocumentURI(new String(reader.getLocation().getSystemId())); } catch (Exception e) { //ignore - probably not DOM level 3 } } readDocElements(doc, doc, reader, true, recordLoc); return doc; }
public static Document read(DocumentBuilder builder, XMLStreamReader reader, boolean repairing) throws XMLStreamException { Document doc = builder == null ? DOMUtils.createDocument() : builder.newDocument(); if (reader.getLocation().getSystemId() != null) { try { doc.setDocumentURI(new String(reader.getLocation().getSystemId())); } catch (Exception e) { //ignore - probably not DOM level 3 } } readDocElements(doc, reader, repairing); return doc; }
public static Document read(XMLStreamReader reader, boolean recordLoc) throws XMLStreamException { Document doc = DOMUtils.createDocument(); if (reader.getLocation().getSystemId() != null) { try { doc.setDocumentURI(new String(reader.getLocation().getSystemId())); } catch (Exception e) { //ignore - probably not DOM level 3 } } readDocElements(doc, doc, reader, true, recordLoc); return doc; }
public static Document read(XMLStreamReader reader, boolean recordLoc) throws XMLStreamException { Document doc = DOMUtils.createDocument(); if (reader.getLocation().getSystemId() != null) { try { doc.setDocumentURI(new String(reader.getLocation().getSystemId())); } catch (Exception e) { //ignore - probably not DOM level 3 } } readDocElements(doc, doc, reader, true, recordLoc); return doc; }
public static Document read(DocumentBuilder builder, XMLStreamReader reader, boolean repairing) throws XMLStreamException { Document doc = builder == null ? DOMUtils.createDocument() : builder.newDocument(); if (reader.getLocation().getSystemId() != null) { try { doc.setDocumentURI(reader.getLocation().getSystemId()); } catch (Exception e) { //ignore - probably not DOM level 3 } } readDocElements(doc, reader, repairing); return doc; }
public static Document read(DocumentBuilder builder, XMLStreamReader reader, boolean repairing) throws XMLStreamException { Document doc = builder == null ? DOMUtils.createDocument() : builder.newDocument(); if (reader.getLocation().getSystemId() != null) { try { doc.setDocumentURI(reader.getLocation().getSystemId()); } catch (Exception e) { //ignore - probably not DOM level 3 } } readDocElements(doc, reader, repairing); return doc; }
public static Document read(XMLStreamReader reader, boolean recordLoc) throws XMLStreamException { Document doc = DOMUtils.createDocument(); if (reader.getLocation().getSystemId() != null) { try { doc.setDocumentURI(reader.getLocation().getSystemId()); } catch (Exception e) { //ignore - probably not DOM level 3 } } readDocElements(doc, doc, reader, true, recordLoc); return doc; }
public static Document read(XMLStreamReader reader, boolean recordLoc) throws XMLStreamException { Document doc = DOMUtils.createDocument(); if (reader.getLocation().getSystemId() != null) { try { doc.setDocumentURI(reader.getLocation().getSystemId()); } catch (Exception e) { //ignore - probably not DOM level 3 } } readDocElements(doc, doc, reader, true, recordLoc); return doc; }
protected void initClonedOwnerDoc() throws ParserConfigurationException { ownerDocCloned = getDocumentBuilderFactory().newDocumentBuilder().newDocument(); ownerDocCloned.setDocumentURI(getDocumentURI()); ownerDocCloned.setXmlVersion(getXmlVersion()); }
public Document getDocument(Schema schemaDef) throws SchemaException { Document doc = null; if((schemaDef != null)&&(schemaDef instanceof com.ebmwebsourcing.commons.schema.impl.Schema)) { try { doc = convertSchema2DOMElement((org.w3._2001.xmlschema.Schema) ((com.ebmwebsourcing.commons.schema.impl.Schema)schemaDef).getModel()); doc.setDocumentURI(schemaDef.getDocumentBaseURI().getPath()); } catch (SchemaException e) { throw new SchemaException("Can not write wsdl description",e); } } return doc; }
/** * Runs the test case. * @throws Throwable Any uncaught exception causes test to fail */ public void runTest() throws Throwable { Document doc; String docURI; doc = (Document) load("hc_staff", true); doc.setDocumentURI("file:///test"); docURI = doc.getDocumentURI(); assertEquals("documentsetdocumenturi01", "file:///test", docURI); } /**
public Document getDocument(final Constraint def) throws WSQMLException { Document doc = null; if ((def != null) && (def instanceof Constraint)) { doc = WSQMLWriterImpl .convertConstraint2DOMElement(def.getTagQName(), (com.ebmwebsourcing.wsstar.qml.upmc.fr.ConstraintType) ((AbstractSchemaElementImpl) def) .getModel()); if(def.getDocumentBaseURI() != null) { doc.setDocumentURI(def.getDocumentBaseURI().getPath()); } } return doc; }