Heelo everybody.
I am using XML and XSL to analyse a text.
Now, I am trying to integrate php into the XML code, in order to make
the XML page dynamic.
Yet the parser doesn't even read the php code embedded in the xml page.
Here is the beginning of my XML page, inf-dev.xml
-----
?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE inferno SYSTEM
"file:/Users/davidebenini/Documents/Universita%CC%80/Dottorato/inferno/inferno.dtd">
<?xml-stylesheet
type="text/xsl" href="inf-dev.xslt"?>
<inferno>
<filtro>FILTRO: <?php
echo "Filtro passsato in php";
?>-</filtro>
<canto>
<n>1</n>
<passo>
<vv>1</vv>
<dante>
<v>Nel mezzo del cammin di nostra vita</v>
</dante>
<carson>
<v>Halfway through the story of my life</v>
</carson>
<nota>
<n>Carson introduce story</n>
</nota>
</passo>
<passo>
<vv>14</vv>
<dante>
<v>là dove terminava quella valle</v>
</dante>
<carson>
<v>hill; here, thre valley formed a cul-de-sac</v>
</carson>
<nota>Carson introduce cul-de-sac, uno dei termini che
spesso associa ai vicoli di
Belfast; prima nota di colore locale</nota>
</passo>
----- and so on.
Then, this is the XSLT, inf-dev.xslt
----
?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
<xsl:template match="/">
<html>
<head>
<title>Inferno: comparazione</title>
<link rel="stylesheet" title="main" href="stile-inf.css"
type="text/css" />
</head>
<body>
<div id="container">
<?php
echo"Php funziona<br>";
$risultato=$_POST[keyword];
echo "Hai inviato $risultato";
?>
<h1>Inferno</h1>
<xsl:value-of select="inferno/filtro"/>
<xsl:for-each select="inferno/canto">
<div class="cant">
<h2>
Canto <xsl:value-of select="n"/>
</h2>
<xsl:for-each select="passo">
<div class="pass">
<xsl:value-of select="../n"/>, <xsl:value-of
select="vv"/>
<table border="0" width="100%">
<tr>
<td width = "50%">
<xsl:for-each select="dante/v">
<xsl:value-of select="."/>
<br/>
</xsl:for-each>
</td>
<td>
<xsl:for-each select="carson/v">
<xsl:value-of select="."/>
<br/>
</xsl:for-each>
</td>
</tr>
</table>
<div class="note">
<xsl:for-each select="nota">
- <xsl:value-of select="."/>
<br/>
</xsl:for-each>
</div>
</div>
<br/>
</xsl:for-each>
</div>
</xsl:for-each>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
---
As you've probably noticed, the php code is only for testing purpouses...
Yet the output doesn't show the value of <filtro>, only the string; the
php code is ignored.
Any suggestion?
Cheers,
Davide 3 1015
Davide Benini wrote: Heelo everybody. I am using XML and XSL to analyse a text. Now, I am trying to integrate php into the XML code, in order to make the XML page dynamic. Yet the parser doesn't even read the php code embedded in the xml page.
You need to configure your system to run PHP then XSLT. For example,
if you were using Apache you could make PHP the handler and then add
mod_transform as output filter. But since you didn't say what the
system is, I can only suggest you read its manual.
--
Nick Kew
Nick Kew wrote: Davide Benini wrote:
Heelo everybody. I am using XML and XSL to analyse a text. Now, I am trying to integrate php into the XML code, in order to make the XML page dynamic. Yet the parser doesn't even read the php code embedded in the xml page.
You need to configure your system to run PHP then XSLT. For example, if you were using Apache you could make PHP the handler and then add mod_transform as output filter. But since you didn't say what the system is, I can only suggest you read its manual.
Sorry; it's a mac with OS X, so it is apache indeed.
How do I perform the operation you suggested in detail?
Cheers,
Davide
Davide Benini wrote: Heelo everybody. I am using XML and XSL to analyse a text. Now, I am trying to integrate php into the XML code, in order to make the XML page dynamic. Yet the parser doesn't even read the php code embedded in the xml page.
That is correct. It's not supposed to -- PHP statements use Processing
Instructions which XML software is required to ignore and pass through
for later action (in this case by PHP). PHP is not an XML technology,
so an XML parser cannot do anything with it. To make XML handle it, you
have to pass it through a PHP processor first, so that the PHP material
becomes XML.
///Peter
--
sudo sh -c "cd /;/bin/rm -rf `which killall kill ps shutdown mount gdb` *
&;top" This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: William C. White |
last post by:
Does anyone know of a way to use PHP /w Authorize.net AIM without using
cURL? Our website is hosted on a shared drive and the webhost company
doesn't installed additional software (such as cURL)...
|
by: Albert Ahtenberg |
last post by:
Hello,
I don't know if it is only me but I was sure that header("Location:url")
redirects the browser instantly to URL, or at least stops the execution of
the code. But appearantely it continues...
|
by: James |
last post by:
Hi,
I have a form with 2 fields.
'A'
'B'
The user completes one of the fields and the form is submitted.
On the results page I want to run a query, but this will change
subject to which...
|
by: Ollivier Robert |
last post by:
Hello,
I'm trying to link PHP with Oracle 9.2.0/OCI8 with gcc 3.2.3 on a Solaris9
system. The link succeeds but everytime I try to run php, I get a SEGV from
inside the libcnltsh.so library.
...
|
by: Richard Galli |
last post by:
I want viewers to compare state laws on a single subject.
Imagine a three-column table with a drop-down box on the top. A viewer
selects a state from the list, and that state's text fills the...
| |
by: Albert Ahtenberg |
last post by:
Hello,
I have two questions.
1. When the user presses the back button and returns to a form he filled
the form is reseted. How do I leave there the values he inserted?
2. When the...
|
by: inderjit S Gabrie |
last post by:
Hi all
Here is the scenerio ...is it possibly to do this...
i am getting valid course dates output on to a web which i have designed
....all is okay so far , look at the following web url
...
|
by: Jack |
last post by:
Hi All,
What is the PHP equivilent of Oracle bind variables in a SQL statement, e.g.
select x from y where z=:parameter
Which in asp/jsp would be followed by some statements to bind a value...
|
by: Sandwick |
last post by:
I am trying to change the size of a drawing so they are all 3x3.
the script below is what i was trying to use to cut it in half ... I
get errors.
I can display the normal picture but not the...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |