SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Transforming Blockquotes

    Ok, I am having a serious problem involving the markup of paragraphs that contain blockquotes. I originally posted this in the CSS/HTML section here:


    http://www.sitepoint.com/forums/showthread.php?t=251239

    Basically, I have XML data of some court decisions. Within that data there are blockquotes tagged in XML in a grammatically and structurally correct way (i.e., as a child element of a paragraph). I would like to transform that XML into HTML using XSL. During the transformation, the document's paragraphs will be counted, numbered, and set with ids to allow direct linking to specific paragraphs.

    The crux of the problem is that HTML does not allow a blockquote to be a child of a paragraph. Actually, it "allows it" but it results in some crappy side effects, which are detailed in the other post.

    If I can't find a HTML workaround, is there a recommended way to transform this:

    Code:
    <paragraph num="5">yadda yadda:
      <blockquote>blah blah blah</blockquote>
    yadda yadda</paragraph>
    into this:

    Code:
    <p id="#5">yadda yadda</p>
      <blockquote><p>blah blah blah</p></blockquote>
    <p class="cont">yadda yadda</p>
    If I am right, this is a problem because I can not easily refer specifically to the XML paragraph's text that follows the blockquote (to place it in the "cont" p tag).

    Or is there a way of doing this I am unaware of?

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2004
    Location
    Ireland
    Posts
    91
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how about transforming the blockquotes into span tags with quotes inside and using css to do the rest as far as how the text looks?

  3. #3
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You would think that would work, wouldn't you.

    It turns out that, while using a span allows the formatting (e.g., font or line height) to carryover to the post-blockquote paragraph text. It also applies the paragraph's indent to the text (making it appear as a new paragraph). At least, this is the flawed way IE6 works. It doesn't seem to happen in the other browsers.

  4. #4
    SitePoint Member
    Join Date
    Apr 2005
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The IE bug results in one set of paragraph tags, but with two indents.

    I guess this is really a double IE6 bug problem (1) blockquote as a child of a p tag results in lost formatting, (2) a paragraph broken by a block object results in a new paragraph indent.

    Taken together, these two bugs mean (unless there is another creative solution out there) that I am forced to present the html with added false p tags around text that follows a blockquote. So, that brings me back to the XSL problem of transforming correctly marked-up data into the hacked HTML markup.

    Any ideas? Anyone?

    This problem is driving me crazy, as other issues are dependent on the answer.

    I can't imagine I am the first person to confront this problem, please help.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •