static @NonNull DOMSource transformSource(final Source source) throws TransformerException { final DOMResult result = new DOMResult(); TRANSFORMER_FACTORY.newTransformer().transform(source, result); return new DOMSource(result.getNode(), result.getSystemId()); }
static @NonNull DOMSource transformSource(final Source source) throws TransformerException { final DOMResult result = new DOMResult(); TRANSFORMER_FACTORY.newTransformer().transform(source, result); return new DOMSource(result.getNode(), result.getSystemId()); }
@Override public Result createOutput(String ns, String file) throws IOException { DOMResult result = new DOMResult(); if (builtIns.containsKey(ns)) { DOMResult dr = builtIns.get(ns); result.setSystemId(dr.getSystemId()); results.add(dr); return result; } result.setSystemId(file); results.add(result); return result; } });
@Override public Result createOutput(String ns, String file) throws IOException { DOMResult result = new DOMResult(); if (builtIns.containsKey(ns)) { DOMResult dr = builtIns.get(ns); result.setSystemId(dr.getSystemId()); results.add(dr); return result; } result.setSystemId(file); results.add(result); return result; } });
@Override public Result createOutput(String ns, String file) throws IOException { DOMResult result = new DOMResult(); if (builtIns.containsKey(ns)) { DOMResult dr = builtIns.get(ns); result.setSystemId(dr.getSystemId()); results.add(dr); return result; } result.setSystemId(file); results.add(result); return result; } });
@Override public Result createOutput(String ns, String file) throws IOException { DOMResult result = new DOMResult(); if (builtIns.containsKey(ns)) { DOMResult dr = builtIns.get(ns); result.setSystemId(dr.getSystemId()); results.add(dr); return result; } result.setSystemId(file); results.add(result); return result; } });
@Override public Result createOutput(String ns, String file) throws IOException { DOMResult result = new DOMResult(); if (builtIns.containsKey(ns)) { DOMResult dr = builtIns.get(ns); result.setSystemId(dr.getSystemId()); results.add(dr); return result; } result.setSystemId(file); results.add(result); return result; } });
private void generateSchemas(List<XSDefinition> definitions, XSDFactory factory, JAXBContext context) throws IOException { DOMResolverImpl resolver = new DOMResolverImpl(); context.generateSchema(resolver); Map<String, DOMResult> results = resolver.getResults(); for (Map.Entry<String, DOMResult> entry : results.entrySet()) { XSDefinition definition = factory.createXSDefinition(); definition.setUnresolved(true); definition.setDocument((Document)entry.getValue().getNode()); definition.setNamespace(entry.getKey()); URI location = null; try { location = new URI(entry.getValue().getSystemId()); } catch (URISyntaxException e) { // ignore: use null value } definition.setLocation(location); definitions.add(definition); } }
private void generateSchemas(List<XSDefinition> definitions, XSDFactory factory, JAXBContext context) throws IOException { DOMResolverImpl resolver = new DOMResolverImpl(); context.generateSchema(resolver); Map<String, DOMResult> results = resolver.getResults(); for (Map.Entry<String, DOMResult> entry : results.entrySet()) { XSDefinition definition = factory.createXSDefinition(); definition.setUnresolved(true); definition.setDocument((Document)entry.getValue().getNode()); definition.setNamespace(entry.getKey()); URI location = null; try { location = new URI(entry.getValue().getSystemId()); } catch (URISyntaxException e) { // ignore: use null value } definition.setLocation(location); definitions.add(definition); } }
DOMSource source = new DOMSource(doc, r.getSystemId()); schemas.add(source); if (!StringUtils.isEmpty(tns)) {
DOMSource source = new DOMSource(doc, r.getSystemId()); schemas.add(source); if (!StringUtils.isEmpty(tns)) {
return results.get(0).getSystemId();
DOMSource source = new DOMSource(doc, r.getSystemId()); schemas.add(source); if (!StringUtils.isEmpty(tns)) {
Source domSource = new DOMSource(domResult.getNode(), domResult.getSystemId()); Result result = new StreamResult(out); xformer.transform(domSource, result);
try { for (DOMResult r : generateJaxbSchemas()) { DOMSource src = new DOMSource(r.getNode(), r.getSystemId()); if (BUILT_IN_SCHEMAS.containsValue(r)) { bi.add(src);