Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Martin Vingaard 39 posts 60 karma points
    Mar 15, 2011 @ 11:31
    Martin Vingaard

    HTML div layout broken in XLTS/Macro

    I have creatd a content layout from structure of divs, its made so that i only have to define the div containing the rest of the divs to scale in size and keeps the laoyout.

    It all works great, but when i add this layout to my XLTS code and try to render it, everything gets nestd wrong.

    Here is the paragraph within the XLTS

    <xsl:for-each select="$currentPage/*">

      <div id="contentNewsList">
        <div id="contentT">
          <div id="contentTL" />
          <div id="contentHeadline">
            <div id="contentHeadlineL" />
            <div id="contentHeadlineTxt">
                  <xsl:value-of select="articleHeadline"  disable-output-escaping="yes"/>
            <div id="contentHeadlineR" />
          <div id="contentTR" />
          <div id="clear" />
        <div id="contentM">
          <xsl:value-of select="articleText"  disable-output-escaping="yes" />
        <div id="contentB">
          <div id="contentBL" />
          <div id="contentBR" />
          <div id="clear" />
        <div id="clear" />
      <br />

    on all other pages the Headline is within the "contentHeadlinetxt" and the content is located within the "contentM"

    But with the macro listed above everything is nested within the ContentB and the formatting is all wrong.

    Is this a known issue. Ive been troubleshooting for 4 hours now and have found NO errors in my html.

  • Tom Maton 387 posts 659 karma points
    Mar 15, 2011 @ 12:04
    Tom Maton

    Hi Martin,

    I find that in xslt if there is no content returned by XSLt it doesnt close off the tags correctly and there fore creates nested elements.

    Perhaps just do an if statement to ensure that the content exists before making the call.

    Hope this helps


  • Ian Smedley 97 posts 192 karma points
    Mar 15, 2011 @ 12:23
    Ian Smedley

    Hi, I think it's to do with self closing tags, for empty divs, took me a while to figure this one out.

    Where you have xsl:output method="xml" change it to:

    <xsl:output method="html" omit-xml-declaration="yes"/>

    see if that helps :)

  • Martin Vingaard 39 posts 60 karma points
    Mar 15, 2011 @ 12:26
    Martin Vingaard

    Being new at all this i had some trouble... thanks Ian!

    It worked like a charm!

Please Sign in or register to post replies

Write your reply to: