Solved

link .css in XSL doesn't show supposed effect

Posted on 2014-03-01
5
373 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 500 total points
ID: 39979749
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

691 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