Hello,
Has anyone dealt, and succeeded, in interfacing Tcl with UBL** format using current extensions or
packages such an xlm parser ?
Thanks, Olivier.
** UBL is the acronym for Universal Business Language, it becomes mandatory to use it to emit and receive invoices in B2B in some countries. It is xlm formated.
no option justify
no effect.
Am 05.10.2026 um 11:30 schrieb Olivier:
Alexander Schöpe has done some work here and embedded an elecronic
invoice in two formats into a PDF.
https://fossil.sowaswie.de/tclpdf/index
Just an idea,
Harald
I am probably very blind.
Harald Oehlmann <[email protected]> posted:
I am probably very blind.
I don't know but I "moved" your question in a new thread ! It landed here by error ?
Yes, it was me. I have replied on the Message and changed the title.
But the (hidden) thread-ID was still there.
Will do better next time.
Soryy,
Harald
Hello,
Has anyone dealt, and succeeded, in interfacing Tcl with UBL** format using current extensions or
packages such an xlm parser ?
I am probably very blind.
Buttons with multiple text lines:
pack [button .b2 -justify center -text ABC\nD]
may use the -justify option to center the lines.
Now ttk:
pack [ttk::button .b2 -justify center -text ABC\nD]
no option justify
ttk::style configure custom.Toolbutton -anchor center -justify center
pack [ttk::button .b -style custom.Toolbutton -text centered\n2]
no effect.
Is there a way to center the text?
This is Style Vista on MS-Windows...
Thanks for any idea,
Harald
Hello,
Has anyone dealt, and succeeded, in interfacing Tcl with UBL** format using current extensions or
packages such an xlm parser ?
Thanks, Olivier.
** UBL is the acronym for Universal Business Language, it becomes mandatory to use it to emit and receive invoices in B2B in some countries. It is xlm formated.
Do you have a sample document? What exactly is it you are interested in? Parsing one, creating one, exchanging one, etc.?
Am 05.10.26 um 11:30 schrieb Olivier:
Hello,
Has anyone dealt, and succeeded, in interfacing Tcl with UBL** format using current extensions or
packages such an xlm parser ?
Thanks, Olivier.
** UBL is the acronym for Universal Business Language, it becomes mandatory to use it to emit and receive invoices in B2B in some countries. It is xlm formated.
Hi Olivier,
For XML in Tcl, tDOM is the first choice. It handles namespaced XML
such as UBL well, both for parsing (XPath via selectNodes) and for
generating documents.
If you also need hybrid invoices: my package tclpdf supports embedding
XML files into PDF/A in a standards-compliant way, e.g. ZUGFeRD /
Factur-X. https://fossil.sowaswie.de/tclpdf/wiki?name=examples
Alex
saito <[email protected]> posted:
Do you have a sample document? What exactly is it you are interested in?
Parsing one, creating one, exchanging one, etc.?
Hm, I did not want to take time from others as UBL is a fairly complex format :
https://docs.oasis-open.org/ubl/os-UBL-2.1/UBL-2.1.html
I am interested to know if anyone has already edited such xlm document with standard extension or package, to try to replicate his/her approach and not reinvent
the wheel. If not I will do it in pure Tcl.
saito <[email protected]> posted:
Do you have a sample document? What exactly is it you are interested in?
Parsing one, creating one, exchanging one, etc.?
Hm, I did not want to take time from others as UBL is a fairly complex format :
https://docs.oasis-open.org/ubl/os-UBL-2.1/UBL-2.1.html
I am interested to know if anyone has already edited such xlm document with standard extension or package, to try to replicate his/her approach and not reinvent
the wheel. If not I will do it in pure Tcl.
The problem is not technical, but the whole semantic around. Here is a simple example
of an invoice taken from https://github.com/Tradeshift/tradeshift-ubl-examples/tree/master/src/main/resources/org/oasis-open/ubl/examples
(UBL-Invoice-2.1-Example-Trivial.xml a very very simple example )
Am 05.10.26 um 11:50 schrieb Harald Oehlmann:
I am probably very blind.
Buttons with multiple text lines:
pack [button .b2 -justify center -text ABC\nD]
may use the -justify option to center the lines.
Now ttk:
pack [ttk::button .b2 -justify center -text ABC\nD]
no option justify
ttk::style configure custom.Toolbutton -anchor center -justify center
pack [ttk::button .b -style custom.Toolbutton -text centered\n2]
no effect.
Is there a way to center the text?
This is Style Vista on MS-Windows...
Thanks for any idea,
Harald
Harald, your statements regarding the ttk::button widget are not
correct. The following works for me as expected with the vista theme,
with both Tk 9.0 and 9.1:
# ttk::button has no -anchor option but supports the -justify option.
pack [ttk::button .b2 -justify center -text ABC\nD]
# The custom.Toolbutton style supports the -anchor option.
ttk::style configure custom.Toolbutton -anchor center
pack [ttk::button .b -style custom.Toolbutton -justify center -text centered\n2]
Note that here we combine the -anchor *styling* option with the -justify *widget* option. With Tk 9.1 there is also a -justify *styling* option, hence the 2nd block above can be replaced with:
# The custom.Toolbutton style supports the -anchor and -justify options. ttk::style configure custom.Toolbutton -anchor center -justify center
pack [ttk::button .b -style custom.Toolbutton -text centered\n2]
# The custom.Toolbutton style supports the -anchor and -justify options. ttk::style configure custom.Toolbutton -anchor center -justify center
pack [ttk::button .b -style custom.Toolbutton -text centered\n2]
Harald, your statements regarding the ttk::button widget are notYes, -justify was added in 9.0.
correct. The following works for me as expected with the vista theme,
with both Tk 9.0 and 9.1:
Just be forwarned if you do go the "do it yourself" approach. XML
appears simple on its face, but the totality of the spec. is anything
but simple. Handling all the spec. compliant edge conditions is a lot
of effort.
Am 05.10.2026 um 19:13 schrieb nemethi:Thanks Csaba. All this is now on:
Harald, your statements regarding the ttk::button widget are notYes, -justify was added in 9.0.
correct. The following works for me as expected with the vista theme,
with both Tk 9.0 and 9.1:
Do you have any solution for 8.6 (I am on Androwish)?
Thanks for all,
Harald
Am 06.10.2026 um 08:04 schrieb Harald Oehlmann:
Thanks Csaba. All this is now on:
Am 05.10.2026 um 19:13 schrieb nemethi:
Harald, your statements regarding the ttk::button widget are notYes, -justify was added in 9.0.
correct. The following works for me as expected with the vista
theme, with both Tk 9.0 and 9.1:
Do you have any solution for 8.6 (I am on Androwish)?
Thanks for all,
Harald
https://wiki.tcl-lang.org/page/ttk%3A%3Abutton?V=21
Thanks for all,
Harald
Am 05.10.2026 um 19:13 schrieb nemethi:
Harald, your statements regarding the ttk::button widget are notYes, -justify was added in 9.0.
correct. The following works for me as expected with the vista theme,
with both Tk 9.0 and 9.1:
Do you have any solution for 8.6 (I am on Androwish)?
Thanks for all,
Harald
The TButton and Toolbutton styles have always supported the -justify
styling option. Unfortunately, the vista theme ignored it in Tk
versions 9.0.x (this was probably due to a bug). OTOH, most (or even
all?) other built-in themes have always honored this option, and so did, e.g., awlight, awdark, and droid.
Hence the answer to your question is: On AndroWish just use the -
justify styling option.
Am 06.10.26 um 08:04 schrieb Harald Oehlmann:
Am 05.10.2026 um 19:13 schrieb nemethi:
Harald, your statements regarding the ttk::button widget are notYes, -justify was added in 9.0.
correct. The following works for me as expected with the vista
theme, with both Tk 9.0 and 9.1:
Do you have any solution for 8.6 (I am on Androwish)?
Thanks for all,
Harald
The TButton and Toolbutton styles have always supported the -justify
styling option. Unfortunately, the vista theme ignored it in Tk
versions 9.0.x (this was probably due to a bug). OTOH, most (or even
all?) other built-in themes have always honored this option, and so did, e.g., awlight, awdark, and droid.
Hence the answer to your question is: On AndroWish just use the -
justify styling option.
Am 06.10.2026 um 18:03 schrieb nemethi:
Am 06.10.26 um 08:04 schrieb Harald Oehlmann:
Am 05.10.2026 um 19:13 schrieb nemethi:
Harald, your statements regarding the ttk::button widget are notYes, -justify was added in 9.0.
correct. The following works for me as expected with the vista
theme, with both Tk 9.0 and 9.1:
Do you have any solution for 8.6 (I am on Androwish)?
Thanks for all,
Harald
The TButton and Toolbutton styles have always supported the -justify
styling option. Unfortunately, the vista theme ignored it in Tk
versions 9.0.x (this was probably due to a bug). OTOH, most (or even
all?) other built-in themes have always honored this option, and so
did, e.g., awlight, awdark, and droid.
Hence the answer to your question is: On AndroWish just use the -
justify styling option.
I have made some tests:
T1) vista theme, toolbutton
ttk::style theme use vista
ttk::style configure custom.Toolbutton -anchor center -justify center
pack [ttk::button .b -style custom.Toolbutton -text centered\n2]
Tk 8.6: ok, 9.0: no, 9.1: ok
T2) alt theme, toolbutton
ttk::style theme use alt
update
ttk::style configure custom.Toolbutton -anchor center -justify center
pack [ttk::button .b -style custom.Toolbutton -text centered\n2]
Tk 8.6: ok, 9.0: no, 9.1: ok
T3) vista theme, button
ttk::style theme use vista
ttk::style configure custom.TButton -anchor center -justify center
pack [ttk::button .b -style custom.Toolbutton -text centered\n2]
Tk 8.6: no, 9.0: no, 9.1: no
T4) alt theme, button
ttk::style theme use alt
update
ttk::style configure custom.TButton -anchor center -justify center
pack [ttk::button .b -style custom.Toolbutton -text centered\n2]
Tk 8.6: no, 9.0: no, 9.1: no
T5) vista theme, button, command line option
ttk::style theme use vista
ttk::style configure custom.TButton -anchor center -justify center
pack [ttk::button .b -style custom.Toolbutton -text centered\n2 -justify center]
Tk 8.6: invalid option, 9.0: yes, 9.1: no effect
So, to resume:
- styling option, with Toolbutton: works except 9.0
- styling option with TButton: no effect at all
- command option: only effect in 9.0
I think, a bug ticket would be great...
Thanks,
Harald
Invoking "ttk::style configure custom.TButton ..." and then creating a button of the *different* style custom.Toolbutton doesn't make much
sense! Make sure that the button has the same style!
Am 06.10.2026 um 21:52 schrieb nemethi:
Invoking "ttk::style configure custom.TButton ..." and then creating a
button of the *different* style custom.Toolbutton doesn't make much
sense! Make sure that the button has the same style!
Ok, next try, repeating the last three and correcting results:
T1) vista theme, toolbutton
ttk::style theme use vista
ttk::style configure custom.Toolbutton -anchor center -justify center
pack [ttk::button .b -style custom.Toolbutton -text centered\n2]
Tk 8.6: ok, 9.0: no, 9.1: ok
T2) alt theme, toolbutton
ttk::style theme use alt
update
ttk::style configure custom.Toolbutton -anchor center -justify center
pack [ttk::button .b -style custom.Toolbutton -text centered\n2]
Tk 8.6: ok, 9.0: no, 9.1: ok
T3) vista theme, button
ttk::style theme use vista
ttk::style configure custom.TButton -anchor center -justify center
pack [ttk::button .b -style custom.TButton -text centered\n2]
Tk 8.6: ok, 9.0: no, 9.1: ok
T4) alt theme, button
ttk::style theme use alt
update
ttk::style configure custom.TButton -anchor center -justify center
pack [ttk::button .b -style custom.TButton -text centered\n2]
Tk 8.6: ok, 9.0: no, 9.1: ok
T5) vista theme, button, command line option
ttk::style theme use vista
pack [ttk::button .b -text centered\n2 -justify center]
Tk 8.6: invalid option, 9.0: ok, 9.1: no effect
So, the results are:
-justify styling option: ok on 8.6 and 9.1, no effect on 9.0
-justify command option: ok on 9.0, no effect on 9.1
Does this sounds reasonable?
Thanks for all,
Harald
Yes, this looks much better. But note that the upcoming Tk versions
will improve some of these results, due to the many bugfixes of the last
few weeks. For example, the -justify widget option is no longer ignored
by the current trunk version of Tk 9.1, and the -justify styling option
is no longer ignored by Tk 9.0 built from the current core-9-0-branch.
| Sysop: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,142 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 92:10:39 |
| Calls: | 14,704 |
| Calls today: | 2 |
| Files: | 186,497 |
| D/L today: |
2,083 files (617M bytes) |
| Messages: | 2,551,641 |