[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

Subject: Re: roblems with passing variables from PHP to XSLT
From: "Alexander Johannesen" <alexander.johannesen@xxxxxxxxx>
Date: Tue, 6 Jun 2006 22:49:24 +1000
php pass
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 );

If you want to pass in a parameter as your headline reads, see last comment on this page ;

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/ __________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.