Line Break in XML

  • Hacker007
  • Proficient
  • Proficient
  • User avatar
  • Posts: 371
  • Loc: Riverside, CA

Post 3+ Months Ago

Im using XML to display news on a site, but cant get a space between articles, If you could help it would be great. here is what im using

HTML
Code: [ Select ]
<html>
<head>
<style>
#posthead {background-color:navy; color: white; text-align: center; border: 2px solid black;}
#postbody {background-color:none; color: black; text-align: left ; border: 1px solid black; border-top:  0px solid black;}
</style>
</head>
<body>
<xml
src="news.xml"
id="xmldso"
async="false">
</xml>

<table datasrc="#xmldso" width="525" border="0" cell-spacing="0" cell-padding="0">
<tr>
<td id="posthead"><span datafld="TITLE"></span></td>
</tr>
<tr>
<td id="postbody"><span datafld="POST"></span></td>
</tr>
</table>

</body>
</html>
  1. <html>
  2. <head>
  3. <style>
  4. #posthead {background-color:navy; color: white; text-align: center; border: 2px solid black;}
  5. #postbody {background-color:none; color: black; text-align: left ; border: 1px solid black; border-top:  0px solid black;}
  6. </style>
  7. </head>
  8. <body>
  9. <xml
  10. src="news.xml"
  11. id="xmldso"
  12. async="false">
  13. </xml>
  14. <table datasrc="#xmldso" width="525" border="0" cell-spacing="0" cell-padding="0">
  15. <tr>
  16. <td id="posthead"><span datafld="TITLE"></span></td>
  17. </tr>
  18. <tr>
  19. <td id="postbody"><span datafld="POST"></span></td>
  20. </tr>
  21. </table>
  22. </body>
  23. </html>


XML
Code: [ Select ]
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited with XML Spy v4.2 -->
<CATALOG>
    <NEWS>
        <TITLE>Article Name</TITLE>
        <POST>Article Body</POST>
    </NEWS>
    
    <NEWS>
        <TITLE>Article Name 2</TITLE>
        <POST>Article Body 2</POST>
    </NEWS>
</CATALOG>
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!-- Edited with XML Spy v4.2 -->
  3. <CATALOG>
  4.     <NEWS>
  5.         <TITLE>Article Name</TITLE>
  6.         <POST>Article Body</POST>
  7.     </NEWS>
  8.     
  9.     <NEWS>
  10.         <TITLE>Article Name 2</TITLE>
  11.         <POST>Article Body 2</POST>
  12.     </NEWS>
  13. </CATALOG>


I need a space betwen each table like the <*br /*> but that wont work for me :oops:
  • digitalMedia
  • a.k.a. dM
  • Genius
  • User avatar
  • Posts: 5149
  • Loc: SC-USA

Post 3+ Months Ago

Have you tried using a margin on the 'postbody' definitions?

Code: [ Select ]
#postbody{color:#000;text-align:left;border:1px solid #000; border-top:0px solid #000;margin-bottom:10px;}


Also, if you're going to have multiple instances of the this display table you'll want to use classes instead of id's:

Code: [ Select ]
.postbody{color:#000;text-align:left;border:1px solid #000; border-top:0px solid #000;margin-bottom:10px;}


<td class="postbody"></td>
  1. .postbody{color:#000;text-align:left;border:1px solid #000; border-top:0px solid #000;margin-bottom:10px;}
  2. <td class="postbody"></td>
  • Hacker007
  • Proficient
  • Proficient
  • User avatar
  • Posts: 371
  • Loc: Riverside, CA

Post 3+ Months Ago

Thank you for the help, I will try that :wink:
The Margin thing.... Man I should have figured that would work... Guess I didnt think hard enough, thank you though. And I will change it from ID to class too. :lol:
  • Shikoku
  • Newbie
  • Newbie
  • Shikoku
  • Posts: 14

Post 3+ Months Ago

so
Code: [ Select ]
<br>
wont work and you can't hit shift enter? man thats gotta suck!

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 34 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.