Problem with XML WebControl, and css stylesheet link

G

George Kustas

I am using the Xml Web control to transform an XML string insto a
readable HTML display on the page:

Xml1.DocumentContent = <XML string from my database>
Xml1.TransformSource = "./transform.xslt";
XslTransform xt = Xml1.Transform;

It works, but the css stylesheet that I'm linking to in the xslt is
ignored if I use a relative path:

<LINK REL="stylesheet" HREF="StyleSheet1.css" TYPE="text/css"/>

If I use the fully qualified path, it works:

<LINK REL="stylesheet"
HREF="http://localhost/myWebApp/StyleSheet1.css" TYPE="text/css"/>


Funny thing is, though, If I get the XML from a file using the
DocumentSource property (vs DocumentContent), it works using the
relative path!

I can solve the problem by "hardcoding" the path using the likely URL,
but I hate to have to do this. Especially since it would require that
the virtual directory is always named the same thing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top