Link to home
Start Free TrialLog in
Avatar of JohnnyOffTheSpot
JohnnyOffTheSpot

asked on

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

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
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

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;'"/>
ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JohnnyOffTheSpot
JohnnyOffTheSpot

ASKER

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.

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 :-)
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.
Awesome again!