[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: configuration of xsl file


xslt_proc
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!

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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.