[oXygen-user] QuickFix and DITA default attributes

Jirka Kosek jirka at kosek.cz
Wed Mar 13 13:36:50 CDT 2024


Hi,

I'm creating few small "refactoring actions" using Schematron and 
QuickFix for DITA in oXygen. It works except that default attributes are 
being copied when some element is copied using QuickFix. For example the 
following QuickFix

<sch:pattern>
     <sch:rule context="p">
       <sch:report test="image and 
following-sibling::*[1]/self::fig[not(image)]"
                   sqf:fix="wrap-image">Image is misplaced and not 
enclosed by a figure.</sch:report>

       <sqf:fix id="wrap-image">
         <sqf:description>
           <sqf:title>Move image into adjacent figure.</sqf:title>
         </sqf:description>
         <sch:let name="image" value="image"/>
         <sqf:delete/>
         <sqf:add match="following-sibling::*[1]" position="last-child" 
select="$image"/>
       </sqf:fix>

     </sch:rule>
   </sch:pattern>

Will move image

<image href="media/image29.png"/>

as

<image class="- topic/image " href="media/image29.png" 
placement="inline" 
xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/"/>

I understand that this is perhaps because QuickFix is internally 
implemented as XSLT transformation so default attributes are loaded from 
DTD during the parsing. I can live with added @class and @placement, but 
xmlns:ditaarch namespace declaration instantly triggers validation error 
in oXygen which is inconvenient? Is this something you can fix in next 
releases?

For now I've workaround that is using XSLT for performing QuickFix 
action and uses <xsl:copy copy-namespaces="no"> and I intentionally do 
not copy @class attribute. But QuickFix is much more concise.

Thanks and have a nice day,

					Jirka

-- 
------------------------------------------------------------------
   Jirka Kosek      e-mail: jirka at kosek.cz      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
------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: OpenPGP digital signature
URL: <http://www.oxygenxml.com/pipermail/oxygen-user/attachments/20240313/308fb355/attachment.sig>


More information about the oXygen-user mailing list