DITA and XMetaL Discussion

XMetaL Community Forum DITA and XMetaL Discussion Text indenting through DTD

  • linjinwei

    Text indenting through DTD

    Participants 11
    Replies 12
    Last Activity 14 years, 3 months ago

    After much exploratng, I understand that you need to customize some of your own attributes in the DTD section. Currently I'm trying to indent text.

    I created a new attribute named “indent”. Everything in the HighlightDomain.end and HighlightDomain.mod is done. I can see the new attribute in the Element List. Now I am trying to define the “indent” in the ditabase-derived.css file. But I have no idea what is the exact code to indent text.

    I tried “start-indent”, “left-margin” but didnt work.

    Here is the part of the code. I only need to find out the exact coding to do indenting.

    [code]
    /* indent {*/
    [class~=”hi-d/indent”] {
    start-indent: 10pt;
    }
    [/code]

    Thanks in advance

    Reply

    ghkrause

    Reply to: Text indenting through DTD

    I try hard not to start arguing whether this is a good idea what you do.

    You want to try something out to get DITA fitting your needs. You did either an attribute or element specialization.
    a) In case of attribute you need to assign a value to the attribute. Example:

    indented paragraph

    A CSS would read
    [indent=”yes”] { margin-left: 10pt; }
    b) in case of a element (you should start your own domain for this, do not extend OASIS domains): example:
    A CSS would read
    [class~=” my-domain/indent “] { margin-left: 10pt; }

    Please do not mix element and attribute in XML.
    Preferred implementation would be an element that is semantically named like (long quote) which is by default indented in XMetaL. Abusing for your purpose of indenting is equally acceptable as adding format driven tags like .
    The highlight domain with i/b/u is a bad example as it introduces format driven tags instead of semantic ones. It is accaptable to get people starting and to demo inline tags (tags within a paragraph).

    Hope this helps.

    Reply

    linjinwei

    Reply to: Text indenting through DTD

    Hi ghkrause .

    I am actually doing the b) method.  I typed in what you said in ditabase-derived.css but the text still wont indent.

    [code]
    /* indent {*/
    [class~=”hi-d/indent”] {
    margin-left: 10pt;
    }

    [/code]

    But The text still refuse to indent in XMetal interface or pfd output. It is so hard to just indent some texts?

    I dont want to use because it gives me a rectangular box in the pdf output.

    Please help. Thks in advance

    Reply

    linjinwei

    Reply to: Text indenting through DTD

    OK…after much more trial and errors, I finally got the indenting in XMetal interface.

    [code]
    /* indent {*/
    [class~=”hi-d/indent”] {
    margin-left: 10pt;
    display: block;
    }[/code]

    But the effect is not taken in the pdf output. It does not indent in pdf. Can someone tell me why?

    This image shows the interface in XMetal
    [img]http://img520.imageshack.us/img520/6420/indentdtdxmetaluidx1.jpg[/img]

    This image shows the output in pdf.
    [img]http://img206.imageshack.us/img206/1262/indentdtdpdfeh2.jpg[/img]

    Edit: ok I managed to solved my problem. It can display in XMetal interface and pdf output, but not in HTML output. Why is that so?

    Reply

    mag3737

    Reply to: Text indenting through DTD

    Every time XML is rendered in some format, there are stylesheets involved.

    When XMetaL displays your content on the screen, it uses CSS stylesheets.  (This is the stuff you added to ditabase-derived.css.)

    When the PDF is created, that is the DITA Open Toolkit using XSLT stylesheets.  If you got your indentation in PDF output, it was probably by editing an .xsl file somewhere.

    When the HTML is created, the DITA Open Toolkit is using more .xsl stylesheets, because to an XML processor, HTML is another “output format” like PDF.  But to get the indented appearance in your HTML when it is viewed, there are even more stylesheets involved — CSS that is used by the web browser.  So to get this indentation you might need to modify two sets of stylesheets:  1) CSS stylesheets that are included with the DITA Open Toolkit and saved to the output directories along with the HTML output; and 2) .xsl files in the DITA OT — but only if you need to create some HTML attributes — something that matches up with the CSS — that are not already being created by the toolkit.

    Reply

    linjinwei

    Reply to: Text indenting through DTD

    So can I say that the elements that define the appearance of XMetal, pdf and HTML are from independent files? So like for example if I made changes to ditabase-derived.css, it will ONLY affect the XMetal interface?

    =============================================================
    XMetal ditabase-derived.css
    =============================================================

    pdf – 1) C:Program FilesCommon FilesXMetaL SharedDITA_OTdemoxmfoxslfohi-domain.xsl
              – 2) C:Program FilesCommon FilesXMetaL SharedDITA_OTdemoxmfo
    Customizationfoattrsxm-cfghi-domain-attr.xsl
              – 3) C:Program FilesCommon FilesXMetaL SharedDITA_OTdemoxmfocfgfoattrshi-domain-attr.xsl
    =============================================================

    html – ???
    =============================================================

    I have not figured out where to change the interface for HTML, any clue?

    Reply

    Su-Laine Yeo

    Reply to: Text indenting through DTD

    See “Appendix B: Configuring XHTML and CHM output” in the XMetaL online help.

    Note that we recommend NOT changing ditabase-derived.css, because JustSystems may improve this file in new releases. There are “override” files that you should use instead. See the online help topic called “DITA stylesheets” for details.

    I don't know the specifics of why you want to indent text, as the only example you've posted is from a table of contents. However I'll say one more time that creating a new element called is generally a very bad way to go about indenting things. There are lots of experienced consultants out there who can look at your requirements and help you deal with these issues more strategically. If you spend time now modelling your content and figuring out how to separate content from formatting, you will save yourself a lot of time later on when your company decides to change its layout guidelines or when you want to deliver content in different output formats, e.g. for small-screen devices.

    Su-Laine

    Reply

    linjinwei

    Reply to: Text indenting through DTD

    Hi. I read the help on HTML output and got confused. Its leaves me with some questions.

    1)The Help told me to create a custom file to place all the elements that i created inside. Where do I find the file? Am I suppose to create it myself? Must the file be named “xhtml_custom.css”?

    2)SO the elements are found in:

    [code]

    C:Program FilesCommon FilesXMetaL SharedDITA_OTresourcecommonltr.css . This file includes selectors and styles for left-to-right output.
    C:Program FilesCommon FilesXMetaL SharedDITA_OTresourcecommonrtl.css . This file includes selectors and styles for right-to-left output.

    [/code]

    Why is it that when I edit the “bold” element, nothing happened in the output? Am I suppose to change the code in both commonltr.css and commonrtl.css ?

    [code].bold { font-weight: bold; font-size: 50em;}[/code]

    Reply

    Su-Laine Yeo

    Reply to: Text indenting through DTD

    What is the title of the help topic you saw that says to “to create a custom file to place all the elements that [you] created inside”? Where did you get the impression that you should name the file “xhtml_custom.css”?

    Reply

    linjinwei

    Reply to: Text indenting through DTD

    [img]http://img214.imageshack.us/img214/4541/helpik5.jpg[/img]

    Reply

    Su-Laine Yeo

    Reply to: Text indenting through DTD

    What this topic says is  “You can copy and edit this file to create custom styling for your output.” (It is referring to both the commonltr.css file and the commonrtl.css file, but for most of the world's languages all you need to worry about is the commonltr.css file.)

    In other words, make a copy of the commonltr.css file and give the copy a different file name, such as “my_commonltr.css”. Then edit “my_commonltr.css”. After that, you will point XMetaL to the my_commonltr.css file so that it automatically uses that file when generating HTML output. Does this make sense so far?

    Reply

    linjinwei

    Reply to: Text indenting through DTD

    So after I have created my custom file, should i remove all the contents inside and only leave the elements that I want?

    For example, if I only want to edit the “bold” element, I should remove every thing else except for the “bold” element?

    Reply

    Derek Read

    Reply to: Text indenting through DTD

    The custom CSS file you are editing should be delivered with the HTML files that are output by the DITA OT and will be referenced in the HTML using a element so that browsers can find and open it. It is up to you to decide what CSS settings you wish to include in this CSS file. When you open the HTML with a browser the browser will use whatever default settings it has built-in for HTML elements and attributes and then add your CSS to those (basically as overrides).

    The DITA OT inserts the following into the HTML by default:
    [code][/code]

    You may wish to look for information on how the various browsers support for referencing CSS files. All the modern browsers support this but you may have special cases.

    Reply

  • You must be logged in to reply to this topic.

Lost Your Password?

Products
Downloads
Support