Indent won't work in XSLT

C

cawoodm

I have a simple xml file:

<document>
<header>
<title>Hello World!</title>
</header>
</document>

Which I want to transform into HTML. The following transform produces
indented XHTML:

<?xml version="1.0"?>
<xslout:stylesheet xmlns:xslout="http://www.w3.org/1999/XSL/Transform">

<xslout:eek:utput encoding="utf-8" method="html" indent="yes" />

<xslout:template match="/document">
<html><xslout:apply-templates /></html>
</xslout:template>

<xslout:template match="header">
<title><xslout:value-of select="title"/></title>
</xslout:template>

</xslout:stylesheet>


The following (IMO identical) transform will not indent:


<?xml version="1.0"?>
<xslout:stylesheet xmlns:xslout="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xslout:eek:utput encoding="utf-8" method="html" indent="yes" />

<xslout:template match="/">
<html>
<title><xslout:value-of select="document/header/title"/></title>
</html>
</xslout:template>

</xslout:stylesheet>


Can anyone tell me why?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,001
Messages
2,570,254
Members
46,849
Latest member
Fira

Latest Threads

Top