Re: Passing profiling conditions into transformation for DocBook
Hussein Shafie <[email protected]> Tue, 14 May 2024 18:19:49 +0200
| Newsgroups | gmane.editors.xxe.general |
|---|---|
| Message-ID | <[email protected]> |
On 5/14/24 17:24, Jirka Kosek wrote:
>
> I've created simple example that uses stock DocBook. Please find
> attached sample DocBook file (profiling-test.xml) and definition of
> profiles (test.profiles).
Many thanks for doing that. It's much clearer now.
>
> I'm using profiling on two attributes -- status and xml:lang.
>
>>> And I haven't seen other parameters than profile.value and
>>> profile.attribute set in the log.
>>
>> I'm sorry but I don't understand this.
>>
>> In attached screenshot, I have a profile named "java",
>> where attribute @condition, if set, must be set to "java"
>> and
>> attribute @userlevel must, if set, be set to "normal"
>> for a DocBook element to appear in the converted file.
>>
>> When I select this profile, I see in XXE's "Command Execution" log
>> (https://www.xmlmind.com/xmleditor/_distrib/doc/help/statusTool.html)
>
> I'm geting different behaviour unfortunately. When I use profile that
> should choose xml:lang=cs and status=final I'm getting following in the
> log (using standard DocBook support in XXE):
>
> Using the following stylesheet parameters:
> profile.value=cs
> xep.extensions=0
> admon.textlabel=0
> callout.graphics=1
> fop1.extensions=1
> admon.graphics=1
> ulink.show=0
> paper.type=A4
> toc.section.depth=3
> shade.verbatim=1
> use.extensions=1
> variablelist.as.blocks=1
> section.autolabel=1
> profile.attribute=lang
>
> So @status is completely ignored and xml:lang attribute is passed using
> profile.attribute and profile.value with wrong attribute name (lang
> instead of xml:lang).
>
> When I do the same with my customized DocBook where transformation
> doesn't have any parameters declared then I see in the log:
>
> Using the following stylesheet parameters:
> profile.value=cs
> profile.attribute=lang
> profile.lang=
> profile.status=
>
> And I would expect to see
>
> profile.lang=cs
> profile.status=final
>
> So yep, it is quite strange.
>
Well, not really.
A quick look at XXE's code shows that the only DocBook profiling
attributes supported by the "Easy Profiling" add-on are:
---
"arch",
"audience", // V5.0
"condition",
"conformance",
"os",
"outputformat", // V5.1
"revision",
"revisionflag",
"role",
"security",
"userlevel",
"vendor",
"wordsize"
---
@status and @xml:lang are NOT part of these supported profiling attributes.
This list comes from various TDGs. For example, "2.1. Common Effectivity
Attributes",
https://tdg.docbook.org/tdg/5.2/ref-elements#common.effectivity.attributes
Moreover, XXE's code assumes that only a SINGLE attribute which is not
part of the above list is supported by the DocBook XSLT stylesheets to
perform conditional processing.
This assumption comes from "DocBook XSL: The Complete Guide", "Chapter
26. Profiling (conditional text)", "Custom profiling attribute",
http://www.sagehill.net/docbookxsl/CustomProfilingAttr.html
Therefore, XXE is expected to invoke the DocBook XSLT stylesheets with
either:
profile.attribute=xml:lang (yes, profile.attribute=lang looks like a bug)
profile.value=cs
or:
profile.attribute=status
profile.value=final
XXE randomly picked @xml:lang over @status but of course it could have
picked @status.
Please do not hesitate to explain what's wrong with the two above
assumptions (the list of "Common Effectivity Attributes" and the "Custom
profiling attribute") and may be, point us to more up-to-date reference
documents. We'll be glad to fix bugs and/or improve the DocBook support
of the "Easy Profiling" add-on
(https://www.xmlmind.com/xmleditor/_distrib/doc/profiling/index.html).
--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support