Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. XML using XSL

XML using XSL

Scheduled Pinned Locked Moved ASP.NET
xmlhelpsysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fmlove
    wrote on last edited by
    #1

    i am using xml to import data to my web page. Information is displaying but xsl style sheet is not applying please tell me, whats the problem .... Please my code is : Dim xmlPath As String = Server.MapPath("XMLFile.xml") Dim xslPath As String = Server.MapPath("XSLTFile.xsl") Dim fs As FileStream = New FileStream(xmlPath, FileMode.Open,FileAccess.Read) Dim reader As StreamReader = New StreamReader(fs, Encoding.UTF8) Dim xmlReader As XmlTextReader = New XmlTextReader(reader) 'Instantiate the XPathDocument Class Dim doc As XPathDocument = New XPathDocument(xmlReader) '//Instantiate the XslTransform Class Dim xslDoc As XslCompiledTransform = New XslCompiledTransform() xslDoc.Load(xslPath) Dim sw As StringWriter = New StringWriter() xslDoc.Transform(doc, Nothing, sw) ' //Close Readers reader.Close() xmlReader.Close() Response.Write(sw.ToString()) Please help me... :(( Feroze

    W 1 Reply Last reply
    0
    • F fmlove

      i am using xml to import data to my web page. Information is displaying but xsl style sheet is not applying please tell me, whats the problem .... Please my code is : Dim xmlPath As String = Server.MapPath("XMLFile.xml") Dim xslPath As String = Server.MapPath("XSLTFile.xsl") Dim fs As FileStream = New FileStream(xmlPath, FileMode.Open,FileAccess.Read) Dim reader As StreamReader = New StreamReader(fs, Encoding.UTF8) Dim xmlReader As XmlTextReader = New XmlTextReader(reader) 'Instantiate the XPathDocument Class Dim doc As XPathDocument = New XPathDocument(xmlReader) '//Instantiate the XslTransform Class Dim xslDoc As XslCompiledTransform = New XslCompiledTransform() xslDoc.Load(xslPath) Dim sw As StringWriter = New StringWriter() xslDoc.Transform(doc, Nothing, sw) ' //Close Readers reader.Close() xmlReader.Close() Response.Write(sw.ToString()) Please help me... :(( Feroze

      W Offline
      W Offline
      Walter_H
      wrote on last edited by
      #2

      Hi Feroze! Why aren't you using the XML-Control (found in the Toolbox)? With this you just need to apply the XML-Source and the transformation file. e.g: Dim xmlDoc As New XmlDocument() xmlDoc.Load("your path to the xml-data goes here") With yourXmlControl .Document = xmlDoc .TransformSource = "your path to the xsl-file goes here" End with This is all what needs to be done. - walter

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups