![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - RE: Using XSLT to transform XHTML to XHTML Using XSLT to transform XHTML to XHTMLTo: NULL Date: 6/26/2008 1:50:00 AM Dear XSL newsgroup I have input XHTML (indirectly produced from MS Word) and I am using XSLT to produce an output XHTML document. The input XHTML contains many topics, the transform selects one topic of interest and the output XHTML can be displayed as a web page. I have ensured the input is well-formed and valid. In the transform I am trying to produce all my XHTML by means of a single <xsl:template match="/"> which includes all the output <html> ... </html> elements. My problem is that within the <xsl:template match="/"> element, all use of xsl:value-of seems incapable of retrieving anything from the input XHTML. Here are the documents: ----------------input.xhtml------------------- <?xml version="1.0"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>Fruits</title> </head> <body> <h1>Apples</h1> <p>Round fruits that grow on trees.</p> <h1>Bananas</h1> <p>Yellow fruits that grow in clumps.</p> </body> </html> ----------------input.xhtml------------------- ----------------transform.xslt------------------- <xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xhtml xsl"> <xsl:output method="xml" indent="yes" omit-xml-declaration="yes" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/> <xsl:template match="/"> <html> <head> <title> Title: <xsl:value-of select="xhtml:title"/> </title> </head> <body> Body: <xsl:value-of select="xhtml:p"/> </body> </html> </xsl:template> </xsl:stylesheet> ----------------transform.xslt------------------- -------------output.html------------ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> Title: </title> </head> <body> Body: </body> </html> -------------output.html------------ Although the output is valid it's not picking up the xhtml:title or xhtml:p elements from the input. Any help would be greatly appreciated! Kind regards Will Rayer | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
