Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


can't get same output with msxsl and altovaxml, altovaxml missing carriage returns.

Posted on 2008-10-24
Medium Priority
Last Modified: 2013-11-18
I have been using msxsl to transform my xml files to text documents without problem for a while.  A new company I am working with will require me to do hundreds of transforms a month.  I read that it is easier for me to integrate altovaxml into batch or scripted programs, so I grabbed it.
The new company require a carriage return and line feed after every line.
Altovaxml is only outputting a line feed whereas msxsl is doing the cr lf.

120201059 00013 000000

Altovaxml: (edited cause linefeeds work fine in here and looks exactly the same if I do a straight paste!)
00200810221120001 120201059 00013 000000 13200810221    

Does anyone have an idea on how I can get the carriage return into the altovaxml output file?

I have attached the sample xml and xsl with the sneaky added extension names.

Any pointers or help will be met with a smile and spark of hope.
thanks for your time.
Question by:JohnnyOffTheSpot
  • 4
  • 3
LVL 60

Expert Comment

by:Geert Bormans
ID: 22801995
In your XSLT you are actually only outputting a linefeed, so you should add thecarriage return, like this
    <xsl:param name="nl" select="'&#13;&#10;'"/>
LVL 60

Accepted Solution

Geert Bormans earned 2000 total points
ID: 22802114
well, having said that, I have some comments on your toolset (would not be me otherwise, would it :-)

msxml is a typical windows tool, ignoring the difference between lf and cr-lf. There are all sorts of possible issues with msxml, that have to do with white-space in a mixed content context... but that is something you don't have in your example, so you should not care. msxml is very fast and works with as little memory as possible. Yes, a lot of good things can be said about the microsoft xml effort.
There by the way is a command-line tool wrapped around msxml4, that I use(d) a lot for batch processing
you need to have msxml4 installed (which you can do side by side with other versions)

altova tools simply suck really bad. They fail to deliver tools that are fully standard compliant. Basically they deliver tools for the masses, not caring about the real professional users (they think they can get there customers by having a fancy GUI, and apparently they do) . This leads to errors, also mainly in the white-space area (I kept on reporting errors, but they don't care, altova basically doesn't care about customers at all) Generally altova xml is slow and using a lot of memory comparing to most other processors.

So Geert, do you have alternatives for command line processing? Oh yes, I do.
At the moment I feel most comfortable with Saxon (both the XSLT1 and the XSLT2 version)
It is the most standard compliant of all, fast and reliable.... and the behaviour is pretty predictable accross platforms.
But it requires some setup (having Java and requiring to put the jar on the ClassPath)
If you want to go down that route, I can help you to set it up. If the java installment is not a problem (Java is on most windows machines anyway) I would go for the latest and move to XSLT2
download Saxon-B 9.1 for XSLT2.0
or if you feel less adventorous download 6.5.5 for XSLT1

For XSLT1 there also is Xalan as a good alternative

Have fun


Author Comment

ID: 22804394
wow, you are awesome!
I actually tried the <xsl:param name="nl" select="'&#13;&#10;'"/> but I got exactly the same output in msxsl and altova, which I thought was weird.
Infact I even tried  "'&#xD;&#xA;'" which was is in the O'reilly XSLT book by Tidwell. I tried just 13, then 10 and 13 but I always got the same output.

So I am downloading saxon-B 9.1 right now.  I was confused initially thinking that the free version was too crippled, so I dismissed saxon.

Thank you for you explainations and your articulation of how I have felt about other altova products in the past.  I find it funny that msxsl is 25KB and altovaxml is 13,761KB and altova is noticebly slower.

Thanks again for you suggestions and help.  
I am going to post my results with saxon and then close this it out, just in case I have another clarification.  I hope you are getting paid very well in whatever job you have, you deserve it.


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

LVL 60

Expert Comment

by:Geert Bormans
ID: 22804573
Those are very nice words, thank you.

If you change it to '&#13;&#10;' (or to '&#xD;&#xA;' which is exactly the same)  and the altova output is still the same, it is a defect... then throw altova out of the window (my box flew at least 35m in my garden, when I ever reached that point :-)

Saxon-B is not crippled at all. It is a high quality product. The schema awareness has been taken out of that product. But you don't need it. So all you need is there

> I find it funny that msxsl is 25KB
well honestly, it loads the msxml.dll, so it is actually more than 25kb, but still :-)

Author Comment

ID: 22815453
Everything works great with saxon.
Interestingly, (to me, at least) is that msxsl.exe automatically turned "'&#10'" into a carriage return AND Line feed.  AltovaXML saw 10 or 13 and, 10 and 13, as only a line feed.
I actually found Kernow (http://kernowforsaxon.sourceforge.net/index.html) which lets me run transforms on an entire directory at once.  Works great for this project and saves me from figuring out how to automate it myself.

Thank you again for you help.

Author Closing Comment

ID: 31509893
Awesome again!
LVL 60

Expert Comment

by:Geert Bormans
ID: 22815642

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

579 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question