Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding formatting inside a paragraph

Status
Not open for further replies.

danylo13

Programmer
May 23, 2007
7
CA
Hi,

my XML tree currently looks like this:
<Header>
<Body>
<Text></Text>
<Subheader>
<Body>
<Text></Text>
</Body>
</Subheader>
</Body>
</Header>

I basically parse this XML file to display a html document which will have the form:
Header

// some text here

Subheader

// Some more text here

My question is what happens if inside the text portions of either Header or Subheader I want do some formatting to some words (i.e. bold, italics or undeline). Is there a way to do this other than including directly inside the text the html tags (like <b></b>). I want it to be so that anyone who uses my skeleton xml file would have to just copy/paste their text and almost everything would be formatted for them (minimal effort required from them).
 
>Is there a way to do this other than including directly inside the text the html tags (like <b></b>).
Sure you can do all the html stylistic formatting from within the xsl document (and that is even the preferrable approach).

The task will be much easier if the semantic markup is done on the text to cut-and-paste, but that is unlikely to happen per your description.

In that case, you have to maintain a word (lookup) list you want to be displayed bold. In the template matching <text> node's text, you locate all the occurrences of them and wrap them with <b> tag. Easier to map out the reasoning than put into practice that I would anticipate _many_ lines to get it done.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top