OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] configuration of xsl file

[ Lists Home | Date Index | Thread Index ]

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@hotmail.com>
To: <xml-dev@lists.xml.org>
Sent: Friday, April 30, 2004 10:59 AM
Subject: [xml-dev] 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>
>





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS