Missing closing /link and /meta tags in output?
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
Missing closing /link and /meta tags in output?
I am generating xhtml files, my xsl file has output defined as so:
The main template has this html code with a meta tag and link tag, both with closing </tags>
The output is
notice the missing closing meta and link tags are gone.
I've tried output types of xml, html and xhtml, nothing changes. Its killing me because I need to do post processing on the html and the saxon parser barfs out an error about the missing closing link tag.
Scott
Code: Select all
<xsl:output method="xhtml" name="xhtml"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" indent="no"/>
Code: Select all
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;"> </meta>
<title> <xsl:value-of select="$title"></xsl:value-of></title>
<link rel="stylesheet" href="csps.css" type="text/css"> </link>
</head>
Code: Select all
<html xmlns:num="http://csps/numbers">
<head>
<meta http-equiv="Content-Type" content="text/html; >
<title>The Title</title>
<link rel="stylesheet" href="csps.css" type="text/css" >
</head>
I've tried output types of xml, html and xhtml, nothing changes. Its killing me because I need to do post processing on the html and the saxon parser barfs out an error about the missing closing link tag.

Scott
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Missing closing /link and /meta tags in output?
Hello,
So how are you copying the HTML template to the output? What does the stylesheet(XSLT template) look like?
Regards,
Adrian
So how are you copying the HTML template to the output? What does the stylesheet(XSLT template) look like?
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
Re: Missing closing /link and /meta tags in output?
Adrian,
The html post processing script. At this point its just a character map. I will be adding a few other things later.
Here its..
I think this is what you were asking for?
Scott
The html post processing script. At this point its just a character map. I will be adding a few other things later.
Here its..
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
exclude-result-prefixes="xs xd"
version="2.0">
<xd:doc scope="stylesheet">
<xd:desc>
<xd:p><xd:b>Created on:</xd:b> Apr 17, 2011</xd:p>
<xd:p><xd:b>Author:</xd:b> scott derrick</xd:p>
<xd:p></xd:p>
</xd:desc>
</xd:doc>
<xsl:output method="html"
use-character-maps="cm1"/>
<xsl:character-map name="cm1">
<xsl:output-character character="-" string="-"/> <!-- hyphen -->
<xsl:output-character character="®" string="®"/> <!-- registered trademark -->
<xsl:output-character character=" " string=" "/> <!-- non-breaking space -->
<xsl:output-character character="·" string="·"/> <!-- middle dot -->
<xsl:output-character character="é" string="é"/> <!-- latin small letter 'e' with acute -->
<xsl:output-character character="ë" string="ë"/> <!-- latin small letter 'e' with acute diaeresis -->
<xsl:output-character character="ö" string="ö"/> <!-- latin small letter 'o' with acute diaeresis -->
<xsl:output-character character=" " string=" "/> <!-- en space -->
<xsl:output-character character=" " string=" "/> <!-- em space -->
<xsl:output-character character=" " string=" "/> <!-- thin space -->
<xsl:output-character character="‐" string="-"/> <!-- hyphen -->
<xsl:output-character character="–" string="–"/> <!-- en dash -->
<xsl:output-character character="—" string="—"/> <!-- em dash -->
<xsl:output-character character="℅" string="℅"/> <!-- care of symbol -->
<xsl:output-character character="‘" string="‘"/> <!-- single opening(left) quote -->
<xsl:output-character character="’" string="’"/> <!-- single closing(right) quote -->
<xsl:output-character character="“" string="“"/> <!-- double opening(left) quote -->
<xsl:output-character character="”" string="”"/> <!-- double closing(right) quote -->
</xsl:character-map>
<!-- IdentityTransform -->
<xsl:template match="/ | @* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
<xsl:message>"foo"</xsl:message>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
Scott
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Missing closing /link and /meta tags in output?
Hi,
No, I was asking for the XHTML generation stylesheet. I understood that you have two steps: XHTML generation and HTML post-processing.
The HTML post processing script will fail if its input is not XML(XHTML) and in your case it's HTML(missing end tags).
But now I see where the problem is. In the XHTML generation stylehseet you are using a named output definition(<xsl:output method="xhtml" name="xhtml"). This is only used when you specify the format attribute for xsl:result-document.
http://www.w3.org/TR/xslt20/#element-output
What you need is an unnamed output definition.
Regards,
Adrian
No, I was asking for the XHTML generation stylesheet. I understood that you have two steps: XHTML generation and HTML post-processing.
The HTML post processing script will fail if its input is not XML(XHTML) and in your case it's HTML(missing end tags).
But now I see where the problem is. In the XHTML generation stylehseet you are using a named output definition(<xsl:output method="xhtml" name="xhtml"). This is only used when you specify the format attribute for xsl:result-document.
http://www.w3.org/TR/xslt20/#element-output
What you need is an unnamed output definition.
Code: Select all
<xsl:output method="xhtml"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" indent="no"/>
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
Re: Missing closing /link and /meta tags in output?
That did it!
I am using xsl:result-document to split the result document into pieces. I call that function like this
<xsl:result-document href="{$filename}">
.....
</xsl:result-document>
and not pass in a named output. Any problems with that?
Scott
I am using xsl:result-document to split the result document into pieces. I call that function like this
<xsl:result-document href="{$filename}">
.....
</xsl:result-document>
and not pass in a named output. Any problems with that?
Scott
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Missing closing /link and /meta tags in output?
No problems, it's just that the named xsl:output is pointless and somewhat misleading if it's not referred from anywhere. It already gave you the false impression that it controlled the output.
I would recommend removing it if it's unused.
Regards,
Adrian
I would recommend removing it if it's unused.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 269
- Joined: Sat Jul 10, 2010 4:03 pm
Re: Missing closing /link and /meta tags in output?
I spoke too soon!
If I remove the name attribute from
like so
and call result-document without a format="csps-xhtml" attribute like so
the resulting documents are not well formed xhtml
If I name the output like so
and call result-document like so
the resulting multiple documents are well formed but the generation of single documents(not using result-document) with this style sheet is now broken like the multiple document output was!
I tried this call
in the non result-document generation template but I get this error
Severity: fatal
Description: Cannot write an implicit result document if an explicit result document has been written to the same URI: file:/home/scott/workspace/books_changes2/build/ebook/sh-tei.html
WHy does using the name attribute on the <output tag break things so?
Can I use result-document and coerce it to generate xhtml without using the format attribute?
Scott
If I remove the name attribute from
Code: Select all
<xsl:output name="csps-xhtml" method="xhtml"/>
Code: Select all
<xsl:output method="xhtml"/>
Code: Select all
<xsl:result-document href="{$filename}" >
If I name the output like so
Code: Select all
<xsl:output name="csps-xhtml" method="xhtml"/>
Code: Select all
<xsl:result-document href="{$filename}" format="csps-xhtml">
I tried this call
Code: Select all
<xsl:result-document format="csps-xhtml"/>
Severity: fatal
Description: Cannot write an implicit result document if an explicit result document has been written to the same URI: file:/home/scott/workspace/books_changes2/build/ebook/sh-tei.html
WHy does using the name attribute on the <output tag break things so?
Can I use result-document and coerce it to generate xhtml without using the format attribute?
Scott
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service