[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Problem with <a> conversion

Subject: Problem with <a> conversion
From: "ashu t" <aashut@xxxxxxxxxxxxxx>
Date: 1 Jul 2002 09:18:58 -0000
 Problem with <a>  conversion
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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.