Re: Passing profiling conditions into transformation for DocBook

Jirka Kosek <[email protected]> Tue, 14 May 2024 17:24:43 +0200
Newsgroups gmane.editors.xxe.general
Message-ID <[email protected]>
On 14.05.2024 16:42, Hussein Shafie wrote:
> Then I'll assume that the problem is elsewhere.
> 
> Please send me (mailto:[email protected]) your ".profiles" file and 
> also, if it's not too much effort for you, a sample DocBook document 
> where some of profiling attributes are used and the I'll try to 
> reproduce the problem here.

Hi Hussein,

I've created simple example that uses stock DocBook. Please find 
attached sample DocBook file (profiling-test.xml) and definition of 
profiles (test.profiles).

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.

Many thanks for your help.

Have a nice day,

				Jirka

-- 
------------------------------------------------------------------
   Jirka Kosek      e-mail: [email protected]      http://xmlguru.cz
------------------------------------------------------------------
      Professional XML and Web consulting and training services
DocBook/DITA customization, custom XSLT/XSL-FO document processing
------------------------------------------------------------------
     Bringing you XML Prague conference    http://xmlprague.cz
------------------------------------------------------------------


--
XMLmind XML Editor Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/xmleditor-support
profiling-test.xml (text/xml, 852 B)
<?xml version="1.0" encoding="UTF-8"?>
<book version="5.0" xmlns="http://docbook.org/ns/docbook"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xmlns:svg="http://www.w3.org/2000/svg"
      xmlns:m="http://www.w3.org/1998/Math/MathML"
      xmlns:html="http://www.w3.org/1999/xhtml"
      xmlns:db="http://docbook.org/ns/docbook">
  <info>
    <title>Profiling test</title>
  </info>

  <chapter status="draft">
    <title>Sample draft chapter</title>

    <para xml:lang="en">Sample English para</para>

    <para xml:lang="cs">Sample Czech para (ěščřžýáí)</para>
  </chapter>

  <chapter status="final">
    <title>Sample final chapter</title>

    <para xml:lang="en">Sample English para</para>

    <para xml:lang="cs">Sample Czech para (ěščřžýáí)</para>
  </chapter>
</book>
test.profiles (text/xml, 1.4 KB)
<?xml version="1.0" encoding="UTF-8"?>
<profiles class="com.xmlmind.xmleditext.profiling.docbook.DBProfileSet"
          xmlns="http://www.xmlmind.com/xmleditor/schema/profiling"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:xs="http://www.w3.org/2001/XMLSchema"
          xmlns:prf="http://www.xmlmind.com/xmleditor/schema/profiling">
  <attributes>
    <attribute allowMultipleValues="false" name="status">
      <value style="background-color: #FFFFCC;">draft</value>

      <value>final</value>
    </attribute>

    <attribute name="xml:lang">
      <value>cs</value>

      <value>sk</value>

      <value>en</value>

      <value>uk</value>
    </attribute>
  </attributes>

  <profile implementation="test_files/CS_draft.xslt" xml:id="CS_draft">
    <description xml:space="preserve">Only Slovak version with all draft content for proofreading</description>

    <attribute name="xml:lang">
      <value>cs</value>
    </attribute>

    <attribute name="status">
      <value>draft</value>

      <value>final</value>
    </attribute>
  </profile>

  <profile implementation="test_files/CS_final.xslt" xml:id="CS_final">
    <description xml:space="preserve">Slovak final version for delivery to customer (draft sections are removed)</description>

    <attribute name="xml:lang">
      <value>cs</value>
    </attribute>

    <attribute name="status">
      <value>final</value>
    </attribute>
  </profile>
</profiles>
OpenPGP_signature.asc (application/pgp-signature, 203 B)
-----BEGIN PGP SIGNATURE-----

wmMEABEIACMWIQRya5eRAjs9i3DpmvLPCZLDufR1HgUCZkOCOwUDAAAAAAAKCRDPCZLDufR1HoG0
AJ9dnpsl+iSQRhkyahLLNidF6bWLBwCcDDx3VAv4vSDCtLtnj914djaodC4=
=/5w/
-----END PGP SIGNATURE-----