DITA and XMetaL Discussion
XMetaL Community Forum › DITA and XMetaL Discussion › Inserting simple line-break <br>
-
Maria March 24, 2009 at 4:39 pm
Inserting simple line-break <br>
March 24, 2009 at 4:39 pmParticipants 9Replies 10Last Activity 14 years agoI've looked through the DITA spec and see no element for a line-break. Is there a comparable element, or an element that will transform to a
tag in the html output?
I don't want to use a freshman hack such asto get this effect. thanks to whoever answers this.
Maria March 24, 2009 at 5:13 pm
Reply to: Inserting simple line-break <br>
March 24, 2009 at 5:13 pmI am trying to insert a line break
inside a table cell. For example:Sentence one.
Sentence two.
You can't add an extra element to the xml source code (even in a paragraph); you get an invalid element error message and it won't let you save or toggle back to tag-view.
The XSLT/FO solution you mention is way out of my reach–if I knew how to do that, I wouldn't have spent $3K on XMetal; I'd have used DOT in Eclipse.
Anyway I thought XSLT-FO was just for outputting PDF. I want to output HTML.thanks for having replied so promptly. (By the way, your reply disappeared and I couldn't quote it here.)
mag3737 March 24, 2009 at 5:53 pm
Reply to: Inserting simple line-break <br>
March 24, 2009 at 5:53 pmAs you have already noted, there is no such element in DITA. I never saw the posting by some other user that you are referring to, so I don't know what they might have said. I also have no idea what you would/would not consider a “freshman hack”, since that's pretty subjective.
However, the most likely way you could achieve something like this is either to create a specialized DITA DTD that has an element called
, or to use some agreed-upon attribute on an existing element such as. I'd call the latter idea a hack; the former, probably not so much, although it adds extra complexity. In either case there will also have to be some modification of the DITA-OT in order to get it to do what you want in the HTML output, by which I mean some XSLT coding. You are right that XSL-FO is used for PDF output, not for HTML. However, XSLT is used in the transformation process for both types of output.
By the way, this is not really an XMetaL question. You may reach an audience with more answers on a DITA-specific forum such as the [dita-users] Yahoo email list.
Derek Read March 24, 2009 at 7:54 pm
Reply to: Inserting simple line-break <br>
March 24, 2009 at 7:54 pmThis same question came in via support as well. Here is the answer we provided as it may be useful for others reading this post.
My first instinct is to think the best way handle this is to modify the XSLT that generates the HTML (part of the DITA Open Toolkit). That assumes you want to modify the look of the output consistently for a particular set of elements and inject
elements inside them for some reason.However, it seems possible that you may want manual control over where these
elements will appear, meaning that you are looking for something you can put in your XML source that will translate into a
upon output. The closest I can think of is theelement. This functions in a similar way to but allows you to enter carriage returns, which then translate to
upon output to HTML.If that is not acceptable I suppose you could specialize the DITA DTDs to allow inclusion of a
element within other elements (perhapsand elsewhere) and then make modifications to the DITA OT to process these into
upon output.XMetaL Author is an XML editor. The product can be used with any DTD, including DITA (for which we include a complete customization and an integration with the DITA Open Toolkit with XMetaL Author Enterprise). We do not publish DTD standards and so we do not control the format of the DITA DTDs.
If DITA is lacking in a particular area you should feel free to communicate that with the [url=http://www.oasis-open.org/committees/dita/]OASIS Darwin Information Typing Architecture (DITA) TC[/url] (or even ask to join the committee).
If you feel the DITA Open Toolkit needs improvement you can raise feature requests and bugs using the “tracker” at the [url=http://sourceforge.net/projects/dita-ot/]DITA Open Toolkit Project[/url].
ghkrause March 25, 2009 at 3:59 pm
Reply to: Inserting simple line-break <br>
March 25, 2009 at 3:59 pmAt Qimonda a created our own DITA domain that includes a
as a specialization of . I have chosen as
does not represent content but formatting info. Of course,could be used as specialization base, too. You need a .ent file and a .mod file. They need to be added to the topic .dtd files where you want to make the domain available. There are tutorials how to do this and there are service partners that could implement for you. This function is not available out-of-the-box.
And yes, you need to add a template to the XSLT to get
(this way it is xhtml compliant).Chris March 25, 2009 at 6:09 pm
Reply to: Inserting simple line-break <br>
March 25, 2009 at 6:09 pmDerek Read March 25, 2009 at 10:14 pm
Reply to: Inserting simple line-break <br>
March 25, 2009 at 10:14 pmFWIW, Maria has indicated to me via email that she will likely be using
as the solution to her original query. Maria April 1, 2009 at 2:06 pm
Reply to: Inserting simple line-break <br>
April 1, 2009 at 2:06 pmYes.
was precisely what I was looking for. Funny, the range of responses…thank goodness I didn't have to create a specialization for a simple carriage return…or edit the XSLT, or petition the guardians of DITA for that line break : ) math April 2, 2009 at 12:31 am
Reply to: Inserting simple line-break <br>
April 2, 2009 at 12:31 amdid you try command?
Maria April 2, 2009 at 12:42 am
Reply to: Inserting simple line-break <br>
April 2, 2009 at 12:42 amNot sure what you mean by “command.” I am using XMetal Author Enterprise Edition which is a graphical interface (no command lines). The
tag is perfect. Here is a sentence that I want to break here
and here
and here
and end it here.No mark-up necessary between lines; but in the output you see the
element in the places you entered the line break. It creates a single space, not a double space as thetag would have done.
Evidently there are many ways to achieve a
some are unnecessarily complicated. Fortunately for me, there was a very simple way to do it.Derek Read April 2, 2009 at 1:04 am
Reply to: Inserting simple line-break <br>
April 2, 2009 at 1:04 ammath:
Please note that this thread is on the “DITA and XMetaL Discussion” board, so it is assumed to be in the context of DITA (and in this case the DITA Open Toolkit also comes into play because that is what Maria is using with XMetaL Author Enterprise to produce her HTML).
Supporting a processing instruction is a possibility, but it is not natively supported by the DITA Open Toolkit and would likely require XSLT modifications to implement support for it.
I think we can consider this post closed now as Maria has found her solution.
-
AuthorPosts
- The topic ‘Inserting simple line-break <br>’ is closed to new replies.