Solved

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

Posted on 2008-10-24
7
464 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

747 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

13 Experts available now in Live!

Get 1:1 Help Now