Class XSLTransformer

java.lang.Object
com.ptc.windchill.esi.lite.util.XSLTransformer

public class XSLTransformer extends Object
Utility class has methods for transforming XML using XSL.

Supported API: true
  • Field Details

    • XSL_PARAM_NAME_VALUE_SEPERATOR

      public static String XSL_PARAM_NAME_VALUE_SEPERATOR
      Separator for the name and value pair. Default value is "="

      Supported API: true
    • XSL_PARAM_SEPERATOR

      public static String XSL_PARAM_SEPERATOR
      Separator for parameters which are provided as name1=value1^name2=value2

      Supported API: true
  • Method Details

    • applyXSL

      public static String applyXSL(String inputXMLStr, StreamSource xslFileSource, String xslParams, String nameValseperator, String paramSeperator)
      Applies the XSL to XML contents considering parameters provided for method.

      Supported API: true
      Parameters:
      inputXMLStr - the XML string to which XSL style sheet need to be applied.
      xslFileSource - the xsl style sheet source file.
      xslParams - xsl parameters to be used while applying style sheet.
      nameValseperator - name value separator
      paramSeperator - parameter separator
      Returns:
      the transformed output.
    • applyXSL

      public static String applyXSL(String inputXMLStr, File xslFile, String xslParams, String nameValseperator, String paramSeperator)
      Applies the XSL to XML contents considering parameters provided for method.

      Supported API: true
      Parameters:
      inputXMLStr - the XML string to which XSL style sheet need to be applied.
      xslFile - the xsl style sheet source file.
      xslParams - xsl parameters to be used while applying style sheet.
      nameValseperator - name value separator
      paramSeperator - parameter separator
      Returns:
      the transformed output.
    • applyXSL

      public static String applyXSL(String inputXMLStr, String xslFileURL, String xslUsername, String xslPasswd, String xslParams, String nameValseperator, String paramSeperator)
      Applies the XSL to XML contents considering parameters provided for method.

      Supported API: true
      Parameters:
      inputXMLStr - the XML string to which XSL style sheet need to be applied.
      xslFileURL - the URL of xsl style sheet source file.
      xslUsername - the user name to access XSL URL.
      xslPasswd - the password to access XSL URL.
      xslParams - xsl parameters to be used while applying style sheet.
      nameValseperator - name value separator
      paramSeperator - parameter separator
      Returns:
      the transformed output.
    • applyXSL

      public static String applyXSL(String inputXMLStr, String xslFileURL)
      Applies the XSL to XML contents considering parameters provided for method.

      Supported API: true
      Parameters:
      inputXMLStr - the XML string to which XSL style sheet need to be applied.
      xslFileURL - the URL of xsl style sheet source file.
      Returns:
      the transformed output.
    • applyXSL

      public static String applyXSL(String inputXMLStr, String xslFileURL, String xslParams)
      Applies the XSL to XML contents considering parameters provided for method.

      Supported API: true
      Parameters:
      inputXMLStr - the XML string to which XSL style sheet need to be applied.
      xslFileURL - the URL of xsl style sheet source file.
      xslParams - xsl parameters to be used while applying style sheet.
      Returns:
      the transformed output.
    • applyXSL

      public static String applyXSL(String inputXMLStr, String xslFileURL, String xslUsername, String xslPasswd, String xslParams)
      Applies the XSL to XML contents considering parameters provided for method.

      Supported API: true
      Parameters:
      inputXMLStr - the XML string to which XSL style sheet need to be applied.
      xslFileURL - the URL of xsl style sheet source file.
      xslUsername - the user name to access XSL URL.
      xslPasswd - the password to access XSL URL.
      xslParams - xsl parameters to be used while applying style sheet.
      Returns:
      the transformed output.
    • applyXSL

      public static String applyXSL(String inputXMLStr, String xslFileURL, String xslUsername, String xslPasswd)
      Applies the XSL to XML contents considering parameters provided for method.

      Supported API: true
      Parameters:
      inputXMLStr - the XML string to which XSL style sheet need to be applied.
      xslFileURL - the URL of xsl style sheet source file.
      xslUsername - the user name to access XSL URL.
      xslPasswd - the password to access XSL URL.
      Returns:
      the transformed output.
    • addUserInfoToURL

      public static URL addUserInfoToURL(URL url, String userName, String password) throws MalformedURLException, URISyntaxException
      Adds the user information to URL.

      Supported API: true
      Parameters:
      url - the url to which user information needs to be added
      userName - the user name to be used to add user information to url
      password - the password to be used to add user information to url
      Returns:
      URL having user information
      Throws:
      MalformedURLException
      URISyntaxException
    • applyXSL

      public static String applyXSL(String inputXMLStr, File xslFile, String xslParams)
      Applies the XSL to XML contents considering parameters provided for method.

      Supported API: true
      Parameters:
      inputXMLStr - the XML string to which XSL style sheet need to be applied.
      xslFile - the xsl style sheet source file.
      xslParams - xsl parameters to be used while applying style sheet.
      Returns:
      the transformed output.
    • applyXSL

      public static String applyXSL(String inputXMLStr, File xslFile)
      Applies the XSL to XML contents considering parameters provided for method.

      Supported API: true
      Parameters:
      inputXMLStr - the XML string to which XSL style sheet need to be applied.
      xslFile - the xsl style sheet source file.
      Returns:
      the transformed output.