xslt

XSLTUtil

class ORSServiceClass.xslt.xsltutil.XSLTUtil
CLEANUP_TEMPORARY_FILES = True
classmethod extractXSLTTitleFromFile(xsltPath)

Looking for the XSLT title in the file

Parameters:xsltPath (str) – an XSLT path
Returns:output (str) – XSLT title
classmethod extractXSLTUUIDFromFile(xsltPath)

Looking for the XSLT UUID in the file

Parameters:xsltPath (str) – an XSLT path
Returns:output (str) – XSLT UUID
classmethod generateMergedXMLs(inputXMLFilenames, outputFilename)

Generates a XML document from the XML input data with the same format as the one that would be sent to an XSL transformation. This may be used when developing an XSL file.

Parameters:
  • inputXMLFilenames (file) [count=[1, None]] – input XML data filenames
  • outputFilename (file saving) – merged XML filename
classmethod generatePDFFromXML(inputXMLFilenames, xsltUUID, outputFilename, saveTEXFile=False, showMessageBoxIfSuccessful=True, showMessageBoxIfFailed=True)

Generates a PDF document from the XML input data and XSLT transformation

Parameters:
  • inputXMLFilenames (file) [count=[1, None]] – input XML data filenames
  • xsltUUID (str) – unique identifier (UUID) of the XSLT stylesheet
  • outputFilename (file saving) – report (PDF) filename
  • saveTEXFile (bool) – if True, the .tex file will be saved in the same folder as the pdf output document; if False, that file will not be kept
  • showMessageBoxIfSuccessful (bool) – if True, a message box showing that the report generation has been completed with success will be shown; if False, no such message box will be shown. Will be considered only if the report generation is completed with success.
  • showMessageBoxIfFailed (bool) – if True, a message box showing that the report generation has failed will be shown; if False, no such message box will be shown. Will be considered only if the report generation failed.
classmethod getAllXSLTTitlesUUIDsAndPaths(keepOnlyValidFiles=True)

Gets the titles and UUIDs and the associated paths of all XSLT files.

Returns:output (list of tuples) – list of tuples: (title, UUID, xsltPath) of every XSLT file found
classmethod getAvailableXSLTTitlesAndUUIDs(inputDataFilenames)

Gets the available XSLT titles and UUIDs for the provided input data

Parameters:inputDataFilenames (list of file) – input data filenames
Returns:output (list of tuples) – list of tuples: (title, UUIDs) of the XSLT files supporting the input data
classmethod getXSLTPathForUUID(xsltUUID)

Gets the path of the XSLT file matching with the UUID

Parameters:xsltUUID (str) – a XSLT UUID
Returns:output (str) – an XSLT file path, or None if no match is found
classmethod getXSLTTitleForUUID(xsltUUID)

Gets the title of the XSLT file matching with the UUID

Parameters:xsltUUID (str) – a XSLT UUID
Returns:output (str) – XSLT title, or None if no match is found
classmethod isXSLTransformationSupported(inputDataFilenames, xsltUUID)
classmethod isXSLTransformationSupportedSpecificPluginResults(setOfPluginResults, xsltUUID)
namespacesXSLT = {'ors': 'http://theobjects.com', 'xsl': 'http://www.w3.org/1999/XSL/Transform'}
classmethod updateBibliographyFromXSLTUUID(bibliography, xsltUUID)

Updates a bibliography from the data contained in a XSLT file

Parameters:
  • bibliography (ORSServiceClass.socketbibliography.socketbibliography.SocketBibliography) – a bibliography model
  • xsltUUID (str) – an XSLT UUID