[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: configuration of xsl file
hola, there should be a way to solve your needs. for example: (php5) $xsl = new domDocument(); $xsl->load(DEFAULT_TEMPLATE_PATH . 'index.xsl'); $xml = new DomDocument(); $xml->load(DEFAULT_DATA_PATH . 'index.xml'); $xslt_proc = new xsltprocessor; $xslt_proc->importStylesheet($xsl); $xslt_proc->setParameter("", "default-data-path", DEFAULT_DATA_PATH); $xslt_proc->setParameter("", "default-template-path", DEFAULT_TEMPLATE_PATH); $html = $xslt_proc->transformToXml($xml); you see: $xslt_proc->setParameter() tells your processor to give the variable 'default-data-path' with the value of the constant DEFAULT_DATA_PATH to the xslt-file, which follows immediately -> <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> .... <xsl:param name="default-data-path"/> <xsl:param name="default-template-path"/> <xsl:template match="/"> <xsl:value-of select="$default-data-path"/> <xsl:value-of select="$default-template-path"/> </xsl:template> ... </xsl:stylesheet> ----- Original Message ----- From: "nick tsirakis" <tsirman@h...> To: <xml-dev@l...> Sent: Friday, April 30, 2004 10:59 AM Subject: configuration of xsl file > > > hello can i put in an xsl file variables from php??? > well i have 15 xsl files which have many "<a href.........." with the url of > the project. so if i want to make my project portable i must have a config > file in php probably and there put the full url of my project and not edit > every time all the 15 xsl files.... > > _________________________________________________________________ > STOP MORE SPAM with the new MSN 8 and get 2 months FREE* > http://join.msn.com/?page=features/junkmail > > > ----------------------------------------------------------------- > The xml-dev list is sponsored by XML.org <http://www.xml.org>, an > initiative of OASIS <http://www.oasis-open.org> > > The list archives are at http://lists.xml.org/archives/xml-dev/ > > To subscribe or unsubscribe from this list use the subscription > manager: <http://www.oasis-open.org/mlmanage/index.php> >
|
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
|