- static String writeCompNodeWithSchemaContextToJson(CompositeNode compositeNode, String outputPath,
- Set<Module> modules, DataSchemaNode dataSchemaNode) throws IOException, WebApplicationException {
- String jsonResult;
-
- assertNotNull(dataSchemaNode);
- assertNotNull("Composite node can't be null", compositeNode);
- ByteArrayOutputStream byteArrayOS = new ByteArrayOutputStream();
-
- ControllerContext contContext = ControllerContext.getInstance();
- contContext.setSchemas(loadSchemaContext(modules));
-
- StructuredDataToJsonProvider structuredDataToJsonProvider = StructuredDataToJsonProvider.INSTANCE;
- structuredDataToJsonProvider.writeTo(new StructuredData(compositeNode, dataSchemaNode), null, null, null, null,
- null, byteArrayOS);
-
- jsonResult = byteArrayOS.toString();
- if (outputPath != null) {
- try {
- outputToFile(byteArrayOS, outputPath);
- } catch (IOException e) {
- System.out.println("Output file wasn't cloased sucessfuly.");
+ public static QName buildQName(String name, String uri, String date, String prefix) {
+ try {
+ URI u = new URI(uri);
+ Date dt = null;
+ if (date != null) {
+ dt = Date.valueOf(date);