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

Re: [XSL-FO] Re: reading from external documents in XSLFO

Expand Messages
  • W. Eliot Kimber
    ... Depending on the complexity of what you re trying to do, it might be easier to implement or maintain either of these options: - Preprocess the input to do
    Message 1 of 8 , Apr 5, 2007
    • 0 Attachment
      G. Ken Holman wrote:

      > Yes, sometimes elaborate predicates are required to engage a number
      > of different conditions simultaneously.

      Depending on the complexity of what you're trying to do, it might be
      easier to implement or maintain either of these options:

      - Preprocess the input to do the filtering to an intermediate document
      and then apply the formatting rules to the intermediate result. This
      then separates the concerns of filtering from the concerns of formatting
      (this is what the DITA Open Toolkit does, for example). You can do this
      all in one style sheet or do it as two separate transforms in a pipeline.

      - Encapsulate the conditional check into one or more functions that both
      hide the details of the check and put the details into one place. This
      is easier in XSLT 2 where stylesheet-defined functions are part of the
      language, rather than an extension as they are in XSLT 1.

      Also, if your predicate statements are long and repeated, you can put
      them into an internal text entity like so:

      <!DOCTYPE xsl:stylesheet [
      <!ENTITY pred1 "this is a really long and gnarly predicate" >
      ]>
      <xsl:stylesheet>
      ...
      <xsl:template match="*[&pred1;]">
      ...
      </xsl:template>
      ...
      </xsl:template>

      Cheers,

      Eliot
      --
      W. Eliot Kimber
      Professional Services
      Innodata Isogen
      8500 N. Mopac, Suite 402
      Austin, TX 78759
      (214) 954-5198

      ekimber@...
      www.innodata-isogen.com
    • mina_hurray
      Thank you for your response. I did try using entity inside the style sheet. Somehow the style sheet is not picking up the entity name. Here is the structure:
      Message 2 of 8 , Apr 23, 2007
      • 0 Attachment
        Thank you for your response. I did try using entity inside the style
        sheet. Somehow the style sheet is not picking up the entity name.

        Here is the structure:

        <!DOCTYPE xsl:stylesheet [
        <!ENTITY Grp "document(...)/root/grp" >
        ]>

        The document() refereces an external xml file of the structure:

        <root>

        <grp>123</grp>

        </root>


        I reference this entity using &Grp; on the style sheet. But the style
        sheet is not recognizing it.

        Any suggestions will be greatly appreciated.

        --- In XSL-FO@yahoogroups.com, "W. Eliot Kimber" <ekimber@...> wrote:
        >
        > G. Ken Holman wrote:
        >
        > > Yes, sometimes elaborate predicates are required to engage a number
        > > of different conditions simultaneously.
        >
        > Depending on the complexity of what you're trying to do, it might be
        > easier to implement or maintain either of these options:
        >
        > - Preprocess the input to do the filtering to an intermediate document
        > and then apply the formatting rules to the intermediate result. This
        > then separates the concerns of filtering from the concerns of
        formatting
        > (this is what the DITA Open Toolkit does, for example). You can do this
        > all in one style sheet or do it as two separate transforms in a
        pipeline.
        >
        > - Encapsulate the conditional check into one or more functions that
        both
        > hide the details of the check and put the details into one place. This
        > is easier in XSLT 2 where stylesheet-defined functions are part of the
        > language, rather than an extension as they are in XSLT 1.
        >
        > Also, if your predicate statements are long and repeated, you can put
        > them into an internal text entity like so:
        >
        > <!DOCTYPE xsl:stylesheet [
        > <!ENTITY pred1 "this is a really long and gnarly predicate" >
        > ]>
        > <xsl:stylesheet>
        > ...
        > <xsl:template match="*[&pred1;]">
        > ...
        > </xsl:template>
        > ...
        > </xsl:template>
        >
        > Cheers,
        >
        > Eliot
        > --
        > W. Eliot Kimber
        > Professional Services
        > Innodata Isogen
        > 8500 N. Mopac, Suite 402
        > Austin, TX 78759
        > (214) 954-5198
        >
        > ekimber@...
        > www.innodata-isogen.com
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.