Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Failing to Add HTML Tags in XSL File

 
Natalie Kopple
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try to add HTML tags to improve the "look" of the output that is translated by XSL (My XSL works well). However, all the HTML tags are ignored. Please help.

My XSL code is shown below:
 
Paul Clapham
Sheriff
Pie
Posts: 20770
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see any "HTML tags" in that XSLT code. Could you explain what you meant by that? Or perhaps you could show us the output that you got and explain why it's different from the output you expected?
 
Natalie Kopple
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I cannot even add <html> <body> </body> </html> anywhre to that XSL file. Once I added <html> </html> there, my IDE shows errors.
 
Paul Clapham
Sheriff
Pie
Posts: 20770
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But that is completely different from your original post. "Ignored" and "caused error messages" are not the same thing at all. Please try to post accurate descriptions of your problem.

Anyway I assume you want those HTML tags to surround everything you generate. That's just a guess, but usually that's what those tags are for. I would do that like this:


 
Natalie Kopple
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did what you suggested and added <h1> Do You See Me!!!</h1>. The <h1> Do You See Me!!!</h1> is displayed as plain text. The "Do You See Me!!!" does not become very big.


 
Paul Clapham
Sheriff
Pie
Posts: 20770
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Natalie Kopple wrote:The <h1> Do You See Me!!!</h1> is displayed as plain text. The "Do You See Me!!!" does not become very big.


And where exactly did you try to display that? Also, what exactly did you try to display?

Here's what I expect: You will run the XSLT and it will produce some output. You will take that output, which is some kind of HTML, and display it in a browser. The browser will do its usual processing and display your h1 element as a heading.

Here's what I think: You did something other than that and didn't tell us about it.
 
Natalie Kopple
Ranch Hand
Posts: 325
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the code that I originally posted, there is a segment of code (please see below). I tried to add HTML tags at different places in that segment of code, all I got are compilation errors. How may I change the code so that I could add HTML tags there? Thank you.

 
Paul Clapham
Sheriff
Pie
Posts: 20770
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't have to make any changes to be able to add HTML tags to that code. Of course you'd have to add them in such a way that the resulting code was still valid XML; I'm guessing you didn't do that.

However if you want something better than just guesses, you ought to provide better information. Like an example of something which didn't work, along with the actual error messages you got.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic