473,323 Members | 1,550 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

Indent won't work in XSLT

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?

Sep 24 '05 #1
2 1701
what xslt processor do you use? My proc (msxml) works good
Sep 25 '05 #2
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
ca*****@gmail.com wrote:
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?

Sep 27 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: John Wellesz | last post by:
If you are coding php using GVIM, you will appreciate this new indent script: Download there: http://www.vim.org/scripts/download_script.php?src_id=3710 or here: ...
1
by: hongping | last post by:
I am having problems transforming a xml doc into html with proper indenting. Here is the xslt <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0"...
4
by: Werner Partner | last post by:
I'm looking for something like that: http://www.sonoptikon.de/praxis-mt/test.php The text should have a certain indent, and from the left border should come a "marker" which goes over the text...
22
by: Firas | last post by:
Hi, Is there a CSSish way to indent a paragraph except for the first line? I tried p:first-line { text-indent: 0em; }
14
by: Tammy | last post by:
Hi all, I'm trying to figure out how to indent text in the middle of a line. For example: Name: John Smith Addres: 1234 Main St. City: New York, NY
1
by: Christopher P. Winter | last post by:
I'm seeing some unexpected behavior with Text-indent, as shown on this page: http://www.chris-winter.com/Digressions/HP_Kayak/My_Kayak.html I set up the following style rules for footnotes: ...
8
by: tintagel | last post by:
Hi everyone, I've just joined your group! I'm pretty new to HTML etc. Here's my problem: I'm attached to the idea of keeping content separate from formatting information, so I like putting...
2
by: Jean-François Michaud | last post by:
Hello everybody, I'm having a little issue with tables. I want to align it according to the left indent, but if the table is too wide, I want to fall back on a right align. How do I detect if an...
2
by: @cl | last post by:
hello ,everybody I'm a newer to xml, and I need to format and indent xml in a textpanel, as when input is <root> <node1> <node11/> </node1>
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.