xml Constant

Discussion in 'XML' started by elhajjar, Oct 17, 2003.

  1. elhajjar

    elhajjar Guest

    Hi,

    I have a block of code (title of table with some images) repeating
    many time in my XSL file. I do not want to repeat this block of code
    many time, I like to use like constant to define the block of code to
    it.

    And in my XSL file, put this constant to have the block of code.

    How can I do this in XSL?

    Thanks,
     
    elhajjar, Oct 17, 2003
    #1
    1. Advertising

  2. In article <>,
    elhajjar <> wrote:

    % I have a block of code (title of table with some images) repeating
    % many time in my XSL file. I do not want to repeat this block of code
    % many time, I like to use like constant to define the block of code to
    % it.

    How about using a variable?
    <xsl:variable name="block">
    <whatever>you like</whatever>
    </xsl:variable>

    % And in my XSL file, put this constant to have the block of code.

    <xsl:copy-of select="$block"/>

    Note that the variable value must be well-formed.
    --

    Patrick TJ McPhee
    East York Canada
     
    Patrick TJ McPhee, Oct 19, 2003
    #2
    1. Advertising

  3. elhajjar wrote:
    > Hi,
    >
    > I have a block of code (title of table with some images) repeating
    > many time in my XSL file. I do not want to repeat this block of code
    > many time, I like to use like constant to define the block of code to
    > it.
    >
    > And in my XSL file, put this constant to have the block of code.
    >
    > How can I do this in XSL?


    <xsl:template name="myBlock">
    <!-- the code -->
    </xsl:template>

    <xsl:call-template name="myBlock"/>
    --
    Johannes Koch
    In te domine speravi; non confundar in aeternum.
    (Te Deum, 4th cent.)
     
    Johannes Koch, Oct 20, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Christopher M. Lusardi
    Replies:
    1
    Views:
    4,100
  2. Martin Magnusson
    Replies:
    2
    Views:
    512
    John Harrison
    Oct 8, 2004
  3. Tor Erik Soenvisen
    Replies:
    14
    Views:
    565
    Tim Roberts
    Nov 23, 2006
  4. Replies:
    4
    Views:
    343
    Keith Thompson
    Dec 14, 2006
  5. Replies:
    13
    Views:
    12,943
    Kai-Uwe Bux
    Jan 22, 2007
Loading...

Share This Page