|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Inserting Line Breaks in XSL?
I'm developing an XSL to transform XML data into a text format. I need to force it to insert line breaks, but it's not working. No matter how many line breaks I insert it doesn't help.
This would be between two tags. Is there a way to force XSLT to insert a line break between two tags without putting text in there? jb. |
|
#2
|
||||
|
||||
|
This will work for you:
Code:
<xsl:template match="Element" attr1="blah" attr2="blah"> <xsl:value-of select="ChildA"/> <xsl:text><xsl:value-of select="ChildB"/><xsl:text> <xsl:text><xsl:value-of select="ChildC_etc..."/><xsl:text> </xsl:template> |
|
#3
|
||||
|
||||
|
I had the same problem and I found a solution.
I don't know if it is the best but it works. I define a variable: Code:
<xsl:variable name="newline"> <xsl:text> </xsl:text> </xsl:variable> This variable you could you in your program. e.g.: Code:
<xsl:value-of select="$newline"> <!-- line break in output file --> |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > Inserting Line Breaks in XSL? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|