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. General Programming
  3. XML / XSL
  4. How to transform string of XML to HTML

How to transform string of XML to HTML

Scheduled Pinned Locked Moved XML / XSL
xmlhtmlsysadmindebuggingtutorial
1 Posts 1 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.
  • J Offline
    J Offline
    jjamjatra
    wrote on last edited by
    #1

    My web method returns some XML as a string. I have a fairly simple XSLT file (trying to create HTML SELECT OPTION tags from the XML content). I think both are OK but I cannot figure out how to pass the string of XML to the Transform method and get my desired output streamed out to the web page. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim myProxyClass As New ServicesMDW.Service Dim countiesXML As String Dim xslt As New XslCompiledTransform() Dim xpathdoc As XPathDocument Dim xslFileName As String = Server.MapPath("UserControl_StateCounty.xsl") Try countiesXML = myProxyClass.GetCountiesForState("06", "P", "Guest") xpathdoc = New XPathDocument(countiesXML) xslt.Load(xslFileName) xslt.Transform(xpathdoc, Nothing, Response.OutputStream) Catch ex As Xsl.XsltException Trace.Write("Transform Failed") Catch ex As Exception Trace.Write(ex.Message) End Try End Sub Here is the XSLT file "UserControl_StateCounty.xsl": Select County Here is a snippet of the XML returned from web method: 001 Alameda 06 005 AMADOR 06 John

    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