This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Problem with <a> conversion
- From: "ashu t" <aashut at rediffmail dot com>
- To: XSL-List at lists dot mulberrytech dot com
- Date: 1 Jul 2002 09:18:58 -0000
- Subject: [xsl] Problem with <a> conversion
- Reply-to: xsl-list at lists dot mulberrytech dot com
i am trying to convert html to wml using xslt.
when there is <a> tag in html i am trying to fetch the href of
that and send that to my php program which is using xslt to
convert it into wml.but it is giving error.
i tried
<xsl:template match="div/a | center/a | p/a | ul/a | li/a | tr/a
| td/a | th/a | table/a | font/a">
<xsl:variable name="url">
<xsl:value-of select="@href"/>
</xsl:variable>
<a
href="http://localhost/ashu/transform.php?url=@href">
<xsl:value-of select="."/></a>
</xsl:template>
<xsl:template match="a">
<p> <xsl:variable name="url">
<xsl:value-of select="@href"/>
</xsl:variable>
<a
href="http://localhost/ashu/transform.php?url=@href"><xsl:value-of
select="."/></a>
</p>
</xsl:template>
and my php program transform.php for conversion is
<?php
header("Content-type:text/vnd.wap.wml");
echo("<?xml version=\"1.0\"?>");
echo("<!DOCTYPE wml PUBLIC '-//WAPFORUM//DTD WML 1.2//EN'
'http://www.wapforum.org/DTD/wml_1.2.xml'>");
$th=xslt_create();
$result=xslt_process($th,$url,'myprogram.xsl');
if (!$result)
{
die(sprintf("Cannot process XSLT document [%d]: %s",
xslt_errno($xh), xslt_error($xh)));
}
print "$result";
xslt_free($th);
?>
$url is the name of html file passed to this transform.php program
from the first program which just ask ENTER THE URL::
and send that url to this php program for conversion.
what is the correct way to do that.
ashu t
_________________________________________________________
There is always a better job for you at Monsterindia.com.
Go now http://monsterindia.com/rediffin/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list