XSLTProcessor help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



help, when I include <xsl:apply-templates/>
the XSLTProcessor only strips the XML tags and outputs the text see result

--------------cut here result--------------
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head>
<body><pre>

  Hyalearl, 100-ton Sulieman-Class Scout/Courier

2008
03
10

  All rights reserved 2008
  Onno Meyer
  none@xxxxxxxx
  10
  Traveller
  1.0

</pre></body>
</html>
-------------cut here------------------

------------cut here vehicle.php----------
<?php
   $xslDoc = new DOMDocument();
   $xslDoc->load("vehicle.xsl");

   $xmlDoc = new DOMDocument();
   $xmlDoc->load("vehicle.xml");

   $proc = new XSLTProcessor();
   $proc->importStylesheet($xslDoc);
   echo $proc->transformToXML($xmlDoc);
?>
--------------cut here---------------------

--------------cut here vehicle.xsl---------
<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match="/">
<html>
<head>
</head>
<body>
<pre>
<xsl:apply-templates/>
</pre>
</body>
</html>
</xsl:template>
<xsl:template match="meta">
<!-- meta -->
</xsl:template>
</xsl:stylesheet>
--------------cut here---------------------

--------------cut here vehicle.xml---------
<?xml version="1.0" encoding="UTF-8" ?>
<vehicle id="1" xmlns="http://localhost/gurps/ns/";>
<meta>
  <title>Hyalearl, 100-ton Sulieman-Class Scout/Courier</title>
  <date>
<year>2008</year>
<month>03</month>
<day>10</day>
</date>
  <copyright>All rights reserved 2008</copyright>
  <author>Onno Meyer</author>
  <email>none@xxxxxxxx</email>
  <TL>10</TL>
  <background>Traveller</background>
  <version>1.0</version>
</meta>
</vehicle>
--------------cut here--------------------- 
tom_a_sparks


Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html



      Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. Find out more

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux