Solved

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

Posted on 2008-10-24
7
476 Views
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.

msxsl:
00200810221120001
120201059 00013 000000
13200810221    

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.
test.xsl.txt
test2.xml.txt
0
Comment
Question by:JohnnyOffTheSpot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
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;'"/>
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 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
http://www.microsoft.com/downloads/details.aspx?FamilyId=2FB55371-C94E-4373-B0E9-DB4816552E41&displaylang=en
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
http://saxon.sourceforge.net/#F9.0SA
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

Geert
0
 
LVL 2

Author Comment

by:JohnnyOffTheSpot
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.

0
Independent Software Vendors: 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!

 
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 :-)
0
 
LVL 2

Author Comment

by:JohnnyOffTheSpot
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.
0
 
LVL 2

Author Closing Comment

by:JohnnyOffTheSpot
ID: 31509893
Awesome again!
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 22815642
welcome
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to page 4 99
Cannot open file from ASP if user is "logged in" 13 32
xslt 1.0 - How to split value 8 41
Unexpected End of File 11 54
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

735 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