Da traduttori professionisti, imprese, pagine web e archivi di traduzione disponibili gratuitamente al pubblico.
예 2. using the xslt_process() to transform an xml file and a xsl file to a variable containing the resulting xml data
the above two cases are the two simplest cases there are when it comes to xslt transformation and i'd dare say that they are the most common cases, however, sometimes you get your xml and xslt code from external sources, such as a database or a socket. in these cases you'll have the xml and/or xslt data in a variable -- and in production applications the overhead of dumping these to file may be too much. this is where xslt's "argument" syntax, comes to the rescue. instead of files as the xml and xslt arguments to the xslt_process() function, you can specify "argument place holders" which are then subsituted by values given in the arguments array (5th parameter to the xslt_process() function). the following is an example of processing xml and xslt into a result variable without the use of files at all.
finally, the last argument to the xslt_process() function represents an array for any top-level parameters that you want to pass to the xslt document. these parameters can then be accessed within your xsl files using the xsl:param name="parameter_name" instruction. the parameters must be utf-8 encoded and their values will be interpreted as strings by the sablotron processor. in other words - you cannot pass node-sets as parameters to the xslt document.
蛁: please note that file:// is needed in front of path if you use windows.