Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > How to split up HTML table XSL??

Reply
Thread Tools

How to split up HTML table XSL??

 
 
ted
Guest
Posts: n/a
 
      12-16-2003
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
 
Reply With Quote
 
 
 
 
Sean Bright
Guest
Posts: n/a
 
      12-16-2003
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
 
Reply With Quote
 
 
 
 
ted
Guest
Posts: n/a
 
      12-17-2003
Sean Bright <> wrote in message news:<8uOdnUfZ_difx0KiU->...
> 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.
 
Reply With Quote
 
Sean Bright
Guest
Posts: n/a
 
      12-17-2003
ted wrote:
> Sean Bright <> wrote in message news:<8uOdnUfZ_difx0KiU->...
>
>>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
 
Reply With Quote
 
Dimitre Novatchev
Guest
Posts: n/a
 
      12-17-2003
> 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


 
Reply With Quote
 
Dimitre Novatchev
Guest
Posts: n/a
 
      12-17-2003
>
> 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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
a split is not a split Dumbell Computer Support 3 03-09-2009 10:45 PM
String#split(/\s+/) vs. String#split(/(\s+)/) Sam Kong Ruby 5 08-12-2006 07:59 PM
How can I split database results with ExecuteReader and Split? needin4mation@gmail.com ASP .Net 2 05-05-2006 10:36 PM
split on '' (and another for split -1) trans. (T. Onoma) Ruby 10 12-28-2004 06:36 AM
Small inconsistency between string.split and "".split Carlos Ribeiro Python 11 09-17-2004 05:57 PM



Advertisments