Using a PHP variable to filter XML
Posted: Wed Mar 01, 2006 11:59 am
Hello,
I have an issue that I cannot seem to resolve using XML and PHP.
Given:
The XML
http://www.aagrating.com/19space.xml
The XSL
http://www.aagrating.com/format.xsl
The CSS
http://www.aagrating.com/table.css
Given this setup I would like to be able to filter my data given a PHP variable (i.e. form submits, loads XML and filters based off of user input). I can use xpath to output the format to a table correctly, but when I attempt to set a variable for XPath it locks up.
the php script:
http://www.aagrating.com/xmlTest.txt
I have attempted to use "$myVar", '$myVar' " '+myVar+' ", but I cannot find the correct syntax. Is this even possible? Any thoughts?
Thanks in advance!
-thom
I have an issue that I cannot seem to resolve using XML and PHP.
Given:
The XML
http://www.aagrating.com/19space.xml
The XSL
http://www.aagrating.com/format.xsl
The CSS
http://www.aagrating.com/table.css
Given this setup I would like to be able to filter my data given a PHP variable (i.e. form submits, loads XML and filters based off of user input). I can use xpath to output the format to a table correctly, but when I attempt to set a variable for XPath it locks up.
the php script:
http://www.aagrating.com/xmlTest.txt
I have attempted to use "$myVar", '$myVar' " '+myVar+' ", but I cannot find the correct syntax. Is this even possible? Any thoughts?
Thanks in advance!
-thom