Loading ...
Sorry, an error occurred while loading the content.

use of fo: namespace

Expand Messages
  • hgazdik@lww.com
    Hi, I am trying to use the xmlns:fo= http://www.w3.org/1999/XSL/Format in my stylesheet to transform to HTML pages. Is this possible at this point?? I am
    Message 1 of 2 , Jan 15, 2001
    • 0 Attachment
      Hi,

      I am trying to use the xmlns:fo="http://www.w3.org/1999/XSL/Format"
      in my stylesheet to transform to HTML pages.
      Is this possible at this point?? I am using the latest msxml3.dll.
      I am also going to try and use this for ordered lists and items..
      As of right now I am using a template for the emphasis tags:
      <xsl:template match="EMPHASIS">
      <b>
      <xsl:apply-templates/>
      </b>
      </xsl:template>
      But would like to use:
      <xsl:template match="EMPHASIS">
      <fo:inline-sequence font-weight="bold">
      <xsl:apply-templates/>
      </fo:inline-sequence>
      </xsl:template>


      I appreciate any help,
      Heather Gazdik


      This is what I get so far:
      XML file:
      <?xml version="1.0" encoding="UTF-8"?>
      <QUESTION ID="q2-3">
      <PARA>What is Ogilvie's syndrome?</PARA>
      <RESPONSES>
      <ANSWER Answer="Correct">
      <PARA>Massive <EMPHASIS EMPH-
      TYPE="bold">nonobstructive</EMPHASIS> colonic dilatation</PARA>
      </ANSWER>
      </RESPONSES>
      </QUESTION>

      XSL file:
      <?xml version="1.0" encoding="UTF-8"?>
      <xsl:stylesheet version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:fo="http://www.w3.org/1999/XSL/Format">

      <xsl:template match="/">
      <html>
      <head>
      <body>
      <p>
      <a href="#answer"><xsl:value-of
      select="QUESTION/PARA"/></a>

      </p><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br
      /><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>

      <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><b
      r/>

      <xsl:apply-templates
      select="QUESTION//ANSWER"/>
      <p>
      <input type="button" value="PREV" name="btnPrevious"
      onClick="getPrevious()"/>
      <input type="button" value="NEXT" name="btnNext"
      onClick="getNext()"/>
      <input type="button" value="MISSED" name="btnMissed"
      onClick="getMIssed()"/>
      <input type="button" value="TOPICS" name="btnMissed"
      onClick="getTopics()"/>

      </p>
      </body>
      </head>
      </html>

      </xsl:template>

      <xsl:template match="QUESTION/ANSWER">
      <xsl:apply-templates
      select="EMPHASIS"/>
      <a name="answer"><xsl:value-of
      select="PARA"/></a>
      </xsl:template>
      <xsl:template match="EMPHASIS">
      <fo:inline-sequence font-weight="bold">
      <xsl:apply-templates/>
      </fo:inline-sequence>
      </xsl:template>


      </xsl:stylesheet>

      HTML source:

      <html xmlns:fo="http://www.w3.org/1999/XSL/Format">
      <head>
      <META http-equiv="Content-Type" content="text/html; charset=UTF-16">
      <body>
      <p><a href="#answer">What is Ogilvie's syndrome?
      </a></p><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><b
      r><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
      <br><br><br><br>Massive <fo:inline-sequence font-
      weight="bold">nonobstructive</fo:inline-sequence> colonic
      dilatation<p><input type="button" value="PREV" name="btnPrevious"
      onClick="getPrevious()"><input type="button" value="NEXT"
      name="btnNext" onClick="getNext()"><input type="button"
      value="MISSED" name="btnMissed" onClick="getMIssed()"><input
      type="button" value="TOPICS" name="btnMissed" onClick="getTopics
      ()"></p>
      </body>
      </head>
      </html>
    • AndrewWatt2001@aol.com
      In a message dated 15/01/01 18:14:28 GMT Standard Time, hgazdik@lww.com ... Heather, I am not entirely sure what you are asking. I think what you are saying is
      Message 2 of 2 , Jan 15, 2001
      • 0 Attachment
        In a message dated 15/01/01 18:14:28 GMT Standard Time, hgazdik@...
        writes:

        > I am trying to use the xmlns:fo="http://www.w3.org/1999/XSL/Format"
        > in my stylesheet to transform to HTML pages.
        > Is this possible at this point?? I am using the latest msxml3.dll.
        > I am also going to try and use this for ordered lists and items..
        > As of right now I am using a template for the emphasis tags:
        > <xsl:template match="EMPHASIS">
        >
        > <xsl:apply-templates/>
        >
        > </xsl:template>
        > But would like to use:
        > <xsl:template match="EMPHASIS">
        > <fo:inline-sequence font-weight="bold">
        > <xsl:apply-templates/>
        > </fo:inline-sequence>
        > </xsl:template>
        >
        >
        > I appreciate any help,
        > Heather Gazdik

        Heather,

        I am not entirely sure what you are asking. I think what you are saying is
        that you have an XML source document, you want to transform it to HTML and to
        display it with emphasis on particular qualifying terms and had been trying
        to use/incorporate XSL-FO.

        Could you please use plain text when posting? I think your mail editor is set
        to send HTML and that gets terribly mangled by the time it gets to this end.

        OK ... to try and answer your question.

        To the best of my knowledge there is no browser which can display XSL-FO
        mixed with HTML/XHTML. I may be wrong here because I know lots of people are
        working on new tools. As of now I don't know of any such browser/viewer.

        Assuming I am correct on the absence of such viewer then you can't do it
        (yet).

        You could get the appearance you wanted with XSLT to create the HTML/XHTML
        and CSS to provide the emphasis on certain elements. Simply apply an XSLT
        template to contain the content of what I am calling the <qualifier> element
        in HTML tags.

        If you only want to style XML on the web then CSS (despite browser
        inconsistencies in implementation) will do quite a lot of what you need, when
        combined with XSLT to produce HTML/XHTML.

        Alternatively, you could style your XML source directly but that limits your
        options at present - essentially to use on IE5.

        Let's say you wanted to have the output which includes

        <qualifier>non-obstructive</qualifier>

        then you could achieve the kind of appearance you are seeking by using a CSS
        which include the following rule:

        qualifier {font-weight:bold;}

        assuming you already have font family and font size appropriately set for the
        containing text/elements.

        I hope that helps.

        Andrew Watt
      Your message has been successfully submitted and would be delivered to recipients shortly.