How to split up HTML table XSL??

Discussion in 'XML' started by ted, Dec 16, 2003.

  1. ted

    ted Guest

    Hello,

    I have a HTML table in my XSL that basically handles the layout of the
    whole page. I'm using xsl:include to split up the XSL into separate
    files.

    Is there a trick or technique to put part of a HTML table (without
    closing a td or tr tag) in one of those separate files? Right now I
    need to close every tag or the transformation will fail. For instance,
    I can't have "<table><tr><td>some stuff" in one file and
    "</td></tr></table>" in another file and include them into the
    "master" xsl.

    TIA,
    Ted
    ted, Dec 16, 2003
    #1
    1. Advertising

  2. ted

    Sean Bright Guest

    ted wrote:

    > Hello,
    >
    > I have a HTML table in my XSL that basically handles the layout of the
    > whole page. I'm using xsl:include to split up the XSL into separate
    > files.
    >
    > Is there a trick or technique to put part of a HTML table (without
    > closing a td or tr tag) in one of those separate files? Right now I
    > need to close every tag or the transformation will fail. For instance,
    > I can't have "<table><tr><td>some stuff" in one file and
    > "</td></tr></table>" in another file and include them into the
    > "master" xsl.
    >
    > TIA,
    > Ted


    XSL has to be valid XML as well. I'm guessing, but I seriously doubt
    you can do what you are trying to do (at least the way you are trying to
    do it :))

    Why does the included file need to close the tags? Can you give me an
    example of what you are trying to do?

    Sean
    Sean Bright, Dec 16, 2003
    #2
    1. Advertising

  3. ted

    ted Guest

    Sean Bright <> wrote in message news:<>...
    > ted wrote:
    >
    > > Hello,
    > >
    > > I have a HTML table in my XSL that basically handles the layout of the
    > > whole page. I'm using xsl:include to split up the XSL into separate
    > > files.
    > >
    > > Is there a trick or technique to put part of a HTML table (without
    > > closing a td or tr tag) in one of those separate files? Right now I
    > > need to close every tag or the transformation will fail. For instance,
    > > I can't have "<table><tr><td>some stuff" in one file and
    > > "</td></tr></table>" in another file and include them into the
    > > "master" xsl.
    > >
    > > TIA,
    > > Ted

    >
    > XSL has to be valid XML as well. I'm guessing, but I seriously doubt
    > you can do what you are trying to do (at least the way you are trying to
    > do it :))
    >
    > Why does the included file need to close the tags? Can you give me an
    > example of what you are trying to do?
    >
    > Sean



    I'm trying to put parts of my template in separate files so that I can
    reuse them in other templates. For instance I'd like to put
    "<table><tr><td>Some navigation elements" in one file and
    "</td></tr><tr><td>Main content</td></tr></table>" in another file.
    ted, Dec 17, 2003
    #3
  4. ted

    Sean Bright Guest

    ted wrote:
    > Sean Bright <> wrote in message news:<>...
    >
    >>ted wrote:
    >>
    >>
    >>>Hello,
    >>>
    >>>I have a HTML table in my XSL that basically handles the layout of the
    >>>whole page. I'm using xsl:include to split up the XSL into separate
    >>>files.
    >>>
    >>>Is there a trick or technique to put part of a HTML table (without
    >>>closing a td or tr tag) in one of those separate files? Right now I
    >>>need to close every tag or the transformation will fail. For instance,
    >>>I can't have "<table><tr><td>some stuff" in one file and
    >>>"</td></tr></table>" in another file and include them into the
    >>>"master" xsl.
    >>>
    >>>TIA,
    >>>Ted

    >>
    >>XSL has to be valid XML as well. I'm guessing, but I seriously doubt
    >>you can do what you are trying to do (at least the way you are trying to
    >>do it :))
    >>
    >>Why does the included file need to close the tags? Can you give me an
    >>example of what you are trying to do?
    >>
    >>Sean

    >
    >
    >
    > I'm trying to put parts of my template in separate files so that I can
    > reuse them in other templates. For instance I'd like to put
    > "<table><tr><td>Some navigation elements" in one file and
    > "</td></tr><tr><td>Main content</td></tr></table>" in another file.


    Well, I don't know what the structure of your HTML ultimately looks
    like, but you could modify it so you are generating full tables in each
    of the included files instead of splitting up the way you are.
    something like:

    <table>
    <tr>
    <td width="100">
    <xsl:include href="nav.xsl"/>
    </td>
    <td>
    <xsl:include href="content.xsl"/>
    </td>
    </tr>
    </table>

    and then generate a full table in the includes:

    nav.xsl:
    <table>
    <tr>
    <td><a href="foo.html">foo</a></td>
    </tr>
    <tr>
    <td><a href="bar.html">bar</a></td>
    </tr>
    <tr>
    <td><a href="blah.html">blah</a></td>
    </tr>
    </table>

    Anyway. Just an idea.

    Sean
    Sean Bright, Dec 17, 2003
    #4
  5. > Well, I don't know what the structure of your HTML ultimately looks
    > like, but you could modify it so you are generating full tables in each
    > of the included files instead of splitting up the way you are.
    > something like:
    >
    > <table>
    > <tr>
    > <td width="100">
    > <xsl:include href="nav.xsl"/>
    > </td>
    > <td>
    > <xsl:include href="content.xsl"/>


    This cannot be done.

    xsl:include is a global xslt instruction -- must be a child of
    xsl:stylesheet.


    =====
    Cheers,

    Dimitre Novatchev.
    http://fxsl.sourceforge.net/ -- the home of FXSL
    Dimitre Novatchev, Dec 17, 2003
    #5
  6. >
    > I'm trying to put parts of my template in separate files so that I can
    > reuse them in other templates. For instance I'd like to put
    > "<table><tr><td>Some navigation elements" in one file and
    > "</td></tr><tr><td>Main content</td></tr></table>" in another file.


    No, this is impossible!!!

    All the elements above (table, tr, td) are not closed (or started) in the
    two files you intend to use as XML documents.

    Your two files must be well-formed XML documents. By definition, a file,
    which contains only one of the pair of (start-tag, end-tag) is not
    well-formed.
    Stop regarding an XML document as a string of characters, which may be split
    anywhere to produce two other XML documents -- this is wrong.

    An XML document is a tree of nodes. A node cannot be "split in half" between
    two different xml documents.



    =====
    Cheers,

    Dimitre Novatchev.
    http://fxsl.sourceforge.net/ -- the home of FXSL
    Dimitre Novatchev, Dec 17, 2003
    #6
    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. Replies:
    1
    Views:
    3,583
    A. Bolmarcich
    May 27, 2005
  2. Replies:
    2
    Views:
    451
  3. Kourosh
    Replies:
    6
    Views:
    838
    Peter Flynn
    May 17, 2006
  4. Carlos Ribeiro
    Replies:
    11
    Views:
    684
    Alex Martelli
    Sep 17, 2004
  5. trans.  (T. Onoma)

    split on '' (and another for split -1)

    trans. (T. Onoma), Dec 27, 2004, in forum: Ruby
    Replies:
    10
    Views:
    201
    Florian Gross
    Dec 28, 2004
Loading...

Share This Page