@Test public void applyXslTransformationSuccess() { Map<String, String> result = applyXslTransformation.applyXslTransformation( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<map>\n" + " <entry key=\"key1\" value=\"value1\" />\n" + " <entry key=\"key2\" />\n" + "</map>", "<?xml version=\"1.0\"?>\n" + "<xsl:stylesheet xmlns:xsl=\"http: " <xsl:output method=\"html\" indent=\"yes\"/>\n" + "\n" + "<xsl:template match=\"map\">\n" + "<HTML>\n" + "<HEAD>\n" + "<TITLE>Map</TITLE>\n" + "</HEAD>\n" + "<BODY>\n" + " <xsl:apply-templates/>\n" + "</BODY>\n" + "</HTML>\n" + "</xsl:template>\n" + "\n" + "\n" + "<xsl:template match=\"entry\">\n" + " <xsl:value-of select=\"@key\"/>=<xsl:value-of select=\"@value\"/>\n" + " <br></br>\n" + "</xsl:template>\n" + "\n" + "\n" + "</xsl:stylesheet>", "", "" ); assertNotNull(result); assertNotNull(result.get(RETURN_RESULT)); assertEquals(result.get(RETURN_CODE), SUCCESS); assertEquals(result.get(RETURN_RESULT), resultHtml); }
@Action(name = "Apply XSL Transformation", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(EXCEPTION) }, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = ReturnCodes.SUCCESS, matchType = MatchType.COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = ReturnCodes.FAILURE, matchType = MatchType.COMPARE_EQUAL, isDefault = true, isOnFail = true) }) public Map<String, String> applyXslTransformation( @Param(value = XML_DOCUMENT) String xmlDocument, @Param(value = XSL_TEMPLATE, required = true) String xslTemplate, @Param(value = Constants.Inputs.OUTPUT_FILE) String outputFile, @Param(value = Constants.Inputs.FEATURES) String parsingFeatures) { try { final ApplyXslTransformationInputs applyXslTransformationInputs = new ApplyXslTransformationInputs.ApplyXslTransformationInputsBuilder() .withXmlDocument(xmlDocument) .withXslTemplate(xslTemplate) .withOutputFile(outputFile) .withParsingFeatures(parsingFeatures) .build(); return new ApplyXslTransformationService().execute(applyXslTransformationInputs); } catch (Exception e) { return OutputUtilities.getFailureResultsMap(e); } }
ApplyXslTransformation { @Action(name = "Apply XSL Transformation", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(EXCEPTION) }, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = ReturnCodes.SUCCESS, matchType = MatchType.COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = ReturnCodes.FAILURE, matchType = MatchType.COMPARE_EQUAL, isDefault = true, isOnFail = true) }) public Map<String, String> applyXslTransformation( @Param(value = XML_DOCUMENT) String xmlDocument, @Param(value = XSL_TEMPLATE, required = true) String xslTemplate, @Param(value = Constants.Inputs.OUTPUT_FILE) String outputFile, @Param(value = Constants.Inputs.FEATURES) String parsingFeatures) { try { final ApplyXslTransformationInputs applyXslTransformationInputs = new ApplyXslTransformationInputs.ApplyXslTransformationInputsBuilder() .withXmlDocument(xmlDocument) .withXslTemplate(xslTemplate) .withOutputFile(outputFile) .withParsingFeatures(parsingFeatures) .build(); return new ApplyXslTransformationService().execute(applyXslTransformationInputs); } catch (Exception e) { return OutputUtilities.getFailureResultsMap(e); } } }
ApplyXslTransformation { @Action(name = "Apply XSL Transformation", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(EXCEPTION) }, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = ReturnCodes.SUCCESS, matchType = MatchType.COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = ReturnCodes.FAILURE, matchType = MatchType.COMPARE_EQUAL, isDefault = true, isOnFail = true) }) public Map<String, String> applyXslTransformation( @Param(value = XML_DOCUMENT) String xmlDocument, @Param(value = XSL_TEMPLATE, required = true) String xslTemplate, @Param(value = Constants.Inputs.OUTPUT_FILE) String outputFile, @Param(value = Constants.Inputs.FEATURES) String parsingFeatures) { try { final ApplyXslTransformationInputs applyXslTransformationInputs = new ApplyXslTransformationInputs.ApplyXslTransformationInputsBuilder() .withXmlDocument(xmlDocument) .withXslTemplate(xslTemplate) .withOutputFile(outputFile) .withParsingFeatures(parsingFeatures) .build(); return new ApplyXslTransformationService().execute(applyXslTransformationInputs); } catch (Exception e) { return OutputUtilities.getFailureResultsMap(e); } }  }
ApplyXslTransformation { @Action(name = "Apply XSL Transformation", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(EXCEPTION) }, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = ReturnCodes.SUCCESS, matchType = MatchType.COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = ReturnCodes.FAILURE, matchType = MatchType.COMPARE_EQUAL, isDefault = true, isOnFail = true) }) public Map<String, String> applyXslTransformation( @Param(value = XML_DOCUMENT) String xmlDocument, @Param(value = XSL_TEMPLATE, required = true) String xslTemplate, @Param(value = Constants.Inputs.OUTPUT_FILE) String outputFile, @Param(value = Constants.Inputs.FEATURES) String parsingFeatures) { try { final ApplyXslTransformationInputs applyXslTransformationInputs = new ApplyXslTransformationInputs.ApplyXslTransformationInputsBuilder() .withXmlDocument(xmlDocument) .withXslTemplate(xslTemplate) .withOutputFile(outputFile) .withParsingFeatures(parsingFeatures) .build(); return new ApplyXslTransformationService().execute(applyXslTransformationInputs); } catch (Exception e) { return OutputUtilities.getFailureResultsMap(e); } }  @Action(name = "Apply XSL Transformation", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(EXCEPTION) }, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = ReturnCodes.SUCCESS, matchType = MatchType.COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = ReturnCodes.FAILURE, matchType = MatchType.COMPARE_EQUAL, isDefault = true, isOnFail = true) }) Map<String, String> applyXslTransformation(
            @Param(value = XML_DOCUMENT) String xmlDocument,
            @Param(value = XSL_TEMPLATE, required = true) String xslTemplate,
            @Param(value = Constants.Inputs.OUTPUT_FILE) String outputFile,
            @Param(value = Constants.Inputs.FEATURES) String parsingFeatures); }
