Solved

Using XML/XSL in webBrowser Control

Posted on 2004-09-29
1
202 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

728 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