XmlSchema schema = ... ... schema.write(System.out)
XmlSchema schema = ... ... schema.write(System.out, null)
/** * Serialize the schema into the given output stream * @param out - the output stream to write to */ public void write(OutputStream out) { write(new OutputStreamWriter(out)); }
/** * Serialize the schema into the given output stream * @param out - the output stream to write to * @param options - a map of options */ public void write(OutputStream out, Map options) { write(new OutputStreamWriter(out),options); }
private static String getSchemaAsString(XmlSchema schema) throws UnsupportedEncodingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); schema.write(baos); return baos.toString(); } }
public InputStream getContent() throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); schema.write(bos); return new ByteArrayInputStream(bos.toByteArray()); }
private static String getSchemaAsString(XmlSchema schema) throws UnsupportedEncodingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); schema.write(baos); return baos.toString(); } }
/** * Convert schema into a String * * @param schema */ private static String getSchemaAsString(XmlSchema schema) throws IOException { StringWriter writer = new StringWriter(); schema.write(writer); return writer.toString(); }
/** * Convert schema into a String * * @param schema */ private static String getSchemaAsString(XmlSchema schema) throws IOException { StringWriter writer = new StringWriter(); schema.write(writer); return writer.toString(); }
/** * Convert schema into a InputStream * * @param schema */ private InputStream getSchemaAsInputStream(XmlSchema schema) throws UnsupportedEncodingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); schema.write(baos); return new ByteArrayInputStream(baos.toByteArray()); } }
/** * Convert schema into a InputStream * * @param schema */ private InputStream getSchemaAsInputStream(XmlSchema schema) throws UnsupportedEncodingException { ByteArrayOutputStream baos = new ByteArrayOutputStream(); schema.write(baos); return new ByteArrayInputStream(baos.toByteArray()); } }
private OMNode convertToOM(XmlSchema schema) throws DataRetrievalException { StringWriter writer = new StringWriter(); schema.write(writer); StringReader reader = new StringReader(writer.toString()); try { return XMLUtils.toOM(reader); } catch (XMLStreamException e) { throw new DataRetrievalException( "Can't convert XmlSchema object to an OMElement", e); } } }
@Override public void write(StringBuilder sb) { for (XmlSchema xs : coll.getXmlSchemas()) { if (xs.getItems().isEmpty() || Constants.URI_2001_SCHEMA_XSD.equals(xs.getTargetNamespace())) { continue; } StringWriter writer = new StringWriter(); xs.write(writer); sb.append(writer.toString()); } } }
private OMNode convertToOM(XmlSchema schema) throws DataRetrievalException { StringWriter writer = new StringWriter(); schema.write(writer); StringReader reader = new StringReader(writer.toString()); try { return XMLUtils.toOM(reader); } catch (XMLStreamException e) { throw new DataRetrievalException( "Can't convert XmlSchema object to an OMElement", e); } } }
public void write(StringBuilder sb) { for (XmlSchema xs : coll.getXmlSchemas()) { if (xs.getItems().isEmpty() || WSDLConstants.NS_SCHEMA_XSD.equals(xs.getTargetNamespace())) { continue; } StringWriter writer = new StringWriter(); xs.write(writer); sb.append(writer.toString()); } } }
@Override public void write(StringBuilder sb) { for (XmlSchema xs : coll.getXmlSchemas()) { if (xs.getItems().isEmpty() || Constants.URI_2001_SCHEMA_XSD.equals(xs.getTargetNamespace())) { continue; } StringWriter writer = new StringWriter(); xs.write(writer); sb.append(writer.toString()); } } }
public String schemaToString(XmlSchema schema) throws UnsupportedEncodingException { ByteArrayOutputStream stream=new ByteArrayOutputStream(); schema.write(stream); return stream.toString(); }
public String readXMLfromSchemaFile(String path) throws Exception { InputStream is = new FileInputStream(path); XmlSchemaCollection schemaCol = new XmlSchemaCollection(); XmlSchema schema = schemaCol.read(new StreamSource(is)); ByteArrayOutputStream stream = new ByteArrayOutputStream(); schema.write(stream); is.close(); return stream.toString(); }
public String toXmlSchema() { if (getResolvedType() instanceof SchemaBasedResolvedType || getResolvedType() instanceof AnyResolvedType || getResolvedType() == null) { return null; } final TypeToXmlSchemaVisitor typeToXmlSchemaVisitor = new TypeToXmlSchemaVisitor(); typeToXmlSchemaVisitor.transform(rootElementName(), getResolvedType()); final XmlSchema schema = typeToXmlSchemaVisitor.getSchema(); final StringWriter writer = new StringWriter(); schema.write(writer); return writer.toString(); }
public String toXmlSchema() { if (getResolvedType() instanceof SchemaBasedResolvedType || getResolvedType() instanceof AnyResolvedType || getResolvedType() == null) { return null; } final TypeToXmlSchemaVisitor typeToXmlSchemaVisitor = new TypeToXmlSchemaVisitor(); typeToXmlSchemaVisitor.transform(rootElementName(), getResolvedType()); final XmlSchema schema = typeToXmlSchemaVisitor.getSchema(); final StringWriter writer = new StringWriter(); schema.write(writer); return writer.toString(); }