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

How render the xm-insertion_mark_start & end

Expand Messages
  • ca_xiaoyi2003
    What I process the insertion of XML according the following.
    Message 1 of 4 , Apr 5, 2004
    • 0 Attachment
      What I process the insertion of XML according the following.
      <xsl:template match="processing-instruction('xm-
      insertion_mark_start')">
      <xsl:text disable-output-escaping="yes"><fo:inline
      text-decoration="underline"></xsl:text>
      </xsl:template>
      <xsl:template match="processing-instruction('xm-
      insertion_mark_end')">
      <xsl:text disable-output-
      escaping="yes"></fo:inline></xsl:text>
      </xsl:template>

      but when I check the rendered PDF file .But found the in the content
      of PDF, the inserted content displaly in follwoing :
      <fo:inline font-style="italic">this is new content ... </fon:inline>
      instead of the expecting outcome.

      So I am not sure what is the problem for the stylesheet.

      any suggestion is highly appreciated.

      thank you very much
    • ca_xiaoyi2003
      If you run in the way, it is OK. xalan -xml .. -xsl .. -out test.fo fop test.fo test.pdf then the outcome is what I want. but if I run rendition in this way,
      Message 2 of 4 , Apr 5, 2004
      • 0 Attachment
        If you run in the way, it is OK.
        xalan -xml .. -xsl .. -out test.fo
        fop test.fo test.pdf
        then the outcome is what I want.
        but if I run rendition in this way, then it is problem
        fop -xml -xsl -pdf test.pdf

        --- In XSL-FO@yahoogroups.com, "ca_xiaoyi2003" <ca_xiaoyi2003@y...>
        wrote:
        > What I process the insertion of XML according the following.
        > <xsl:template match="processing-instruction('xm-
        > insertion_mark_start')">
        > <xsl:text disable-output-escaping="yes"><fo:inline
        > text-decoration="underline"></xsl:text>
        > </xsl:template>
        > <xsl:template match="processing-instruction('xm-
        > insertion_mark_end')">
        > <xsl:text disable-output-
        > escaping="yes"></fo:inline></xsl:text>
        > </xsl:template>
        >
        > but when I check the rendered PDF file .But found the in the
        content
        > of PDF, the inserted content displaly in follwoing :
        > <fo:inline font-style="italic">this is new content ...
        </fon:inline>
        > instead of the expecting outcome.
        >
        > So I am not sure what is the problem for the stylesheet.
        >
        > any suggestion is highly appreciated.
        >
        > thank you very much
      • G. Ken Holman
        ... The above approach to producing the result tree is inappropriate for element nodes: above you are creating text nodes, you are not creating element nodes
        Message 3 of 4 , Apr 5, 2004
        • 0 Attachment
          At 2004-04-05 14:05 +0000, ca_xiaoyi2003 wrote:
          >What I process the insertion of XML according the following.
          > <xsl:template match="processing-instruction('xm-
          >insertion_mark_start')">
          > <xsl:text disable-output-escaping="yes"><fo:inline
          >text-decoration="underline"></xsl:text>
          > </xsl:template>
          > <xsl:template match="processing-instruction('xm-
          >insertion_mark_end')">
          > <xsl:text disable-output-
          >escaping="yes"></fo:inline></xsl:text>
          > </xsl:template>

          The above approach to producing the result tree is inappropriate for
          element nodes: above you are creating text nodes, you are not creating
          element nodes named "fo:inline".

          >but when I check the rendered PDF file .But found the in the content
          >of PDF, the inserted content displaly in follwoing :
          ><fo:inline font-style="italic">this is new content ... </fon:inline>

          Yes, that is what I expect from your stylesheet.

          >instead of the expecting outcome.

          Your expectations are incorrect. You cannot "synthesize" element nodes
          using disable-output-escaping= ... this only happens to work in two-phase
          data flows where you are creating an instance of XSL-FO to be rendered,
          instead of a tree of XSL-FO to be rendered.

          >So I am not sure what is the problem for the stylesheet.

          You will have to find an algorithm in your stylesheet that creates an
          element node named "fo:inline" as a parent to all of the content between
          the two processing instructions. Not only is this not easy, but because
          processing instructions are ancillary to the hierarchy of the document it
          is easily the situation where doing so is impossible because the result
          would not be well-formed.

          You have created an almost impossible general requirement through the use
          of processing-instructions instead of using hierarchy. Easy situations can
          be handled easily, but your XML authors can equally easily set up a
          situation where your stylesheet will have to go through contorted gyrations
          in an attempt to accommodate the out-of-hierarchy markup.

          I hope this is considered helpful.

          ....................... Ken

          --
          Public courses: Spring 2004 world tour of hands-on XSL instruction
          Each week: Monday-Wednesday: XSLT/XPath; Thursday-Friday: XSL-FO
          Hong Kong May 17-21; Bremen Germany May 24-28; Helsinki June 14-18

          World-wide on-site corporate, govt. & user group XML/XSL training.
          G. Ken Holman mailto:gkholman@...
          Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
          Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
          Male Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
        • G. Ken Holman
          Yes, this is as I would expect and as I documented in my previous response. ... Because you are serializing the result tree text nodes into characters that are
          Message 4 of 4 , Apr 5, 2004
          • 0 Attachment
            Yes, this is as I would expect and as I documented in my previous response.

            At 2004-04-05 14:39 +0000, ca_xiaoyi2003 wrote:
            >If you run in the way, it is OK.
            >xalan -xml .. -xsl .. -out test.fo
            >fop test.fo test.pdf
            > then the outcome is what I want.

            Because you are serializing the result tree text nodes into characters that
            are interpreted "downstream" as being markup.

            >but if I run rendition in this way, then it is problem
            > fop -xml -xsl -pdf test.pdf

            The processor cannot see any <fo:inline> elements because you do not have
            any <fo:inline> element nodes, you only have text nodes that *look* like
            they would be elements if the text were to be realized in an outboard file,
            which it isn't, so it won't, so you don't, so it can't.

            The above behaviour is entirely expected.

            I hope this helps.

            ......................... Ken


            --
            Public courses: Spring 2004 world tour of hands-on XSL instruction
            Each week: Monday-Wednesday: XSLT/XPath; Thursday-Friday: XSL-FO
            Hong Kong May 17-21; Bremen Germany May 24-28; Helsinki June 14-18

            World-wide on-site corporate, govt. & user group XML/XSL training.
            G. Ken Holman mailto:gkholman@...
            Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
            Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
            Male Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc
          Your message has been successfully submitted and would be delivered to recipients shortly.