How to split up HTML table XSL??

T

ted

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
 
S

Sean Bright

ted said:
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
 
T

ted

Sean Bright said:
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.
 
S

Sean Bright

ted said:
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
 
D

Dimitre Novatchev

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
 
D

Dimitre Novatchev

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top