XSLT Debugger stalling on initial <!DOCTYPE> tag
Posted: Wed Feb 15, 2012 6:01 pm
Hi Guys,
I'm (trying to ) write some XSLT to transform XHTML to XML, a snippet of the source XHTML is below.
When stepping through the XSLT using the XSLT Debugger the trace indicates a red dot (error?) when it encounters the very first <DOCTYPE html...
blah blah blah> (line 1 in the XHTML)
The XSLT I've written to markup the "html/head/title" is the following:
The output I'm getting is
So I can only assume there is a problem with my XSLT, but can someone poin out where please?
Thanks in advance for any help.
Lewis
I'm (trying to ) write some XSLT to transform XHTML to XML, a snippet of the source XHTML is below.
Code: Select all
<!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>Building Standards Domestic Handbook - General</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="keywords" content="Building Standards Scotland, Technical Handbooks, Domestic, 2010" />
blah blah blah> (line 1 in the XHTML)
The XSLT I've written to markup the "html/head/title" is the following:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!-- sts_transform.xsl
This xsl document is the main xslt used to transform Scottish
Technical Standards domestic, into an XML representation
which comply with the crown legisaltion markup language
xsd's.-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.legislation.gov.uk/namespaces/legislation"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xml:base="http://www.legislation.gov.uk/id/asp/2003/8"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:dct="http://purl.org/dc/terms/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:ukm="http://www.legislation.gov.uk/namespaces/metadata">
<xsl:output method="xml"/>
<xsl:output indent="yes"/>
<xsl:strip-space elements="body"/>
<xsl:template match="/">
<Legislation>
<ukm:Metadata>
<xsl:apply-templates select="html/head"/>
</ukm:Metadata>
</Legislation>
</xsl:template>
<xsl:template match ="title">
<dc:title>
<xsl:value-of select="."/>
</dc:title>
</xsl:template>
</xsl:stylesheet>
The output I'm getting is
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<Legislation xmlns="http://www.legislation.gov.uk/namespaces/legislation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dct="http://purl.org/dc/terms/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:ukm="http://www.legislation.gov.uk/namespaces/metadata">
<ukm:Metadata/>
</Legislation>
Thanks in advance for any help.
Lewis