Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Using XML/XSL in webBrowser Control

Posted on 2004-09-29
1
Medium Priority
?
212 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 1000 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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

604 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