Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] Problem with conversion

From: "ashu t" <aashut@-------------->
To:
Date: 7/1/2002 1:17:00 AM
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


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent