Solved

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

Posted on 2008-10-24
7
467 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
  • 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.NET and XML parsing 6 64
Lines Not Lining Up 2 62
XSL - change date format 3 38
XML to SQL Table using c# 5 56
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
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 and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

911 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now