Z. wrote:

Sometimes I need to keep some words  such as I/O in the same line. So I came up with the following:

diff -dur xxe-pro-10_7_0-orig/addon/config/dita/xsl/fo/programming.xsl xxe-pro-10_7_0/addon/config/dita/xsl/fo/programming.xsl --- xxe-pro-10_7_0-orig/addon/config/dita/xsl/fo/programming.xsl  2024-01-29 04:06:36.000000000 -0500 +++ xxe-pro-10_7_0/addon/config/dita/xsl/fo/programming.xsl 2024-05-31 20:53:15.847189984 -0400
@@ -15,7 +15,7 @@

   <!-- apiname =========================================================== -->

-  <xsl:attribute-set name="apiname" use-attribute-sets="monospace-style">
+  <xsl:attribute-set name="apiname">
    </xsl:attribute-set>

Also, in my customization file, I have this:

    <xsl:attribute-set name="apiname">
      <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
    </xsl:attribute-set>


Yes. See https://www.w3.org/TR/2001/PR-xsl-20010828/slice7.html#keep-together



It works for me. Today, I find out that 2<sup>N+12</sup> is rendered as follows:

2N
+12

So there is a new line between N and + 12. To solve this, I changed it to

<apiname>2<sup>N+12</sup></apiname>

It worked, but I saw the following warnings in xmlmind:

[1] element cannot contain element "sup"
[cvc-complextype]

[2] the sequence of child element is
incorrect [cvc-complex-type.2.4]

These errors are normal. See "Content models for <apiname>", http://docs.oasis-open.org/dita/dita/v1.3/errata02/os/complete/part2-tech-content/contentmodels/cmtca.html#cmtca__apiname




Is there a way to get rid of the warnings or is there a better way to achieve what I want?

Instead of customizing <apiname> which has a very restricted content, customize <codeph> (also found in xsl/fo/programming.xsl) and use <codeph>:

---
   <xsl:attribute-set name="codeph">
     <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
   </xsl:attribute-set>
---

Note that, even in the general case, it makes sense NOT to wrap the content of <codeph>.

See "Content models for <codeph>", http://docs.oasis-open.org/dita/dita/v1.3/errata02/os/complete/part2-tech-content/contentmodels/cmtcc.html#cmtcc__codeph

---
PS: No need to modify the files found in addon/config/dita/xsl/fo/. XMLmind XML Editor includes a helper app called "XMLmind XSL Customizer" which may be used to achieve what you want quickly and safely. Moreover, this way, your customizations will survive XXE updates.

See "Options|Customize Configuration|Customize Document Conversion Stylesheets", https://www.xmlmind.com/xmleditor/_distrib/doc/help/customizeConfigurationMenu.html

See The "Customize Document Conversion Stylesheets" dialog box, https://www.xmlmind.com/xmleditor/_distrib/doc/help/conversion_stylesheets_editor.html

See "The "XMLmind XSL Customizer" application", https://www.xmlmind.com/xmleditor/_distrib/doc/help/com.xmlmind.xslcustom.Customizer.html




--
XMLmind XML Editor Support List
xmleditor-support@xmlmind.com
http://www.xmlmind.com/mailman/listinfo/xmleditor-support

Reply via email to