xsl:output and DOCTYPE declaration
Having trouble installing Oxygen? Got a bug to report? Post it all here.
xsl:output and DOCTYPE declaration
Post by marty »
Please tell me if this has already been answered - i have been trying to figure this out for days, and i have look through the forum briefly but not spotted what i need.
I wish to output (valid) xhtml
in my xsl stylesheet i have an xsl:output statement like this:
<xsl:output encoding="iso-8859-1" method="xhtml" indent="yes" doctype-public="-//W3C//DTD XHTML 1.1//EN"
/>
oxygen gives the following output instead above my <html> element:
<?xml version="1.0" encoding="iso-8859-1"?>
obviously, this doesn't make for valid xhtml
### so the question is: is this a problem with oxygen or me?
any advice greatly appreciated
regards
Marty[/b]
I wish to output (valid) xhtml
in my xsl stylesheet i have an xsl:output statement like this:
<xsl:output encoding="iso-8859-1" method="xhtml" indent="yes" doctype-public="-//W3C//DTD XHTML 1.1//EN"
/>
oxygen gives the following output instead above my <html> element:
<?xml version="1.0" encoding="iso-8859-1"?>
obviously, this doesn't make for valid xhtml
### so the question is: is this a problem with oxygen or me?
any advice greatly appreciated
regards
Marty[/b]
-
- Posts: 1
- Joined: Tue Sep 30, 2003 8:37 am
xsl:output to xhtml solution
Post by martinrowland »
that was me before. i have a solution - seems the problem was me!
while produce
and the good news (for me at least) is that it all validates against
http://validator.w3.org/
but if anyone has a better way to do this, by all means let me know
cheers
marty
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:output
omit-xml-declaration="no" method="xml"
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
doctype-system=
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
indent="no" encoding="iso-8859-1"/>
<xsl:template match="/webpage">
<html xml:lang="en" >
<xsl:apply-templates/>
</html>
</xsl:template>
.
.
.
Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
.
.
.
http://validator.w3.org/
but if anyone has a better way to do this, by all means let me know
cheers
marty
-
- Site Admin
- Posts: 2095
- Joined: Thu Jan 09, 2003 2:58 pm
Hi Martin,
I was about to reply on your first post, so here it is:
Doctype declarations need also a system ID when you specify a public ID, therefore you will need to specify both doctype-public and doctype-system attributes in your xsl:output element.
See:
http://www.w3.org/TR/REC-xml#sec-external-ent
Best Regards,
George
I was about to reply on your first post, so here it is:
Doctype declarations need also a system ID when you specify a public ID, therefore you will need to specify both doctype-public and doctype-system attributes in your xsl:output element.
See:
http://www.w3.org/TR/REC-xml#sec-external-ent
Also use method="xml" as both Xalan and Saxon that are integrated with oXygen do not know xhtml as output method.[75] ExternalID ::= 'SYSTEM' S SystemLiteral
| 'PUBLIC' S PubidLiteral S SystemLiteral
Best Regards,
George
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