[thelist] $_POST in xslt?

Chris Price chris.price at choctaw.co.uk
Fri May 3 07:38:32 CDT 2013

This may not be the most efficient way to fulfil the task at hand but its
part of an overall solution I'm developing using xml and xslt to present

I'm populating a form from xml. When that form is submitted I want the
webmaster to recieve the list of questions (<label for='label'>) with their
respective answers (values). Because I can't predict what is posted via the
form I'm using regex to replace the form element name with its posted value.

I have the xsl similar to:
<xsl:value-of select="@label"/>: <xsl:value-of select="@name"/>

The output will therefore be in the form:
Label: name
Label: name

I'm then using regex to pull in $_POST[name]:

$text = self::xmlTransform([xsl file],[xml file]);
$output = preg_replace('/****/e','$_POST[$1]',$text);

What I want to know is: Can I pull $_POST data into the xsl file so that I
don't need to use regex. I only know how to pull in static variables at the
moment. I keep reading about using xsl v.2 but haven't found any reference
to how I would do it.

As a side note, why is xsl v.1 so prevalent when xsl v.2 has been around
for so long?


Kind Regards

@Choctaw.co.uk <http://%5C%5Cchoctaw.co.uk/>
0777 629 0227

Design is my native language

Choctaw Media Ltd is a company registered in England and Wales (04627649)

More information about the thelist mailing list