Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...One of the best run forums I have used in years! ...I like the way the site is organized and your no tolerance of flames..."

Geography

Where in the world do Tek-Tips members come from?

HTML elements in XML ( <br>, <p>, <b> etc..)Helpful Member! 

nobuns (Programmer)
26 Feb 01 13:02
I'm performing a transformNode command in my ASP page, applying a style sheet (XSL) to an XML document.

Everything appears to work fine, but any HTML elements in the XML file (like <br/>'s) aren't appearing in the HTML output.  I view the source, and it's like they're just not there at all...

What am I missing?  Any help would be greatly appreciated..

Helpful Member!  palbano (Programmer)
28 Feb 01 21:30
I'm just guessing based on your post that you want to put the HTML elements into your XSL file rather than your XML file.

-pete
nobuns (Programmer)
1 Mar 01 8:48
I do have HTML elements in the XSL file, that works fine.

But I would like to have just some <br/>'s in the XML itself for formatting some of the data within the fields.

For example, one of the nodes is like this:

<activity>I enjoy fishing, skiing, and hiking.<br/>I also enjoy computers, web development, etc..</activity>

It would be nice to have the <br/> in there, otherwise it's difficult to get the info to display exactly how I want it.

I realize that in the event that some other platform would need to access the XML data, having HTML elements would probably not be a good idea...but this is not the case here.  It's just for the web.

thanks in advance,

-Bill
palbano (Programmer)
1 Mar 01 15:47
Bill,

That's fine but the tag is going to be treated as XML not HTML, you can't change that.

I can think of two techniques right off.

1) Modify the XSL to put in an HTML <br> tag for each XML <br/> element. I don't know the syntax for that or I would show the code. Maybe someone else knows?

2) Use a CDATA Section to hold your HTML content. That way the HTML tags will not be interpreted as XML.

Hope this helps
-pete
nobuns (Programmer)
7 Mar 01 8:27
Thanks, I will look into this.

-Bill

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close