XML to text (all the etxt on 1 line?)
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 6
- Joined: Wed Aug 08, 2012 7:04 pm
XML to text (all the etxt on 1 line?)
Hi,
I have test.xml and test.xsl, Im interested to see the HTML output, so when i run the debugger (click little blue arrow) the preview text displays all the HTML but sadly its all on one line.
Example that appears all on one line:
ideally Id like
Anyone know how i can beautify the preview/output window?
I have test.xml and test.xsl, Im interested to see the HTML output, so when i run the debugger (click little blue arrow) the preview text displays all the HTML but sadly its all on one line.
Example that appears all on one line:
Code: Select all
<div class="button-container"><a href="http://updated.games.eu/games.apk" class="first red button"></a><span class="download icon"></span><span class="text"><span class="title">Play Games Now</span></span>
Code: Select all
<div class="button-container">
<a href="http://updated.games.eu/games.apk" class="first red button"></a>
<span class="download icon"></span>
<span class="text"><span class="title">Play Games Now</span></span>
-
- Posts: 846
- Joined: Mon Dec 05, 2011 6:04 pm
Re: XML to text (all the etxt on 1 line?)
Hello,
Could you please check in your xsl if the value of the "indent" attribute of the <xsl:output/> element is set to "yes" ? The <xsl:output/> element should be a child node of the root (<xsl:stylesheet>). In case you do not yet have the output element in your XSL document, just add it yourself as a direct child of <xsl:stylesheet> and set its indent to yes.
Your stylesheet should start something like:
Then you should have your output indented and should solve your single line display issue.
Regards,
Costin
Could you please check in your xsl if the value of the "indent" attribute of the <xsl:output/> element is set to "yes" ? The <xsl:output/> element should be a child node of the root (<xsl:stylesheet>). In case you do not yet have the output element in your XSL document, just add it yourself as a direct child of <xsl:stylesheet> and set its indent to yes.
Your stylesheet should start something like:
Code: Select all
<xsl:stylesheet version="x.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output indent="yes"/>
..........................
Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
oXygen XML Editor and Author Support
-
- Posts: 6
- Joined: Wed Aug 08, 2012 7:04 pm
Re: XML to text (all the etxt on 1 line?)
Hi Costin,
Thanks for reply.
I already have that, here is how the top of the XSL file looks:
Any other ideas? It's driving me crazy. Cheers
Thanks for reply.
I already have that, here is how the top of the XSL file looks:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
-
- Posts: 6
- Joined: Wed Aug 08, 2012 7:04 pm
Re: XML to text (all the etxt on 1 line?)
I thought Id post a full full example in the hope it helps. As you can see, the closing <html> tag is on a new line.. no idea why this is and the inside <div> isnt.
XSL FILE
TEXT PREVIEW
XSL FILE
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8"/>
<xsl:template match="mobileSplash"></xsl:param>
<html>
<div id="container">
<xsl:attribute name="class">
<xsl:text>spalsh </xsl:text>
<xsl:value-of select="type/@type"/>
</xsl:attribute>
</div>
</html>
</xsl:template>
.. closing stylesheet tags etc..
Code: Select all
<html><div id="container" class="spalsh android"></div>
</html>
-
- Posts: 6
- Joined: Wed Aug 08, 2012 7:04 pm
Re: XML to text (all the etxt on 1 line?)
wholly crap, i posted the above example without the indent="yes" but trust me its there, I was just removing it to see if it made any diff and then forgot to reapply before i copied and pasted the above post.
oops
oops
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: XML to text (all the etxt on 1 line?)
Hi,
Are you using Xalan as the transformation engine?
I see that Xalan seems to ignore the xsl:output directive when invoked from the Oxygen debugger. On the other hand it works fine when applying the transformation scenario outside of the debugger.
I've logged this to our issue tracking tool to be analyzed.
As a workaround for this problem please use Saxon 6.5.5 in the Oxygen debugger (you can select it from the combo box on the second row of the toolbar) and the output will be formatted correctly.
Regards,
Adrian
Are you using Xalan as the transformation engine?
I see that Xalan seems to ignore the xsl:output directive when invoked from the Oxygen debugger. On the other hand it works fine when applying the transformation scenario outside of the debugger.
I've logged this to our issue tracking tool to be analyzed.
As a workaround for this problem please use Saxon 6.5.5 in the Oxygen debugger (you can select it from the combo box on the second row of the toolbar) and the output will be formatted correctly.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 6
- Joined: Wed Aug 08, 2012 7:04 pm
Re: XML to text (all the etxt on 1 line?)
Thanks Adrian, it works!
I could have sworn I tried all the transformation engines but sods law, I must have skipped that one, because it solves the problem.
Thanks for the reply and kind help!
Loving the software so far.
I could have sworn I tried all the transformation engines but sods law, I must have skipped that one, because it solves the problem.
Thanks for the reply and kind help!
Loving the software so far.
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