ApplyXslTransformation { @Action(name = "Apply XSL Transformation", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(EXCEPTION) }, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = ReturnCodes.SUCCESS, matchType = MatchType.COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = ReturnCodes.FAILURE, matchType = MatchType.COMPARE_EQUAL, isDefault = true, isOnFail = true) }) public Map<String, String> applyXslTransformation( @Param(value = XML_DOCUMENT) String xmlDocument, @Param(value = XSL_TEMPLATE, required = true) String xslTemplate, @Param(value = Constants.Inputs.OUTPUT_FILE) String outputFile, @Param(value = Constants.Inputs.FEATURES) String parsingFeatures) { try { final ApplyXslTransformationInputs applyXslTransformationInputs = new ApplyXslTransformationInputs.ApplyXslTransformationInputsBuilder() .withXmlDocument(xmlDocument) .withXslTemplate(xslTemplate) .withOutputFile(outputFile) .withParsingFeatures(parsingFeatures) .build(); return new ApplyXslTransformationService().execute(applyXslTransformationInputs); } catch (Exception e) { return OutputUtilities.getFailureResultsMap(e); } }  @Action(name = "Apply XSL Transformation", outputs = { @Output(RETURN_CODE), @Output(RETURN_RESULT), @Output(EXCEPTION) }, responses = { @Response(text = ResponseNames.SUCCESS, field = RETURN_CODE, value = ReturnCodes.SUCCESS, matchType = MatchType.COMPARE_EQUAL), @Response(text = ResponseNames.FAILURE, field = RETURN_CODE, value = ReturnCodes.FAILURE, matchType = MatchType.COMPARE_EQUAL, isDefault = true, isOnFail = true) }) Map<String, String> applyXslTransformation(
            @Param(value = XML_DOCUMENT) String xmlDocument,
            @Param(value = XSL_TEMPLATE, required = true) String xslTemplate,
            @Param(value = Constants.Inputs.OUTPUT_FILE) String outputFile,
            @Param(value = Constants.Inputs.FEATURES) String parsingFeatures);  }