x First time here? Check out the FAQ
Join us a the Umbraco event of the year - get your Codegarden 14 early bird ticket today
  • Avatar5posts25karma

    version 1.2 <pre> tag

    Skender Memed started this topic December 21, 2011 @ 02:06

    Hi Darren,

    Is the <pre> tag supported by version 1.2 ? I've got the structure below and the content is not showing up

    <div id="xx">
    <pre>

    hello

    world ( the body text)

    </pre>

    </div>

    and how can I upgrade it to version 2.0? I've bought one license for it , do I need to buy another one for version 2.0? if I upgrade does the new version sort out the problem?

     

    Many Thank


  • Avatar856posts2623karma
    MVPComment with ID: 100867
    Darren Ferguson posted this reply December 21, 2011 @ 02:09

    Hi - you need to match the pre tag in your XSLT.

    I'm assuming that the HTML you posted is from a rich text area you want to process?

    You can have a free upgrade from 1.2 to 2.0 if you need but your issue isn't a restriction of 1.2

    Thanks.


  • Skender Memed posted this reply December 22, 2011 @ 12:13

    Hi Darren, 

    Yes , the HTML is from rich text editor.

    How can I match it with fo ? Could you please provide me the xsl template for matching pre tag?

    Many Thanks

     


  • Avatar856posts2623karma
    MVPComment with ID: 101087
    Darren Ferguson posted this reply December 22, 2011 @ 03:44

    In the example XSL there is a template to match a paragraph tag - i'd copy that and have it match pre instead of p

    Thanks.


  • Skender Memed posted this reply December 22, 2011 @ 05:36

    Thanks for your quick reply.

    I've added a template to match the pre tag but it loses the pre-formating! 

    Do you have any idea how can I resolve this issue?

    Thanks

     


  • Avatar1976posts3784karma
    Comment with ID: 101119
    Tom Fulton posted this reply December 22, 2011 @ 06:46

    Hi,

    Check out this page:  HTML to Formatting Objects which tells you which FO elements to use in place of FO elements, it even includes templates to do the transforming.  For Pre you can use:

    <xsl:template match="pre">
      <fo:block font-family="monospace"
        white-space-collapse="false"
        wrap-option="no-wrap">
        <xsl:apply-templates select="*|text()"/>
      </fo:block>
    </xsl:template>

    And if you need any special formatting of course you can add it to the block above...

    -Tom


Please login or Sign up To post replies