xslt transformation (xml to xml), line break issue
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 1
- Joined: Sun May 18, 2008 4:51 pm
xslt transformation (xml to xml), line break issue
Hello, I'm using version 9.2 and I'm using xslt (version 1) to transform an xml document to a new xml document. The new xml document contains the data I want but it's all on a single line, and I mean everything is one a single line, even the xml-declaration. I have to manually perform a "format and indent" on the generated xml file for it to become pleasing to my eye. Did I do something wrong in my xsl-file or what can I do here? Oh, and btw, I'm very new to xslt.
- E
- E
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: xslt transformation (xml to xml), line break issue
Post by sorin_ristache »
Hello,
The format of the transformation output is set by your XSLT stylesheet. If you want to indent the output so that it is easy to read you should use the xsl:output element with the indent="yes" attribute in the stylesheet:
Regards,
Sorin
The format of the transformation output is set by your XSLT stylesheet. If you want to indent the output so that it is easy to read you should use the xsl:output element with the indent="yes" attribute in the stylesheet:
Code: Select all
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output indent="yes"/>
...
</xsl:stylesheet>
Sorin
-
- Posts: 3
- Joined: Sun Aug 03, 2008 5:07 pm
Re: xslt transformation (xml to xml), line break issue
Post by cashreadbob »
Even i have the similar problem.Using XSLT iam trying to transform an XML into another XML of different format.iam getting the O/P as
<media:description type="plain">Show Title: FN DishHost(s): Adam RobertsShow Description: Here is the decription of the show. Here is the decription of the show. Here is the decription of the show. Here is the decription of the show. Here is the decription of the show.</media:description>
if i use <br/> in xslt then the O/P would be
<media:description type="plain">
<br />
Show Title: FN Dish
<br />
Host(s): Adam Roberts
<br />
Show Description: Here is the decription of the show. Here is the decription of the show. Here is the decription of the show. Here is the decription of the show. Here is the decription of the show.
</media:description>
but i need the O/P to be
<media:description type="plain">
Show Title: FN Dish
Host(s): Adam Roberts
Show Description: Here is the decription of the show. Here is the decription of the show. Here is the decription of the show. Here is the decription of the show. Here is the decription of the show.
</media:description>
i mean to say the description variable in XSLT should display its values in separate lines in XML O/P file without <br/> statement
<media:description type="plain">Show Title: FN DishHost(s): Adam RobertsShow Description: Here is the decription of the show. Here is the decription of the show. Here is the decription of the show. Here is the decription of the show. Here is the decription of the show.</media:description>
if i use <br/> in xslt then the O/P would be
<media:description type="plain">
<br />
Show Title: FN Dish
<br />
Host(s): Adam Roberts
<br />
Show Description: Here is the decription of the show. Here is the decription of the show. Here is the decription of the show. Here is the decription of the show. Here is the decription of the show.
</media:description>
but i need the O/P to be
<media:description type="plain">
Show Title: FN Dish
Host(s): Adam Roberts
Show Description: Here is the decription of the show. Here is the decription of the show. Here is the decription of the show. Here is the decription of the show. Here is the decription of the show.
</media:description>
i mean to say the description variable in XSLT should display its values in separate lines in XML O/P file without <br/> statement
ericlilja wrote:Hello, I'm using version 9.2 and I'm using xslt (version 1) to transform an xml document to a new xml document. The new xml document contains the data I want but it's all on a single line, and I mean everything is one a single line, even the xml-declaration. I have to manually perform a "format and indent" on the generated xml file for it to become pleasing to my eye. Did I do something wrong in my xsl-file or what can I do here? Oh, and btw, I'm very new to xslt.
- E
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service