Solved

Using XML/XSL in webBrowser Control

Posted on 2004-09-29
1
201 Views
Last Modified: 2013-12-26
I'm currently retrieving an xml block using a stylesheet from the database and storing it in a variable.  I can write this block to the webBrowser control, but it does not find the stylesheet that I want to utilize for formatting.  I've tried absolutely pathing the stylesheet in the xml block and numerous other path options and none seem to work.  When I save the xml to the drive and open it in the browser object all is fine.  I'm assuming it cannot resolve the position of the stylesheet.  Is there a special trick to this?  Any sort of direction would be helpful!!

Here is the xml block
       <?xml version=''1.0''?>
       <?xml-stylesheet TYPE=''text/xsl'' href=''/xsl/AGENT_OUTBOUND_CALLS.xsl''?>
       <AGENT_OUTBOUND_CALL>
           <CAMPAIGN_NAME></CAMPAIGN_NAME>
           <CAMPAIGN_ID></CAMPAIGN_ID>
           <GROUP_ID></GROUP_ID>
           <GROUP_NAME></GROUP_NAME>
           <CONTACT>My Name</CONTACT>
           <PHONE>345-3456</PHONE>
           <DATE>9/28/2004</DATE>
           <TIME>10:30</TIME>
           <COMMENTS>Need TO call about something</COMMENTS>
           <PRIORITY>1</PRIORITY>
       </AGENT_OUTBOUND_CALL>

Browser call (sXML is the above code retrieved from the DB, i'd prefer not to write it to a file and just dynamically populate the browser):
   frmConsole.wbOutbound.Navigate ("about:" + sXML)
0
Comment
Question by:tgriffit
[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
1 Comment
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 250 total points
ID: 12185063
Its probably just easier to apply the transform using the DOM, and simply write the results to the webbrowser.

Something like:

   Dim oXML As New DOMDocument40
   Dim oXSL As New DOMDocument40
   Dim sResult As String

   '// Set up web browser
   webbrowser1.navigate2 "about:blank"

   While webbrowser1.document.readyState <> "complete"
      DoEvents
   Wend

   '// Load XML and XSL
   oXML.loadXML sXML
   oXSL.load app.path & "\xsl\AGENT_OUTBOUND_CALLS.xsl"

   '// Apply transform
   sResult = oXML.transformNode(oXSL)

   '// Write results to browser
   webbrowser1.document.write sResult


You will need to add a reference to the "Microsoft XML 4.0" library in Project > References

Hope this helps.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

737 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