xsl-list
[Top] [All Lists]

[xsl] HTML to XML

2009-05-27 11:15:09
Hi,
USING:
XLST 2.0 with XPATH 2 from the command line for testing will implement
later on a VB solution.
OS: Windows XP
Saxon 9.1.0.6N from Saxonica
Trying to get the title node content from menu_test.htm using test.xsl:
As you can see I've tried a few combination with no success, could
anybody educate me on the proper approach.

Here my command line:
c:\mik\xslt2\NET\bin\transform menu_test.htm test.xsl 
Here the files:
----------------------------------------------test.xsl
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:xhtml="http://www.w3.org/199/xhtml";>
<xsl:template match="xhtml:html">
<html>
<head>
<title>Testing</title>
</head>
<body>
        <!--xsl:value-of select="xhtml//head//title"/-->
        <!--xsl:if test="not(xhtml:head/xhtml:title)">Attribute
missing</xsl:if-->
        <!--xsl:value-of select="xhtml:head/xhtml:title"/--> 
        <!--xsl:value-of select="xhtml:test"/--> 
        <!--xsl:value-of select="string(test)"/--> 
<xsl:value-of select="xhtml//head//title"/>
<!--xsl:text> <xsl:value-of select="xhtml//head//test"/> </xsl:text-->
</body>
</html>
</xsl:template>
</xsl:stylesheet>
----------------------------------------------Menu_test.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
<https://sera-mtl.cgi.com/exchweb/bin/,DanaInfo=.awfdpenrGm6msm0utPv5ATx
25.3H+redir.asp?URL=http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
">
<html xmlns="http://www.w3.org/1999/xhtml"; lang="en" xml:lang="en">
<head>
<title>Corporate Services - Organizational Chart - What We Do -
Organization - Transport Canada</title>
<!-- METADATA BEGINS | DEBUT DES METADONNEES -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
<meta name="dcterms.issued" scheme="W3CDTF" content="2002-08-21" />
<meta name="dcterms.modified" scheme="W3CDTF" content="2008-10-21" />
<meta name="dc.subject" scheme="gccore" content="Corporate Services" />
<meta name="dc.language" scheme="ISO639-2/T" content="eng" />
<!-- PROGRESSIVE ENHANCEMENT ENDS | FIN DE L'AMELIORATION PROGRESSIVE
-->
</head>
<body>
<div class="page">
Some content
</div>
</body>
</html>
------------------------------------------------------------------------
--------------------
What I'm I missing this is done for a migration project, your guidance
will be appreciated.
Michel


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>