public void setLoadLineNumbers(boolean b) { if (b) super.setLoadLineNumbers(); else remove( LOAD_LINE_NUMBERS ); }
/** * If this option is set, line number annotations are placed * in the store when parsing a document. This is particularly * useful when you want {@link XmlError} objects to contain * line numbers. Use the option to load line numbers at the end of an element. * <br/>Example: xmlOptions.setLoadLineNumbers(XmlOptions.LOAD_LINE_NUMBERS_END_ELEMENT) * * @see XmlObject.Factory#parse(java.io.File, XmlOptions) * @see XmlError */ public XmlOptions setLoadLineNumbers (String option) { XmlOptions temp = setLoadLineNumbers(); temp = temp.set( option ); return temp; }
public static String xsd2inst(Reader[] schemaReaders, String rootName, Xsd2InstOptions options) { // Process Schema files List sdocs = new ArrayList(); for (int i = 0; i < schemaReaders.length; i++) { try { sdocs.add(XmlObject.Factory.parse(schemaReaders[i], (new XmlOptions()).setLoadLineNumbers().setLoadMessageDigest())); } catch (Exception e) { System.err.println("Can not load schema reader: " + i + " " + schemaReaders[i] + ": "); e.printStackTrace(); } } XmlObject[] schemas = (XmlObject[]) sdocs.toArray(new XmlObject[sdocs.size()]); return xsd2inst(schemas, rootName, options); }
public static String indent(String xmldoc) throws IOException, XmlException { StringWriter sw = new StringWriter(); XmlObject doc = XmlObject.Factory.parse(xmldoc, (new XmlOptions()).setLoadLineNumbers()); doc.save(sw, new XmlOptions().setSavePrettyPrint().setSavePrettyPrintIndent(DEFAULT_INDENT)); sw.close(); return sw.getBuffer().toString(); } }
schemaFiles[i], (new XmlOptions()).setLoadLineNumbers()));
try doc = XmlObject.Factory.parse(files[i], (new XmlOptions()).setLoadLineNumbers());
xobj = sLoader.parse( instances[i].newXMLStreamReader(), null, new XmlOptions().setLoadLineNumbers() );
final XmlOptions options = (new XmlOptions()).setLoadLineNumbers(); for (int i = 0; i < schemaFiles.length; i++) { try {
(new XmlOptions()).setLoadLineNumbers().setLoadMessageDigest()));
ltgOptions.setLoadSubstituteNamespaces(Collections.singletonMap("", "http://www.bea.com/2003/05/xmlbean/ltgfmt")); ltgOptions.setErrorListener(errors); ltgOptions.setLoadLineNumbers(); TestsDocument doc = TestsDocument.Factory.parse(ltgFile, ltgOptions); if (!doc.validate(ltgOptions))
schemaFiles[i], (new XmlOptions()).setLoadLineNumbers().setLoadMessageDigest())); sLoader.parse( instanceFiles[i], null, (new XmlOptions()).setLoadLineNumbers(XmlOptions.LOAD_LINE_NUMBERS_END_ELEMENT) );
options.setLoadLineNumbers(); options.setDocumentSourceName(absoluteURL); return loader.parse(reader, null, options); String encoding = source.getEncoding(); XmlOptions options = new XmlOptions(); options.setLoadLineNumbers(); options.setLoadMessageDigest(); options.setDocumentSourceName(absoluteURL); options.setLoadLineNumbers(); options.setLoadMessageDigest(); options.setDocumentSourceName(absoluteURL); options.setLoadLineNumbers(); options.setLoadMessageDigest(); URL urlDownload = new URL(absoluteURL);
try XmlObject schema = XmlObject.Factory.parse(testCase.getSchemaFile(), new XmlOptions().setErrorListener(errors).setLoadLineNumbers()); XmlObject schema2 = null; if (testCase.getResourceFile() != null) schema2 = XmlObject.Factory.parse(testCase.getResourceFile(), new XmlOptions().setErrorListener(errors).setLoadLineNumbers()); XmlObject[] schemas = schema2 == null ? new XmlObject[] { schema } : new XmlObject[] { schema, schema2 }; SchemaTypeSystem system = XmlBeans.compileXsd(schemas, XmlBeans.getBuiltinTypeSystem(), new XmlOptions().setErrorListener(errors)); XmlObject instance = loader.parse(testCase.getInstanceFile(), null, new XmlOptions().setErrorListener(errors).setLoadLineNumbers()); if (!instance.validate(new XmlOptions().setErrorListener(errors))) instanceValid = false;
options.setLoadLineNumbers(); options.setLoadMessageDigest(); options.setEntityResolver(entResolver); options.setLoadLineNumbers(); options.setLoadSubstituteNamespaces(Collections.singletonMap( "http://schemas.xmlsoap.org/wsdl/", "http://www.apache.org/internal/xmlbeans/wsdlsubst" options.setLoadLineNumbers(); options.setLoadSubstituteNamespaces(Collections.singletonMap("http://schemas.xmlsoap.org/wsdl/", "http://www.apache.org/internal/xmlbeans/wsdlsubst")); options.setEntityResolver(entResolver);
public void setLoadLineNumbers(boolean b) { if (b) super.setLoadLineNumbers(); else remove( LOAD_LINE_NUMBERS ); }
private XmlOptions createXmlOptions(Collection errors) { Map NAMESPACE_UPDATES = new HashMap(); NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/directory", "http://geronimo.apache.org/xml/ns/directory-1.0"); XmlOptions options = new XmlOptions(); options.setLoadLineNumbers(); options.setErrorListener(errors); options.setLoadSubstituteNamespaces(NAMESPACE_UPDATES); options.setUseDefaultNamespace(); return options; }
public static String indent(String xmldoc) throws IOException, XmlException { StringWriter sw = new StringWriter(); XmlObject doc = XmlObject.Factory.parse(xmldoc, (new XmlOptions()).setLoadLineNumbers()); doc.save(sw, new XmlOptions().setSavePrettyPrint().setSavePrettyPrintIndent(DEFAULT_INDENT)); sw.close(); return sw.getBuffer().toString(); } }
public static String indent(String xmldoc) throws IOException, XmlException { StringWriter sw = new StringWriter(); XmlObject doc = XmlObject.Factory.parse(xmldoc, (new XmlOptions()).setLoadLineNumbers()); doc.save(sw, new XmlOptions().setSavePrettyPrint().setSavePrettyPrintIndent(DEFAULT_INDENT)); sw.close(); return sw.getBuffer().toString(); } }
public static XmlOptions createXmlOptions(Collection errors) { XmlOptions options = new XmlOptions(); options.setLoadLineNumbers(); options.setErrorListener(errors); options.setLoadSubstituteNamespaces(NAMESPACE_UPDATES); return options; }
public static XmlOptions createXmlOptions(Collection errors) { XmlOptions options = new XmlOptions(); options.setLoadLineNumbers(); options.setErrorListener(errors); options.setLoadSubstituteNamespaces(NAMESPACE_UPDATES); return options; }