Connecting Tech Pros Worldwide Forums | Help | Site Map

Indent won't work in XSLT

cawoodm@gmail.com
Guest
 
Posts: n/a
#1: Sep 24 '05
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:output 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:output 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?


toudidel
Guest
 
Posts: n/a
#2: Sep 25 '05

re: Indent won't work in XSLT


what xslt processor do you use? My proc (msxml) works good


JAPISoft
Guest
 
Posts: n/a
#3: Sep 28 '05

re: Indent won't work in XSLT


I tried with EditiX (http://www.editix.com) and I have no problem with
indenting.

Whad kind of transformer do you use ?? If you don't know and use a Java
environment may I suggest you Xalan (http://xml.apache.org) or Saxon
(http://saxon.sourceforge.net).

Best wishes,

A.Brillant


cawoodm@gmail.com wrote:[color=blue]
> 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:output 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:output 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?
>[/color]
Closed Thread


Similar .NET Framework bytes