Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 12th, 2012, 08:00 PM
Registered User
 
Join Date: Oct 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Cannot parse html tags

I'm trying to write a transform to parse an html document and create another html document but I can't seem to use the html tags in the xslt.

My html source that I want to apply the transform on looks like this:
Code:
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
    </head>
    <body class="3-column">
        <div class="centercol"><p>Hello world</p></div>
         <div class="leftcol">
                    <div id="menu">

                    </div>
          </div>
         <div class="rightcol"> </div>
    </body>
</html>
My XSLT looks like this:

Code:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
    <xsl:template match="/*">
    	<xsl:value-of select="body/div/p"/>   <!--I get nothing here -->
    </xsl:template>
</xsl:stylesheet>
Can anyone help me figure out how to get my xpaths to work with html tags?
 
Old June 12th, 2012, 09:11 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Take a look at the first post in this forum, especially the link about default namespaces.
__________________
Joe
http://joe.fawcett.name/
 
Old June 12th, 2012, 11:06 PM
Registered User
 
Join Date: Oct 2010
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Joe, but I don't see a link in the first thread. could you post a link to the thread you're referring to, please.
 
Old June 13th, 2012, 01:07 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Hints for a good XSLT post
__________________
Joe
http://joe.fawcett.name/





Similar Threads
Thread Thread Starter Forum Replies Last Post
HTML tags issue.. atulshin XSLT 2 October 21st, 2008 03:57 AM
Render HTML tags jacksprophet XSLT 1 December 28th, 2006 07:03 PM
Eliminating HTML TAGs beyondforsaken VB How-To 12 June 12th, 2003 08:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.