PDA

View Full Version : XML linefeed (text formatting)



Zakarius
October 14th, 2006, 06:49
I'm new to XML but a veteran to HTML. I can't seem to find a way to duplicate the linefeed <br> from HTML...


<p><b><i>small armor:</i></b><br>
<li><i>cost -- 75% normal price</i></li>
<li><i>weight -- 50% of the listed amount</i></li></p>


The above code gives FG a fatal error. Changing the linefeed tag to <br /> won't kill the application but it acts as if it isn't there. Without the <br>, the 'cost' line actually overlaps the 'small armor:' line. Moving the </p> tag to the end of the first line DOES separate these lines, but adds a full line of white space. <h> tags don't do the trick, either.

So is there any way in XML to have a single line followed by a list without a full blank line?

Shrp77
October 14th, 2006, 07:14
Not sure if this helps, but:

HTML code is, AFAIK, only allowed in FormattedText nodes. If you use the HTML code script in any other node type the XML Dom parser will assume you are working on an XML node (hence many forums using closed brackets vs. open brackets to indicate text modes - i.e. italic, bold and underlined - for example).

I haven't come across any line break in any of the xml files I have access to, however you could implement the code using tables instead (which seems to be the SOP for FG HTML text)...

Zakarius
October 14th, 2006, 07:17
I just decided to throw it into a table which has the desired effect. Heh, thanks for the reply ;)

Zakarius
October 14th, 2006, 07:29
Using a table in the code below, there's no blank line for the <tr><td>&nbsp;</td></tr>. I tried using <p> tags, separating the info into two tables and both of these methods together -- none of them worked. Using <p> tags seems to had huge amounts of space (one at the beginning of the tag and one at the end -- or perhaps the <table> tag is also adding one at the beginning).


<table><tr><td><b><i>small armor:</i></b></td></tr>
<tr><td><li><i>cost -- 75% normal price</i></li><li><i>weight -- 50% of the listed amount</i></li></td></tr>
<tr><td>&nbsp;</td></tr>
<tr><td><b><i>tiny armor:</i></b></td></tr>
<tr><td><li><i>cost -- 50% normal price</i></li>
<li><i>weight -- 10% of the listed amount</i></li>
<li><i>defensive value is halved (rounded down)</i></li></td></tr></table>


Any idea how to get that single line of space to show?

nevermind -- fixed it

Apparently, the <li> tags mess up FG's ability to calculate # of lines... do each <li> has to be put inside its own <tr><td>***</td></tr> tags otherwise later text with overlap... strange!