{
    "mode": "perldoc",
    "parameter": "XML::XSLT",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/XML%3A%3AXSLT/json",
    "generated": "2026-06-11T17:59:36Z",
    "synopsis": "use XML::XSLT;\nmy $xslt = XML::XSLT->new ($xsl, warnings => 1);\n$xslt->transform ($xmlfile);\nprint $xslt->toString;\n$xslt->dispose();",
    "sections": {
        "NAME": {
            "content": "XML::XSLT - A perl module for processing XSLT\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use XML::XSLT;\n\nmy $xslt = XML::XSLT->new ($xsl, warnings => 1);\n\n$xslt->transform ($xmlfile);\nprint $xslt->toString;\n\n$xslt->dispose();\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module implements the W3C's XSLT specification. The goal is full implementation of this\nspec, but we have not yet achieved that. However, it already works well. See \"XML::XSLT\nCommands\" for the current status of each command.\n\nXML::XSLT makes use of XML::DOM and LWP::Simple, while XML::DOM uses XML::Parser. Therefore\nXML::Parser, XML::DOM and LWP::Simple have to be installed properly for XML::XSLT to run.\n",
            "subsections": []
        },
        "Specifying Sources": {
            "content": "The stylesheets and the documents may be passed as filenames, file handles regular strings,\nstring references or DOM-trees. Functions that require sources (e.g. new), will accept either a\nnamed parameter or simply the argument.\n\nEither of the following are allowed:\n\nmy $xslt = XML::XSLT->new($xsl);\nmy $xslt = XML::XSLT->new(Source => $xsl);\n\nIn documentation, the named parameter `Source' is always shown, but it is never required.\n\nMETHODS",
            "subsections": [
                {
                    "name": "new",
                    "content": "Returns a new XSLT parser object. Valid flags are:\n\nDOMparserargs\nHashref of arguments to pass to the XML::DOM::Parser object's parse method.\n\nvariables\nHashref of variables and their values for the stylesheet.\n\nbase\nBase of URL for file inclusion.\n\ndebug\nTurn on debugging messages.\n\nwarnings\nTurn on warning messages.\n\nindent\nStarting amount of indention for debug messages. Defaults to 0.\n\nindentincr\nAmount to indent each level of debug message. Defaults to 1.\n"
                },
                {
                    "name": "open_xml",
                    "content": "Gives the XSLT object new XML to process. Returns an XML::DOM object corresponding to the\nXML.\n\nbase\nThe base URL to use for opening documents.\n\nparserargs\nArguments to pase to the parser.\n"
                },
                {
                    "name": "open_xsl",
                    "content": "Gives the XSLT object a new stylesheet to use in processing XML. Returns an XML::DOM object\ncorresponding to the stylesheet. Any arguments present are passed to the XML::DOM::Parser.\n\nbase\nThe base URL to use for opening documents.\n\nparserargs\nArguments to pase to the parser.\n"
                },
                {
                    "name": "process",
                    "content": "Processes the previously loaded XML through the stylesheet using the variables set in the\nargument.\n"
                },
                {
                    "name": "transform",
                    "content": "Processes the given XML through the stylesheet. Returns an XML::DOM object corresponding to\nthe transformed XML. Any arguments present are passed to the XML::DOM::Parser.\n"
                },
                {
                    "name": "serve",
                    "content": "Processes the given XML through the stylesheet. Returns a string containing the result.\nExample:\n\nuse XML::XSLT qw(serve);\n\n$xslt = XML::XSLT->new($xsl);\nprint $xslt->serve $xml;\n\nhttpheaders\nIf true, then prepends the appropriate HTTP headers (e.g. Content-Type, Content-Length);\n\nDefaults to true.\n\nxmldeclaration\nIf true, then the result contains the appropriate <?xml?> header.\n\nDefaults to true.\n\nxmlversion\nThe version of the XML.\n\nDefaults to 1.0.\n\ndoctype\nThe type of DOCTYPE this document is. Defaults to SYSTEM.\n\nxsloutputmethod\nGet or set the <xsl:output method= attribute. Valid arguments are 'html', 'text' and 'xml'\n\ntoString\nReturns the result of transforming the XML with the stylesheet as a string.\n\ntodom\nReturns the result of transforming the XML with the stylesheet as an XML::DOM object.\n\nmediatype\nReturns the media type (aka mime type) of the object.\n\ndispose\nExecutes the \"dispose\" method on each XML::DOM object.\n\nXML::XSLT Commands\nxsl:apply-imports no\nNot supported yet.\n\nxsl:apply-templates limited\nAttribute 'select' is supported to the same extent as xsl:value-of supports path selections.\n\nNot supported yet: - attribute 'mode' - xsl:sort and xsl:with-param in content\n\nxsl:attribute partially\nAdds an attribute named to the value of the attribute 'name' and as value the stringified\ncontent-template.\n\nNot supported yet: - attribute 'namespace'\n\nxsl:attribute-set yes\nPartially\n\nxsl:call-template yes\nTakes attribute 'name' which selects xsl:template's by name.\n\nWeak support: - xsl:with-param (select attrib not supported)\n\nNot supported yet: - xsl:sort\n\nxsl:choose yes\nTests sequentially all xsl:whens until one succeeds or until an xsl:otherwise is found.\nLimited test support, see xsl:when\n\nxsl:comment yes\nSupported.\n\nxsl:copy partially\nxsl:copy-of limited\nAttribute 'select' functions as well as with xsl:value-of\n\nxsl:decimal-format no\nNot supported yet.\n\nxsl:element yes\nxsl:fallback no\nNot supported yet.\n\nxsl:for-each limited\nAttribute 'select' functions as well as with xsl:value-of\n\nNot supported yet: - xsl:sort in content\n\nxsl:if limited\nIdentical to xsl:when, but outside xsl:choose context.\n\nxsl:import no\nNot supported yet.\n\nxsl:include yes\nTakes attribute href, which can be relative-local, absolute-local as well as an URL\n(preceded by identifier http:).\n\nxsl:key no\nNot supported yet.\n\nxsl:message no\nNot supported yet.\n\nxsl:namespace-alias no\nNot supported yet.\n\nxsl:number no\nNot supported yet.\n\nxsl:otherwise yes\nSupported.\n\nxsl:output limited\nOnly the initial xsl:output element is used. The \"text\" output method is not supported, but\nshouldn't be difficult to implement. Only the \"doctype-public\", \"doctype-system\",\n\"omit-xml-declaration\", \"method\", and \"encoding\" attributes have any support.\n\nxsl:param experimental\nSynonym for xsl:variable (currently). See xsl:variable for support.\n\nxsl:preserve-space no\nNot supported yet. Whitespace is always preserved.\n\nxsl:processing-instruction yes\nSupported.\n\nxsl:sort no\nNot supported yet.\n\nxsl:strip-space no\nNot supported yet. No whitespace is stripped.\n\nxsl:stylesheet limited\nMinor namespace support: other namespace than 'xsl:' for xsl-commands is allowed if\nxmlns-attribute is present. xmlns URL is verified. Other attributes are ignored.\n\nxsl:template limited\nAttribute 'name' and 'match' are supported to minor extend. ('name' must match exactly and\n'match' must match with full path or no path)\n\nNot supported yet: - attributes 'priority' and 'mode'\n\nxsl:text yes\nSupported.\n\nxsl:transform limited\nSynonym for xsl:stylesheet\n\nxsl:value-of limited\nInserts attribute or element values. Limited support:\n\n<xsl:value-of select=\".\"/>\n\n<xsl:value-of select=\"/root-elem\"/>\n\n<xsl:value-of select=\"elem\"/>\n\n<xsl:value-of select=\"//elem\"/>\n\n<xsl:value-of select=\"elem[n]\"/>\n\n<xsl:value-of select=\"//elem[n]\"/>\n\n<xsl:value-of select=\"@attr\"/>\n\n<xsl:value-of select=\"text()\"/>\n\n<xsl:value-of select=\"processing-instruction()\"/>\n\n<xsl:value-of select=\"comment()\"/>\n\nand combinations of these.\n\nNot supported yet: - attribute 'disable-output-escaping'\n\nxsl:variable partial or from literal text in the stylesheet.\nxsl:when limited\nOnly inside xsl:choose. Limited test support:\n\n<xsl:when test=\"@attr='value'\">\n\n<xsl:when test=\"elem='value'\">\n\n<xsl:when test=\"path/[@attr='value']\">\n\n<xsl:when test=\"path/[elem='value']\">\n\n<xsl:when test=\"path\">\n\npath is supported to the same extend as with xsl:value-of\n\nxsl:with-param experimental\nIt is currently not functioning. (or is it?)\n"
                }
            ]
        },
        "SUPPORT": {
            "content": "General information, bug reporting tools, the latest version, mailing lists, etc. can be found\nat the XML::XSLT homepage:\n\nhttp://xmlxslt.sourceforge.net/\n",
            "subsections": []
        },
        "DEPRECATIONS": {
            "content": "Methods and interfaces from previous versions that are not documented in this version are\ndeprecated. Each of these deprecations can still be used but will produce a warning when the\ndeprecation is first used. You can use the old interfaces without warnings by passing \"new()\"\nthe flag \"usedeprecated\". Example:\n\n$parser = XML::XSLT->new($xsl, \"FILE\",\nusedeprecated => 1);\n\nThe deprecated methods will disappear by the time a 1.0 release is made.\n\nThe deprecated methods are :\n\noutputstring\nuse toString instead\n\nresultstring\nuse toString instead\n\noutput\nuse toString instead\n\nresult\nuse toString instead\n\nresultmimetype\nuse mediatype instead\n\noutputmimetype\nuse mediatype instead\n\nresulttree\nuse todom instead\n\noutputtree\nuse todom instead\n\ntransformdocument\nuse transform instead\n\nprocessproject\nuse process instead\n\nopenproject\nuse \"Source\" argument to new() and transform instead.\n\nprintoutput\nuse serve() instead.\n",
            "subsections": []
        },
        "BUGS": {
            "content": "Yes.\n",
            "subsections": []
        },
        "HISTORY": {
            "content": "Geert Josten and Egon Willighagen developed and maintained XML::XSLT up to version 0.22. At that\npoint, Mark Hershberger started moving the project to Sourceforge and began working on it with\nBron Gondwana.\n",
            "subsections": []
        },
        "LICENCE": {
            "content": "Copyright (c) 1999 Geert Josten & Egon Willighagen. All Rights Reserved. This module is free\nsoftware, and may be distributed under the same terms and conditions as Perl.\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Geert Josten <gjosten@sci.kun.nl>\n\nEgon Willighagen <egonw@sci.kun.nl>\n\nMark A. Hershberger <mah@everybody.org>\n\nBron Gondwana <perlcode@brong.net>\n\nJonathan Stowe <jns@gellyfish.com>\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "XML::DOM, LWP::Simple, XML::Parser\n",
            "subsections": []
        }
    },
    "summary": "XML::XSLT - A perl module for processing XSLT",
    "flags": [],
    "examples": [],
    "see_also": []
}