How to change output method dynamically?

This is a discussion on How to change output method dynamically? within the PHP Language forums, part of the PHP Programming Forums category; Hi all, I can't find anything about this in the PHP manual or on Google, so I'm hoping ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-07-2008
l0b0
 
Posts: n/a
Default How to change output method dynamically?

Hi all,

I can't find anything about this in the PHP manual or on Google, so
I'm hoping you'll be able to help.

The situation is that I'm already using plenty of xsl:param elements
which are given data from PHP, as such:

$arguments['/_xml'] = xslt_process(
$xh
,'arg:/_xml'
,'arg:/_xsl'
,NULL
,$arguments
,array(
'method' =>
xml_entity_encode('html')
,'encoding' =>
xml_entity_encode('UTF-8')
)
);

<xsl:stylesheet
version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>

<xsl:param name="method"/>
<xsl:param name="encoding"/>

Now, I'd like to feed these values to the xsl:output attributes, not
in the resulting markup. How can I do that (preferably without another
stylesheet)? The following doesn't work in PHP4:

<xsl:output
method="{$method}"
encoding="{$encoding}"
/>

It just takes the values literally.
Reply With Quote
  #2 (permalink)  
Old 02-08-2008
Rik Wasmus
 
Posts: n/a
Default Re: How to change output method dynamically?

On Thu, 07 Feb 2008 17:10:19 +0100, l0b0 <victor.engmark@gmail.com> wrote:

> Hi all,
>
> I can't find anything about this in the PHP manual or on Google, so
> I'm hoping you'll be able to help.
>
> The situation is that I'm already using plenty of xsl:param elements
> which are given data from PHP, as such:
>
> $arguments['/_xml'] = xslt_process(
> $xh
> ,'arg:/_xml'
> ,'arg:/_xsl'
> ,NULL
> ,$arguments
> ,array(
> 'method' =>
> xml_entity_encode('html')
> ,'encoding' =>
> xml_entity_encode('UTF-8')
> )
> );
>
> <xsl:stylesheet
> version="1.0"
> xmlns="http://www.w3.org/1999/xhtml"
> xmlns:xhtml="http://www.w3.org/1999/xhtml"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >

> <xsl:param name="method"/>
> <xsl:param name="encoding"/>
>
> Now, I'd like to feed these values to the xsl:output attributes, not
> in the resulting markup. How can I do that (preferably without another
> stylesheet)? The following doesn't work in PHP4:
>
> <xsl:output
> method="{$method}"
> encoding="{$encoding}"
> />
>
> It just takes the values literally.


<http://nl2.php.net/manual/en/function.domxsltstylesheet-process.php>
?
--
Rik Wasmus
Reply With Quote
  #3 (permalink)  
Old 02-08-2008
l0b0
 
Posts: n/a
Default Re: How to change output method dynamically?

On Feb 8, 2:48 am, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
> On Thu, 07 Feb 2008 17:10:19 +0100, l0b0 <victor.engm...@gmail.com> wrote:
> > Hi all,

>
> > I can't find anything about this in the PHP manual or on Google, so
> > I'm hoping you'll be able to help.

>
> > The situation is that I'm already using plenty of xsl:param elements
> > which are given data from PHP, as such:

>
> > $arguments['/_xml'] = xslt_process(
> > $xh
> > ,'arg:/_xml'
> > ,'arg:/_xsl'
> > ,NULL
> > ,$arguments
> > ,array(
> > 'method' =>
> > xml_entity_encode('html')
> > ,'encoding' =>
> > xml_entity_encode('UTF-8')
> > )
> > );

>
> > <xsl:stylesheet
> > version="1.0"
> > xmlns="http://www.w3.org/1999/xhtml"
> > xmlns:xhtml="http://www.w3.org/1999/xhtml"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

>
> > <xsl:param name="method"/>
> > <xsl:param name="encoding"/>

>
> > Now, I'd like to feed these values to the xsl:output attributes, not
> > in the resulting markup. How can I do that (preferably without another
> > stylesheet)? The following doesn't work in PHP4:

>
> > <xsl:output
> > method="{$method}"
> > encoding="{$encoding}"
> > />

>
> > It just takes the values literally.

>
> <http://nl2.php.net/manual/en/function.domxsltstylesheet-process.php>
> ?


Is that different from PHP4's xslt_process()? There are no indications
that you can do this in DomXsltStylesheet->process().
Reply With Quote
  #4 (permalink)  
Old 02-18-2008
l0b0
 
Posts: n/a
Default Re: How to change output method dynamically?

On Feb 7, 5:10 pm, l0b0 <victor.engm...@gmail.com> wrote:
> I can't find anything about this in the PHP manual or on Google, so
> I'm hoping you'll be able to help.
>
> The situation is that I'm already using plenty of xsl:param elements
> which are given data from PHP, as such:
>
> $arguments['/_xml'] = xslt_process(
> $xh
> ,'arg:/_xml'
> ,'arg:/_xsl'
> ,NULL
> ,$arguments
> ,array(
> 'method' =>
> xml_entity_encode('html')
> ,'encoding' =>
> xml_entity_encode('UTF-8')
> )
> );
>
> <xsl:stylesheet
> version="1.0"
> xmlns="http://www.w3.org/1999/xhtml"
> xmlns:xhtml="http://www.w3.org/1999/xhtml"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >

> <xsl:param name="method"/>
> <xsl:param name="encoding"/>
>
> Now, I'd like to feed these values to the xsl:output attributes, not
> in the resulting markup. How can I do that (preferably without another
> stylesheet)? The following doesn't work in PHP4:
>
> <xsl:output
> method="{$method}"
> encoding="{$encoding}"
> />
>
> It just takes the values literally.


I ended up using an extra style sheet to convert XHTML to HTML
instead: <http://l0b0.net/blog/?p=109>

--
Victor
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 09:57 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0