Inserting xml-stylesheet processing instruction not working
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 97
- Joined: Tue Apr 22, 2008 9:31 am
Inserting xml-stylesheet processing instruction not working
I am using XSL/T and want to output a 'xml-stylesheet' processing instruction to an XML file. The test code below is not outputting the attributes correctly for the processing instruction but works for the document element.
Any ideas? Am I missing something?
XSL
XSL/T Output
I am using Oxygen 9.3 on Windows XP and Saxon-B 9.0.0.6 for the XSL/T processor.
Any ideas? Am I missing something?
XSL
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output method="xml" indent="yes" encoding="utf-8" omit-xml-declaration="no"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<xsl:processing-instruction name="xml-stylesheet">
<xsl:attribute name="href">styles1.css</xsl:attribute>
<xsl:attribute name="type">text/css</xsl:attribute>
</xsl:processing-instruction>
<table>
<xsl:attribute name="href">styles2.css</xsl:attribute>
<xsl:attribute name="type">text/css</xsl:attribute>
<xsl:apply-templates select="*"/>
</table>
</xsl:template>
</xsl:stylesheet>
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet styles1.css text/css?><table href="styles2.css" type="text/css"/>
-
- Posts: 9439
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Inserting xml-stylesheet processing instruction not working
Hi,
The processing instruction should be declared in the XSL like this:
See http://www.w3schools.com/XSL/el_process ... uction.asp
Regards,
Radu
The processing instruction should be declared in the XSL like this:
Code: Select all
<xsl:processing-instruction name="xml-stylesheet">href="styles1.css" type="text/css"</xsl:processing-instruction>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “General XML Questions”
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