xsltProcessor setParameter : send an undefined number of params

前端 未结 3 1876
眼角桃花
眼角桃花 2021-01-23 04:24

I have an XSL file.

I have a PHP file with a XSLTProcessor named $bob.

I want to send to my xsl transformation some parameters.

So, I write

3条回答
  •  北海茫月
    2021-01-23 04:53

    I would just have one parameter, that is an XML document. I would create this XML document before I invoke the transformation.

    This has some definit benefits compared to sending a single, pipe-delimited string:

    1. Every parameter is in its own element and this can be matched by a separate template in XSLT.

    2. No recursive processing of a pipe-delimited string and no extension functions are needed.

    3. More extensible and scalable.

提交回复
热议问题