General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Creating Thick Border Lines

  • linjinwei

    Creating Thick Border Lines

    Participants 12
    Replies 13
    Last Activity 13 years, 9 months ago

    Hi all. I would like to know if it is possible to create thick border lines just like the one shown in the image, in XMetal interface, pdf and HTML output.

    [img]http://img262.imageshack.us/img262/2282/thickborderlinedm4.jpg[/img]

    Thks in advance.

    Reply

    Bouissaghouane

    Reply to: Creating Thick Border Lines

    did you try to edit the .css file an change the border of your xml element?

    for example:

    DIV3
    {
    display: block;
    border: 3px black solid;
    }

    Mohamed

    Reply

    linjinwei

    Reply to: Creating Thick Border Lines

    which css file? What is the path?

    Reply

    Derek Read

    Reply to: Creating Thick Border Lines

    The CSS file you need to modify will be specific to your customization. With an absolute minimum customization you have the following files (where “schema” is the name of your DTD or Schema file which could literally be anything, for example “docbookx.dtd”):

    schema.dtd or schema.xsd
    schema.css
    schema.ctm

    The CSS file that is loaded will have the same filename as the DTD or XSD file (but with different extension as above) and will normally be in the same folder. Because you are creating the customization I will assume you know which DTD or XSD file you are working with.

    If you are working with XMetaL Developer then you may not have the files above but instead will have a *.xac file. The files listed above will be inside the *.xac file (and are compiled into it using XMetaL Developer). However, I suspect you may not be using Developer as this information is documented in that product (perhaps arguably not as clearly as you would like it to be).

    The method used to get your styling into your HTML or PDF output will vary depending on how that output is being generated but will likely require you to modify files used in that process, typically including CSS (read in by browsers), possibly XSLT (if that is used for transforming from XML to HTML) and probably XSL-FO (for PDF).

    Reply

    linjinwei

    Reply to: Creating Thick Border Lines

    did you try to edit the .css file an change the border of your xml element?

    for example:

    DIV3
    {
    display: block;
    border: 3px black solid;
    }

    Mohamed

    Ok maybe i should have rephrased it. I want to know how to create a single thick line.
    I did try ;

    [code]
    {
    display: block;
    border-top: 3px black solid;
    }[/code]
    but it didnt work. If you want me to be more specific, take a look at the link here, It is exactly what I wanted to achieve.

    http://www.w3schools.com/css/tryit.asp?filename=trycss_border-top

    Reply

    Derek Read

    Reply to: Creating Thick Border Lines

    There is currently no support for borders on their own (left, right, top, bottom). When a border is styled on an element in XMetaL Author (or XMAX) it must be on all 4 sides or none and the element must have display:block set. Given enough demand we might extend this feature in the future, but there is a simple workaround (hack) for this particular case.

    Using 'DIV3' as an example element name you can do the following:

    DIV3:before {
      display: block;
      font-size: 1px;
      content: “-“;
      color: red;
      background-color: red;
    }

    This creates a new empty block 1 pixel high and colours the content and background both red giving the appearance of a line, pretty much identical to border-top. For border-bottom change :before to :after.

    Good enough for editing purposes for most users I should think.

    Reply

    linjinwei

    Reply to: Creating Thick Border Lines

    So Am I supppose to create this “DIV3” element in the ditabase-base-override.css?

    Edit: OK it works perfectly in XMetal. Thanks a million but now I also need it it display in PDF and HTML. How do I do that?

    Reply

    Derek Read

    Reply to: Creating Thick Border Lines

    Please refer to the XSLT files that ship with the DITA OT and the DITA OT documentation as well as various DITA OT groups (on Yahoo and elsewhere). With a good enough grasp of XSLT and XSL-FO this is not a difficult problem. However, I suspect you do not have enough XSLT and XSL-FO knowledge and so I'm hesitant to attempt an answer fearing that it will cascade into a lot more questions that are best answered by information that is already readily available elsewhere (however, if another forum member wishes to try you might get lucky).

    If you are unable to configure the DITA OT to produce the output you want you will want to hire a consultant familiar with XSLT and XSL-FO to do this for you (our Sales team can help you find one, including our own “Professional Services” group which does this type of work regularly on a contractual basis).

    Reply

    linjinwei

    Reply to: Creating Thick Border Lines

    Actually I know which file and where to change.

    The problem is I don't know the exact coding to obtain PDF and HTML output.

    Reply

    Bouissaghouane

    Reply to: Creating Thick Border Lines

    To change the HTML you need to edit a file called HTML_Style.xsl in your project directory. This file is generated by using the method XMLToHTMLSetup(); in one of your macros. If you can't find the file in your projectdir you have to create a macro and call the method to generate the file. 

    you can edit this file by finding the xsl template where the “DIV3” is matched. Add the border style to the other styles already defined in de HTML DIV element: the result could be:

    General

    Mohamed

    Reply

    Derek Read

    Reply to: Creating Thick Border Lines

    To change the HTML you need to edit a file called HTML_Style.xsl in your project directory.

    Note that this answer is specific to non-DITA authors (which is exactly correct — thank you Bouissaghouane).

    I only wish to clarify this because there have been several postings in the wrong boards on the forum recently, with users confusing DITA functionality (which is integrated directly with the DITA Open Toolkit) and  non-DITA functionality (any other DTD or Schema that you have created a customization for and for which you have configured the “Formatting Object interface” and associated APIs as described in the XMetaL Developer Programmer's Guide). It is this second feature set that we are talking about here.

    Reply

    linjinwei

    Reply to: Creating Thick Border Lines

    Hi all,

    Now I was wondering if it is possible to only have a left line while the top,right and bottom are invisible.

    I have searched through and tried in this website, but I either get all four sides or none at all.

    I hav tried;

    display: block;
    border-style: solid;
    border-left-width: 15px

    [url=http://www.w3schools.com/css/pr_border-style.asp]http://www.w3schools.com/css/pr_border-style.asp[/url]

    Reply

    Derek Read

    Reply to: Creating Thick Border Lines

    Please read the following post carefully, it answers your question exactly with regards to TagsOn and Normal view during editing in XMetaL Author:

    http://forums.xmetal.com/index.php?topic=129.msg441#msg441

    If you are asking about support for this in a specific browser or version (ie: after transformation to HTML) then you will need to research that for each browser you are testing with. Most modern browsers support this. We do not support it yet due to lack of demand and actual need for it during the editing process (where the most important thing authors need to worry about is their actual content, not formatting).

    Reply

    linjinwei

    Reply to: Creating Thick Border Lines

    Yes I did read that post, but you mentioned only the solution for top and bottom line.

    If there is really no work around solution for a left line, then I guess I will have to drop the case.

    Regards

    Reply

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

Lost Your Password?

Products
Downloads
Support