xslt

djohnston

Active member
Joined
Jun 1, 2006
Messages
33
Programming Experience
Beginner
Ok I am trying to display and xslt stylesheet on a webpage if anyone could explain to me the easiest way it would be greatly appreciated.

Just say i create a vs2005 web site I have an xml file and a xslt stylesheet what would you say is the easiest way to install a website.
 
Update

I think the way i worded that was a little wrong.

I need to load the stylesheet to the webpage so i can see how it is going to look when displayed.

Like i said I have the xsl and the xml i just need the information on how to load it to the webpage.
 
asp.net website

I have tried to use xmlpath, xmldatadocument, xmlcompiletransform ^ all of the above that go along with that. I cant seem to get it to display the data from the xml document into the xslt onto the webpage.

So i was wondering if anyone had any sample code they could give me because maybe im not ordering it right. So basically im just not getting the xsl stylesheet with the xml data attached to the display on the webpage.
Sample code would be very appreciated.

Thanks David
 
I am really not sure what are you trying to do ... XSL (stylesheet) is only formating XML data as they to be seen in HTML format in the browser. When you refer the XML document which is uploaded on the server it will check for the XSL file and presented with HTML tags.
Something like this:
 

Attachments

  • XSL.zip
    976 bytes · Views: 38
reply

OK check this out I just use vs 2005 to create a website from there i use the built in assmebly to show the xslt so i can format it according.

So basically I need to know how to load the xml document the apply the stylesheet I'm not using a "server" Its an asp.net website. Not sure if Im biting myself in the butt by saying that seeing as it is asp.net . I'm just not sure how to apply the xml to the xslt as well as apply the xslt to the website.
 
You can just add the asp Xml control to the page and set its DocumentSource and TransformSource, and they will tranform and display.
 
Sample code if you dont mind

Im not trying to sound rude or anything I was just wondering if you could maybe post a sample on how you mean for me to do that.

Like i said before i think it was the ordering in which i was messing up before here ill post the code i was using so its not like im not posting something.

VB.NET:
' xslt.Transform("C:\Documents and Settings\djohnston\My Documents\xsltinfo\xslt info\Comprehensive\EnhancedSnapshot.xml", "books.html")

 
' xslt.Load("C:\Documents and Settings\djohnston\My Documents\xsltinfo\xslt info\Comprehensive\Comprehensive.xsl")
 
'xmlDocin = New XmlDataDocument
 
'xmlDocin.Load("C:\Documents and Settings\djohnston\My Documents\xsltinfo\xslt info\Comprehensive\EnhancedSnapshot.xml")
 
'Dim trans As XslTransform = New XslTransform
'trans.Load([URL="http://www.lstfinancial.com/test.xsl"]http://www.lstfinancial.com/test.xsl[/URL])
 
'xml1.Document = xmlDocin
'xml1.Transform = trans
 
Catch xmlex As XmlException
ThrowNew Exception(xmlex.Message)
Catch ex As Exception
'Response.Write(ex.Message)
 
Last edited by a moderator:
There's no need for code here, see the two screenshots attached, one is displaying the toolbox and the xml control marked also how the control looks in page, the other show the properties pane for the xml control, you just click the properties ...Source and browse to the .xml and .xsl files.
 

Attachments

  • img1.jpg
    img1.jpg
    20.1 KB · Views: 44
  • img2.jpg
    img2.jpg
    12.8 KB · Views: 40
Back
Top