473,382 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

putting HTML into XSL files

Hi all, from every example I've ever seen on using XSL files, the user is able to put HTML into the XSL file

Well, I'm making use of the XPathDocument and XSLTransform classes to transform some XML content into HTML. I would like to include "img" tags and potentially "br" tags in the XSL file, but I get errors like this

The 'img' start tag on line '22' doesn't match the end tag of 'td' in file 'file:///c:/inetpub/wwwroot/SomeApplication/someXSLFile.xsl'. Line 22, position 33.

when I call the XSLTransform.Load method - is there some way I can stop the Load method from validating the input (which it seems to think is XML)

I've successfully used the above code to do transforms, but I wanted to add some new formatting to the HTML that is contained in the XSL file - is there a way to do this? Maybe I could do an HTML include in the XSL file, so that it doesn't try to validate the included file of just HTML

Thanks
Novice
Nov 12 '05 #1
7 3148
Try this:

<img ... /> and <br />

Brian

Nov 12 '05 #2
Hi,
There is no way to prevent the Load from checking for well-formedness.

A common way to workaround your problem is to have closing tags for img &
br. HTML browsers don't simply ignore closing tgs for img & br without
complaining.

Cheers,
-Naraen
----
"Novice" <6tc1ATqlinkDOTqueensuDOTca> wrote in message
news:F8**********************************@microsof t.com...
Hi all, from every example I've ever seen on using XSL files, the user is able to put HTML into the XSL file.
Well, I'm making use of the XPathDocument and XSLTransform classes to transform some XML content into HTML. I would like to include "img" tags
and potentially "br" tags in the XSL file, but I get errors like this:
The 'img' start tag on line '22' doesn't match the end tag of 'td' in file 'file:///c:/inetpub/wwwroot/SomeApplication/someXSLFile.xsl'. Line 22,
position 33.
when I call the XSLTransform.Load method - is there some way I can stop the Load method from validating the input (which it seems to think is XML)?
I've successfully used the above code to do transforms, but I wanted to add some new formatting to the HTML that is contained in the XSL file - is
there a way to do this? Maybe I could do an HTML include in the XSL file,
so that it doesn't try to validate the included file of just HTML?
Thanks,
Novice

Nov 12 '05 #3
That's great! Thanks for the tip - I applied the same thing to the "input" tags. I didn't know the browser could handle them being specified like that

Now I'm having a problem with certain characters - like "&" in the text of the document - for example

<html><body
This & Tha
</ body></html

Thanks
Novice
Nov 12 '05 #4
Never mind my latest question - I found that the answer is to use the entity reference:
&amp;

Unfortunately the above will likely appear as just an & - it should be (without the spaces):
& a m p ;

Thanks all,
Novice
Nov 12 '05 #5
I would like to include "img" tags and potentially "br" tags in the XSL
file, but I get errors like this:

The 'img' start tag on line '22' doesn't match the end tag of 'td' in file

'file:///c:/inetpub/wwwroot/SomeApplication/someXSLFile.xsl'. Line 22,
position 33.

the easy solution is to just be sure to properly close the img and br tags.
Ie, make it xhtml compliant:

Instead of:

<img src="monkey.gif"><br>

use:
<img src="monkey.gif" /><br />

-Darrel
Nov 12 '05 #6
> <html><body>
This & That
</ body></html>


You need to escape ampersands:

&amp;

-Darrel
Nov 12 '05 #7
"Novice" <6tc1ATqlinkDOTqueensuDOTca> wrote in message news:70**********************************@microsof t.com...
Never mind my latest question - I found that the answer is to use the entity reference:
&amp;

Unfortunately the above will likely appear as just an & - it should be (without the spaces):
& a m p ;


Not necessarily. The literal value "&amp;" can appear in a result document
by either telescoping the entity reference (works in HTML and XML),

&amp;amp;

or representing it within a CDATA section (XML output only),

<![CDATA[&amp;]]>
Derek Harmon
Nov 12 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Eric Kincl | last post by:
Hello, its been a while since I posted/looked here... my normal email client doesn't handle newsgroups :( (ximian evolution) I was wondering how you stick a file into a database, and then...
0
by: Alexey Zhilenko | last post by:
I have to perform this operation: Getting and putting files onto virtual folder on WEB site programmatically. Please advise me which component to use. Thank you.
1
by: Little | last post by:
Could someone start me on putting in a table into this code, and some HTML tags. I would to make the table below the map and have a header at the top. Thanks for the help. """ Publisher example...
59
by: Lennart Björk | last post by:
Hi All, I have a tiny program: <!doctype HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>MyTitle</title> <meta...
3
by: Asfand Yar Qazi | last post by:
For years, I've been putting everything that won't be needed outside a compilation unit in anonymous namespaces, even editing my old files that did things the 'old' way (using static linkage). ...
17
by: Plissken.s | last post by:
Hi, Can you please tell me what is the guideline in Putting implmentation in .h files? I see examples where they put the implementation of getter/setting in the .h files where funcitons is > 10...
9
by: sheri | last post by:
Hi need your expert advice. I want to put my access database online so different users in my company can use it. I can put in on a secure directory on my website. Can you direct me the best way...
4
by: Doug Laidlaw | last post by:
Thank you everybody for your help to date, and please be tolerant of a CSS beginner! I have successfully converted my site at http://www.douglaidlaw.net/boykett/ to use a free 3-column template...
68
by: zwsdotcom | last post by:
I've been looking for references for some weeks now, but haven't found an answer to the following question. I'd love some help on this: *Without* using JavaScript or other active client-side...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.