[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: roblems with passing variables from PHP to XSLT
Hi,
On 6/6/06, tech@xxxxxxxxxxxxxxxx <tech@xxxxxxxxxxxxxxxx> wrote: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:php="http://php.net/xsl"> Looks like you haven't got a match for XMLData, the root node, so add ; <xsl:template match="XMLData"> <xsl:apply-templates /> </xsl:template> $domTranObj = $domXsltObj->process( $domXmlObj );
http://au3.php.net/manual/en/function.domxsltstylesheet-process.php Also, to tell the XSLT processor that you've got an incoming parameter, at the top add ; <xsl:param name="code" /> In your template (in the match='XMLData') you can now do ; <xsl:apply-template select="IATA[@code=$code]/ProductItem" /> and instead of ; <xsl:template match="IATA[@code='PEN']/ProductItem"> change your match on your template to simply ; <xsl:template match="ProductItem"> As to the accuracy of this, I think we need some more info on what you're trying to do. Your XSLT stylesheet is hopelessly static, meaning you're trying to match stuff on data you know about, but from the context of the subject it looks like you want to create a generic stylesheet, which is what I'm explaining. Anyways, let me know if any of this made any sense. Regards, Alex -- "Ultimately, all things are known because you want to believe you know." - Frank Herbert __ http://shelter.nu/ __________________________________________________
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|