A
Andrew Fisher
Hi all,
I am building a site at the moment that as you'd expect takes an XML
file [or data from DB] and then uses XSLT to output html, wml etc.
Now the question I have has eluded me for a couple of days now and to
be honest I am pulling my hair out.
Heres what I have: Take the home page for example, it pulls out news
items from the file server [stored in xml] and then has a a "news in
brief" section which has the first 100 chars from each news articl and
a link to the actual article for more info...
so xml doc can be summarised thus:
<homepage>
...
<newsitems>
<news>
<title>the title</title>
<bodytext>some document information here that can be quite long
and can also contain tags for paras, bold and italic</bodytext>
</news>
...
<news>
<title>the title</title>
<bodytext>some document information here that can be quite long
and can also contain tags for paras, bold and italic</bodytext>
</news>
</newsitems>
...
</homepage>
Now assume from the example given above I want to limit the body text
to 15 chars output from all that is there, what XSL would I apply to
it to make it do that?
All responses very much welcomed, even speculation about how one might
do it...
Cheers
Andrew F
I am building a site at the moment that as you'd expect takes an XML
file [or data from DB] and then uses XSLT to output html, wml etc.
Now the question I have has eluded me for a couple of days now and to
be honest I am pulling my hair out.
Heres what I have: Take the home page for example, it pulls out news
items from the file server [stored in xml] and then has a a "news in
brief" section which has the first 100 chars from each news articl and
a link to the actual article for more info...
so xml doc can be summarised thus:
<homepage>
...
<newsitems>
<news>
<title>the title</title>
<bodytext>some document information here that can be quite long
and can also contain tags for paras, bold and italic</bodytext>
</news>
...
<news>
<title>the title</title>
<bodytext>some document information here that can be quite long
and can also contain tags for paras, bold and italic</bodytext>
</news>
</newsitems>
...
</homepage>
Now assume from the example given above I want to limit the body text
to 15 chars output from all that is there, what XSL would I apply to
it to make it do that?
All responses very much welcomed, even speculation about how one might
do it...
Cheers
Andrew F