IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Profile: Irian
About
User Name: Irian
Forum Rank: Member
Real Name:
Location
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Wednesday, October 23, 2013
Last Visit: Wednesday, April 5, 2017 12:58:31 PM
Number of Posts: 18
[0.10% of all post / 0.00 posts per day]
Avatar
Last 10 Posts
Topic: Full control over generated XSLT file name
Posted: Tuesday, December 20, 2016 9:04:52 AM
Probably a lame question, but I cannot find a way to have full control over the generated XSLT file name for a mapping Project.

If it is not included in a Project file it always outputs MappingMapTo[configurable mapping name]; if included in a project file it becomes [configurable project name]MapTo[configurable mapping name], I cannot find a way to get rid of the MapTo bit; it's not a really big problem but maybe there is something I overlooked somewhere.
Topic: Embed PDF into SPS
Posted: Tuesday, December 22, 2015 10:15:04 AM
If I understand correctly what you want is an overlay of a static PDF file with a dynamically generated one.

Assuming this is really what you need AFAIK there is no easy way to this in stylevision; but there is a way to do it after the dynamic PDF has been generated.

If you want to follow this approach you can try using PDFBox:


I'm sure there are other libraries out there that do the same thing, PDFBox is just one I've already used before.
Topic: XSLT 1.0 pdf generation with apache FOP
Posted: Wednesday, December 16, 2015 9:02:49 AM
I've had a little free time this morning and I put together a small example for you, hope it is of help.

I've tested this example with a basic fop 2.0 installation using the default fop.bat

The only modification I made to the standard fop installation is that I dropped the file: barcode4j-fop-ext-complete.jar in the lib folder

As it is this example works without problems even when invoked directly from StyleVision
Topic: XSLT 1.0 pdf generation with apache FOP
Posted: Tuesday, December 15, 2015 3:25:25 PM
Hi,

I'm fairly sure this approach works, since I've used it myself in various reports, make sure you are setting the barcode configuration bits in a user defined block since these should not be touched by stylevision during the XSLT file generation.


Judging by the error you get it appears there are problems loading the additional jar required by fop to generate the barcode output.


As a first try I suggest you to use the fop.bat script (or the bash equivalent if you are on linux), this way you are sure that all the fop classpath requirements are correctly configured, to add the barcode extension in 2.0 it's sufficient to drop the jar in the lib dir and the script is able to pick it up.

If this still does not work it might be an issue with the barcode library since I do not know if it has been updated for fop 2.0 and I've not tested that configuration yet; if you can, try using a different version of fop to generate your report and see if it works.
Topic: Generate a sequential numbering with XSLT 1.0
Posted: Thursday, November 12, 2015 11:34:29 AM
K101 wrote:
No way to do that using v2009, but v2011 introduced an improved auto-number function which will do exactly what you want. You ought to consider upgrading.


Thank you very much, I'll definitely consider upgrading.
Topic: Generate a sequential numbering with XSLT 1.0
Posted: Thursday, November 5, 2015 10:32:56 AM
Hi everyone,

I've recently started using MapForce to generate some XML to XML mapping using XSLT 1.0; so far I was able to do everything I need, but I'm now stuck on a most probably small problem that I cannot find an easy way to fix.

For my mapping project I'm required to generate a sequential numbering for the ouput XML elements, but the only viable solution I've found so far is to process the XML 2 times, once to generate the structure I need, and once to generate the sequential number.

I know there must be a way to do this in one shot, but I've been struggling for a while now and only got partial results.

I attach a simple sample mapping I've created to demonstrate the issue (it's a MapForce 2009 project cause that's what I have a license for).

Thank you very much for your help.
Topic: Convert sps to xslt with maven
Posted: Thursday, September 3, 2015 8:25:08 AM
Hi,

I'm trying to add some automation to sps processing in my project.

I have various sps and xsd files for which I need to generate XSLT-FO transformation files, for now every time changes are made to one sps file I have to export the XSLT-FO file and store it in VCS along with the sps.

I would love to create some sort of automation to generate the required XSLT files on project build (it's a maven based project), the command line interface from StyleVision seems to be able to do this, but integrating that with maven on a linux based build server might be difficult, is there any other way to generate an xslt-fo from an sps file??
Topic: Generate output file from C#.net
Posted: Thursday, January 8, 2015 11:20:17 AM
I do the exact same thing from Java (mainly for PDF files).

It is sufficient to generate the correct xslt transformation files, there will be more than one if you want different output formats, you can also generate excel files with a little and dirty trick using StyleVision HTML output and a bit of attention when designing your reports, if everything works as expected you do not even need to have StyleVision installed on the application host machine, you'll only need it to design your documents.

In Java XSLT Transformation is limited to XSLT 1.0, i do not know if C# supports 2.0 but since you are getting errors during the XSLT transformation phase you can try to set the XSLT level to 1.0 from StyleVision and try again.

To generate PDF files you'll also need a XSL-FO engine, i normally use apache FOP, and I'm fairly sure there is a C# port of that somewhere, but I've only been using the original Java version.

For the question regarding calls from the command line interface, I personally prefer to keep everything integrated with no command line calls, if you want to do this you need to check the exact XSLT version supported by C# and make sure you are not using anything supported only by StyleVison (the native Barcode support is one example), otherwise you will also need a copy of Java and Fop installed on your system and can then use the FOP command line interface to do both the XSLT transformation and PDF rendering.

If you want I can try to put together a list of steps required to create a PDF from an application using XSLT files designed by StyleVision, without command line calls.
Topic: Data annotations inside StyleVision forms?
Posted: Friday, September 19, 2014 7:50:36 AM
Assuming I've grasped your requirements well enough you can obtain a result quite close to what you desire by doing the following:

1) Design an XSD file containing your input data.

This can be used in a JAXB binding to map java objects to XML.

2) Design your form with StyleVision using the previously generated XSD file.

With this you include the required information located with the help of the XSD file that does the job of the data annotation.

3) Save an XSLT-HTML transformation file from StyleVision with XSLT 1.0 and include that in your java application.

If you need XSLT 2.0 then you must include Saxon or a similar XSLT2.0 library in your java application as well.

4) Have your Java application generate an XML file (or a Memory stream assuming the contents are not too big) and then process the generated XML with a Java XSLT transformation using the XSLT-HTML file generated from StyleVision this will give you a ready to use HTML file (or stream depending on how you do the transformation).


In case you need other kind of outputs Stylevision also gives you RTF, PDF, and Word transformation files so you could also support different formats other than plain HTML.
Topic: Change XSLT Processor in Stylevision
Posted: Monday, May 19, 2014 4:24:58 PM
I sort of anticipated something like this, unfortunately in my case it's the other way around, I had to use a third party extension to XalanJ (that probably can be reproduced somehow in pure XSLT but I have no time to do that), by using StyleVision, I'm able to generate correct XSLT that uses this extension in XalanJ, unfortunately there is no XalanJ available to StyleVision, and the syntax to make the same extension available to Altova's own engine is way different, so I have to generate the XSLT file and then process it manually in XMLSpy to get a preview of the final document, the Altova parser in StyleVision just breaks on my extension since it does not know how to deal with it.


In my case if something cannot be done with standard XSLT 1.0 then I cannot use it, since it will break in the final application anyway.


vlad wrote:
StyleVision produces its own XSLT for you. In those cases where implementation of your design is impossible with standard XSLT means Altova is using internal extensions. This is the reason why changing of the XSLT engine is not supported - just to make sure that every detail you wish to design works indeed.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.