PHP Code inside XSL
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 3
- Joined: Sun Oct 24, 2004 4:41 am
PHP Code inside XSL
hi,
I am evaluating oxygen and I have a question about PHP code :
-Objctive: Build a home page using XML/XSL and PHP
-Context : 1 xml file that contain my web page datas, 1 xsl file that contains the design of my page.
-Problem : I need to display the date on my home page, In the past I made a php script that displays the date of the day in a specific format.
The problem is that when I include in my xsl file the necessary php code to display the date where I wanted it to appear (<?php include ('date/date.php'); ?>), it does not display the date.
In the html code generated by my xsl transformation, no sign of my php code ???
anyone can help ??
Thanks in advance
PS: For now I appreciate Oxygen
fp
I am evaluating oxygen and I have a question about PHP code :
-Objctive: Build a home page using XML/XSL and PHP
-Context : 1 xml file that contain my web page datas, 1 xsl file that contains the design of my page.
-Problem : I need to display the date on my home page, In the past I made a php script that displays the date of the day in a specific format.
The problem is that when I include in my xsl file the necessary php code to display the date where I wanted it to appear (<?php include ('date/date.php'); ?>), it does not display the date.
In the html code generated by my xsl transformation, no sign of my php code ???
anyone can help ??
Thanks in advance
PS: For now I appreciate Oxygen

fp
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi,
In order to generate the
processing instruction in your result file yoo need in your stylesheet something like
Best Regards,
George
In order to generate the
Code: Select all
(<?php include ('date/date.php'); ?>)
Code: Select all
<xsl:text>(</xsl:text>
<xsl:processing-instruction name="php">
<xsl:text>include ('date/date.php');</xsl:text>
</xsl:processing-instruction>
<xsl:text>)</xsl:text>
George
-
- Posts: 3
- Joined: Thu Mar 17, 2005 11:07 am
- Location: Lahore, Punjab, Pakistan
Post by pk_mkhalid »
This is not working on my site... Can you help me where the problem is... I worte the same code inside my xsl file.
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
-
- Posts: 3
- Joined: Thu Mar 17, 2005 11:07 am
- Location: Lahore, Punjab, Pakistan
Post by pk_mkhalid »
Thanx for reply. My code is
Remember I am using PHP and Sablotron for parsing xsl, xml in PHP
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<xsl:output method="html" indent="yes" encoding="utf-8"/>
<xsl:template match="/">
<xsl:processing-instruction name="php">
<xsl:text>include ('date.php');</xsl:text>
</xsl:processing-instruction>
</xsl:template>
</xsl:stylesheet>
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service