Jump to content

How do you break lines?


Eric

Recommended Posts

I wasn't sure if to post it here (XSLT) or in the XML forum.Since it has to do with style sheet for XML, I figured it was best posted here.****I'm playing around with XML and a style sheet for it, how do I break lines in the XML? I know it would be something in the style sheet, since XML doesn't display date, it just describes it :) But I'm not sure how to display line breaks using style sheet?Here are the two files I'm using:test.xml

<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?><?xml-stylesheet href="xmlstyle.css" type="text/css"?><xml>	<title>This is a XML document</title>	<date>January 13, 2006</date>  <text>  This is the text in this document.  <br/>  <br/>  This is where I write stuff  </text></xml>

xmlstyle.css

text {	color: yellow;	background-color: red;	font-size: 25px;}date {	border: 2px solid #000;}title {	font-weight: bold;	font-style: italic;}convertLineBreaks {	display:none;}br {	/* I don't know what to put here */}

When I view the page, it is all displayed on one line. But the contents of <text> is supposed to be on multiple lines.

Link to comment
Share on other sites

CSS isn't and it never was the future of XML styling. Only XSLT has the power to make the br tag a true line break. As for a line break with CSS, I think it could be done with "display: block" but even if I'm wrong, it still doesn't matter. XSLT forever :) .

Link to comment
Share on other sites

Well all I know is that Google did it for their blog feed xml pages, using css. The page source showed no .xsl files linked to it.If XML linked to a CSS file is good enough for Google then.......The only reason I used CSS is because Google used it when I checked their page souce for their XML pages. Don't shoot the messenger, I was just coping what I saw used elsewhere :)Also, I said I was playing around with doing an XML page, I'm not making one on a professional level to be used in real-life documents, so why should it matter how if I'm using CSS or XSL?You play with something first, THEN you do it right :)Who cares "xslt is the future", doesn't bother me.

Link to comment
Share on other sites

I'm sorry if I seemed a bit offensive in my last post. Didn't mean it to be so.Anyway. Did the "display: block" thing I suggested work?Oh, yes... I forgot to mention it in the previous post. Place each of your rows in separated elements and apply the "display: block" to the "text" element.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...