hansbm |
Member |
|
Netherlands |
|
|
None Specified |
|
Friday, August 18, 2017 |
Thursday, September 21, 2017 7:42:01 AM |
11 [0.06% of all post / 0.00 posts per day] |
|
I'm now trying to achieve the following.
I need to add telephone/fax/e-mail and other contact details in the mix. They display perfectly but I want to add "tel:"/"fax:"/"email:" before each value conditionally. Not all of these details are mandatory, some fields sometimes just aren't there in the XML file. I've entered the following XPath condition:
Code:if (cac:Contact/cbc:Telephone) then "tel: " else () But this doesn't work. In the example XML given in this thread, the telephone number does exist. The phonenumer itself displays correct on the PDF. What's wrong with the XPath syntax? I have a feeling that the sub ("/") is not recognized.
|
You are right Sir! I'm sorry, I just realized that empty elements don't display! I left them alone and made the text before an element conditional. In this example the conition is as follows:
Code:if (cbc:AdditionalStreetName) then ", " else ()
I made a bunch of other conditions the same way. They all work beautiful. Thank you.
|
The content needs NOT to be displayed if empty. That's why after the "else" I didn't enter any clause.
So when <cbc:AdditionalStreetName> doesn't have a value, skip it and move to the next (cbc:PostalZone>). The ", " (comma and space) also need not to be displayed. I'll add the schema to the first post.
The condition
Code:if (cbc:AdditionalStreetName) then cbc:AdditionalStreetName else doesn't work in the XPath editor. I can't close the editor (by clicking OK button) because the syntax doesn't comply.
|
I've tried the following but that condition won't validate correctly:
if (cbc:AdditionalStreetName) then cbc:AdditionalStreetName else
|
I'm trying to build an Xpath condition which only shows an xml element when actual filled. Otherwise leave alone, no space or empty value. It sounds really simple but I can't find an "if exists" condition. There is if-then-else but I'm not sure how to set this up in XPath/StyleVision. See sps screenshot below.
Line 4, where the cbc:BuildingNumber element shows, starting with the comma I want to hide the cbc:AdditionalStreetName element when there is no value given in XML. See attached files. How would the condition look like? Should I use Xpath for that?
|
I read this in the help file http://manual.altova.com/Stylevision/stylevisionprofessional/index.html?svpres_inputformatting_syntax.htm
Quote:Example of Value Formatting for an xs:decimal datatype: "$"(##0.00) Examples of the output would be: $ 25.00 $ 25.42 $267.56
Thought his would right align the numbers.
|
About aligning numbers, see picture below. I'm building a template for displaying invoices. All prices content are value formatted in decimal, "€" (###0.00). Pricing is rendered in a table with no left or right aligning in the stylesheet/styles. Why don't all prices correctly align to the right side? I thought that the leading ### would take care of that?
|
The filter seems to do the right magic! Thanks.
|
Thank you K101. That seems to put things on the right spot! I'll do some more testing after the weekend.
|
I'm building a xml-mapping file based on XSLT1.0. It's for building e-invoices. All values will be passing on to another backend system. The invoice item lines two different variations of taxes (VAT). There is a 6% VAT and a 21% VAT tax.
The following is a part of the XML of an e-invoice:
Code:<cac:TaxTotal> <cbc:TaxAmount currencyID="EUR">16.54</cbc:TaxAmount> <cac:TaxSubtotal> <cbc:TaxableAmount currencyID="EUR">10.55</cbc:TaxableAmount> <cbc:TaxAmount currencyID="EUR">0.63</cbc:TaxAmount> <cac:TaxCategory> <cbc:ID schemeID="UNCL5305">S</cbc:ID> <cbc:Percent>6.00</cbc:Percent> <cac:TaxScheme> <cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID> </cac:TaxScheme> </cac:TaxCategory> </cac:TaxSubtotal> <cac:TaxSubtotal> <cbc:TaxableAmount currencyID="EUR">75.75</cbc:TaxableAmount> <cbc:TaxAmount currencyID="EUR">15.91</cbc:TaxAmount> <cac:TaxCategory> <cbc:ID schemeID="UNCL5305">S</cbc:ID> <cbc:Percent>21.00</cbc:Percent> <cac:TaxScheme> <cbc:ID schemeID="UN/ECE 5153" schemeAgencyID="6">VAT</cbc:ID> </cac:TaxScheme> </cac:TaxCategory> </cac:TaxSubtotal> </cac:TaxTotal> The two different taxes (6% & 21%) need to be mapped to output fields "VAT1" and "VAT2".
How can I loop through each cac:TaxTotal\cac:TaxSubtotal and have the the value of "cbc:TaxAmount" be passed on to the "VAT1" and "VAT2" fields?
|
|