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: MichaelUA
About
User Name: MichaelUA
Forum Rank: Newbie
Real Name:
Location Ukraine
Occupation:
Interests:
Gender: None Specified
Statistics
Joined: Wednesday, October 7, 2020
Last Visit: Saturday, April 10, 2021 8:27:20 PM
Number of Posts: 8
[0.05% of all post / 0.04 posts per day]
Avatar
Last 10 Posts
Topic: Looping in Condition and Auto Calculation
Posted: Saturday, April 10, 2021 6:39:55 PM
Hello,

I'm stuck when trying to loop multiple segments (within one parent) in Condition+AutoCalc construction. I'm trying to convert XLM and inside my Altova project I have a usual table where I'm trying to put my values into the appropriate cells. Imagine that in incoming file I have something like <Line><Tax><Amount>, where <Tax> allowed few times. So I need to put all Tax\Amount values into one cell with <cr><lf> (I consider that each <line> goes to it's row). When I'm adding Tax\Amount into a cell as a content of Template, it works and I receive all Amount values. But if I add the same into Condition and/or AutoCalc construction, I receive only the first Amount. Is it possible to loop them all using XPath?

I would appreciate any advice.

Thanks.
Topic: Xml into Pdf converting issue (using Altova StyleVision)
Posted: Saturday, October 31, 2020 9:20:22 PM
K101 wrote:
Sounds like an application for a table footer, since those can repeat on each page. Either that or a page footer. See, for example, "Table headers and footers in PDF output", or Headers and Footer, in the docs.

Perhaps the "Tables with Sub-Totals.sps" example installed along with StyleVision will give you some ideas.


Thank you! It was helpful and I could use footer to create the totals. But it is at every single page, when I need it only at the first. As I understood I have only one option to omit footer being displayed each time the page breaks, using the table-omit-footer-at-break property, but it is not what I need, because in such a case footer shows at the end of the table, but not at the first page. Is it any solution to leave footer only at first page? Maybe I could use condition, smth like When CurrentPage = 1 show the footer..
Topic: Xml into Pdf converting issue (using Altova StyleVision)
Posted: Thursday, October 29, 2020 7:21:51 PM
Hello!

I have to convert the list of items from xml to pdf format. For this purpose I use dynamic table based on the input data.
If I have a huge list of items (that is invoice for instance ) the table could be on several pages. But I need to break somehow the table on the first page by including another info block that is not within the input data (total) to the bottom of the page. And then the table should continue on the next page at the break point (see attached schema).

Is there any possibility to do this?
Topic: Using pure XSLT in Altova StyleVision
Posted: Thursday, October 29, 2020 4:25:44 PM
K101 wrote:
You don't use an XPath if. The condition cause the creation of the xsl:choose conditional construct in the generated XSLT.

So, the condition XPath in your case would simply be flag = 'False'. Then, inside the condition, you'll put an auto-calculation with '-percentage * 100'.

See the attached example.


Hello K101,

Thank you so much! I followed your advice and it worked just fine.

Thank you again!
Topic: Using pure XSLT in Altova StyleVision
Posted: Friday, October 9, 2020 9:58:45 AM
K101 wrote:
Why not simply use StyleVision's own condition functionality? That works using XSLT 1.0.

Hello K101,

Thanks for your answer.

But how can I do this? I right-click in Design mode in the field I need, choose "Insert -> Insert condition" and...I see "Edit XPATH expression" again! I've seen it before. I can use IF there, but it does not work with XSLT 1.0.

Maybe I was not too specific. I'll try to explain what my problem is.

Imagine that in incoming file you have two tags: <flag> and <percentage>.

In outgoing PDF I need: if <flag> = 'False' I need -<percentage>*100, if <flag> = 'True' I need <percentage>*100 (without minus char).

What is the best way to implement it, if not IF statement?

Thank you so much
Topic: Using pure XSLT in Altova StyleVision
Posted: Thursday, October 8, 2020 7:38:15 AM
Hello,

I'm completely new in Altova products. And my question is:

We have Altova StyleVision and using it to create PDFs from XML. In one field I need to use IF condition. So I use XPATH Expression (User-Defined-Template) with IF - THEN - ELSE IF - THEN - ELSE confition. If works fine if I use XSLT 2.0 button in the tool panel. But unfortunately our customer supports only XSLT 1.0. When I press XLST 1.0 button this structure fails - I assume because XSLT 1.0 does not support IF statement.

I realize that instead of IF I could use something like

<xsl:choose>
<xsl:when test=...
..................
</xsl:choose>.

But it also fails - I assume because I can use only XPATH, not pure XSLT.

So my question is: is it possible to use pure XSLT container somehow? What other workaround could be used?

Thanks a lot for any answer.

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