I've been using InDesign for a few years now but only just started to learn using the XML to tag, create XSLT & CSS styles. I've found an example in a book which I've used for the XSLT & adapted it to use the structure in a simple InDesign document so I can understand it fully before setting up my proper documents. I have the CSS created which I've done through HTML (minus any reference to doc types at the top, just styles only). Every time I try to import the XML file back into InDesign using the XSLT (which calls up the CSS), I keep getting the following error code:
text format specified by 'xsl:output method='is not appropriate for a DOM
Please can anybody help me to understand where I've gone wrong & what I need to change?
My XSLT is as follows:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
<!ENTITY copy "©">
<!ENTITY reg "®">
<!ENTITY trade "™">
<!ENTITY mdash "—">
<!ENTITY ldquo "“">
<!ENTITY rdquo "”">
<!ENTITY pound "£">
<!ENTITY yen "¥">
<!ENTITY euro "€">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:template match="/">
`enter code here`<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!-- This text is within a comment area. It does not format or affect the file in any way. Insert the link to the external CSS file in the blank line below -->
<link href="Mandy.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div id="heading">
<h1>
<xsl:apply-templates select="html/head"/>
</h1>
</div>
<div id="body">
<h1>
<xsl:apply-templates select="html/head/body"/>
</h1>
</div>
<div id="div">
<h1>
<xsl:apply-templates select="html/head/body/div"/>
</h1>
</div>
</body>
</html>
</xsl:template>
The entities are irrelevant as they are copied over from the example.
My CSS is as follows:
p {
text-indent: 0mm;
margin-left: 12mm;
margin-right: 8mm;
font-family:"Arial-Regular", sans-serif;
font-size: 1.6em;
}
pb {
text-indent: 10mm;
margin-left: 20mm;
margin-right: 8mm;
font-style:bold;
font-family:"Arial-Regular", sans-serif;
font-size: 1.6em;
}
pf {
text-align: justify;
font-family:"Arial-Regular", sans-serif;
font-size: 1.6em;
font-style:normal;
margin-left:2mm;
}
h1 {
text-align: left;
padding-top: 5mm;
padding-bottom: 5mm;
font-family:"Arial-Regular", sans-serif;
font-size: 4em;
font-style:normal;
line-height:100%
}
h2 {
text-align: left;
margin-left:2mm;
padding: 0mm 0mm 0mm 0mm;
font-family:"Arial-Regular", sans-serif;
font-size: 2.5em;
font-style:normal;
line-height:100%
}
h3 {
text-align: left;
padding: 0mm 0mm 0mm 0mm;
font-family:"Arial-Regular", sans-serif;
font-size: 1.6em;
font-style:normal;
line-height:100%
}
ul.a {
text-indent: 100px
list-style-position: inside;
font-family:"Arial-Regular", sans-serif;
font-size: 1.6em;
font-style:normal;
}
ul.b {
text-indent: 100px
list-style-position: inside;
style="list-style-type:disc"
font-family:"Arial-Regular", sans-serif;
font-size: 1.6em;
font-style:normal;
}
tr.left {
text-align: left;
font-family:"Arial-Regular", sans-serif;
font-size: 1.6em;
}
tr.center {
text-align: center;
font-family:"Arial-Regular", sans-serif;
font-size: 1.6em;
}
tr.right {
text-align: right;
font-family:"Arial-Regular", sans-serif;
font-size: 1.6em;
}
td.left {
text-align: left;
font-family:Arial-Regular, sans-serif;
font-size: 1.6em;
border-collapse: collapse;
}
td.center {
text-align: center;
font-family:Arial-Regular, sans-serif;
font-size: 1.6em;
border-collapse: collapse;
}
td.right {
text-align: right;
font-family:Arial-Regular, sans-serif;
font-size: 1.6em;
border-collapse: collapse;
}
th.left {
text-align: left;
font-family:Arial-Regular, sans-serif;
font-size: 1.6em;
border-collapse: collapse;
}
th.center {
text-align: center;
font-family:Arial-Regular, sans-serif;
font-size: 1.6em;
border-collapse: collapse;
}
th.right {
text-align: right;
font-family:Arial-Regular, sans-serif;
font-size: 1.6em;
border-collapse: collapse;
}