[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

link .css in XSL doesn't show supposed effect

Posted on 2014-03-01
5
Medium Priority
?
390 Views
Last Modified: 2014-04-05
Dear all,
I generate some html using xml and xsl ,
I need to use .CSS files , I add references to .css file on my xsl file like this:
<xsl:text disable-output-escaping='yes'>&lt;!DOCTYPE html></xsl:text>
<html>
  <head>

<link href="http://fonts.googleapis.com/css?family=Open+Sans:600,400" rel="stylesheet" type="text/css" media="screen" />
<link href="http://xxx.org/css/bootstrap.css" rel="stylesheet" type="text/css" media="screen" />
<link href="http://xxx.org/css/font-awesome.min.css" rel="stylesheet" type="text/css" media="screen" />
<link href="http://xxx.org/css/tinyscrollbar.css" rel="stylesheet" type="text/css"   media="screen"  />

Open in new window


but there is no effect on the output, I can c the link to stylesheets but there is no effect on the output html.
any solution?
0
Comment
Question by:ethar1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 39898283
Hi, you need to give us more information.
How do you do the XSLT? Serverside or clientside?
There are some possible issues client side because the DOM does not always reload causing the elements not always being connected to the right CSS properties

If you are pushing the XML, make sure you have the mimetype set right

If you do this server side, make sure your serialisation is set to html

It feels uncorrect that you have a doctype hacked in other than using the right serialisation settings. I feel you need to do that in order to avoid the system and public identifier to be required. I would go for a clean approach with doctype public attributes

Best approach for getting the correct result on a server transform is debugging the result html and make sure it works and then works towards that correct endresult

When serving, always make sure that you serve it up with the correct mimetype
0
 

Author Comment

by:ethar1
ID: 39898711
Thanks for your reply
I use C# XslCompiledTransform Transform(xmlReader, argsList, xmlWriter)

can I add the css in the c# code?

How do you do the XSLT? server side or client side?
> server side

If you are pushing the XML, make sure you have the mimetype set right
what do you means? about the mimetype the site can easily display the css style if I browse any other page ( or html page ).

If you do this server side, make sure your serialization is set to html
How to make sure my serialisation  is set to html?

It feels uncorrect that you have a doctype hacked in other than using the right serialization settings.
Do you means I should remove the DocType from XSL?

thanks
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 39898893
On debugging, make sure your XSLT transformation result is rendered correctly by a browser.
So save the transformation result as a file (you most likely need to twiddle a bit after that)
or test your XSLT in an IDE

about the serialisation.
I believe you can tell the C# serialiser to resoect the settings of the xsl:outpul
XmlWriterSettings ws = xslt.OutputSettings.Clone();

make the xsl:output method="html"

are you doing html5?
If not, I would suggest to have real doctype references
0
 

Author Comment

by:ethar1
ID: 39904517
about the serialisation.
I believe you can tell the C# serialiser to resoect the settings of the xsl:outpul
XmlWriterSettings ws = xslt.OutputSettings.Clone();
Could you please descript or refer to a url.
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 2000 total points
ID: 39979749
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question