Re: Editing XML
- From: Rob Kennedy <me3@xxxxxxxxxxx>
- Date: Sun, 10 Jun 2007 12:33:12 -0500
Hans-Peter Diettrich wrote:
I'm just trying to implement an extended viewer for the HTML Help 2 files, as used in BDE, VS, and the MSDN library. One of the goals are annotations or immediate (persistent) corrections and extensions of the online help in the BDS IDE, which still is a mess since D2005.
In the first step I create the TOC and keyword indices from the XML and HTML files, extracted from the HxS archives, using TXMLDocument. No problem so far.
In the second step the available TWebBrowser (ShDocVw) component is very uncomfortable to use, because it's impossible to redirect navigation to some "ms-help://xyz" URL to the according HTML file.
What about the BeforeNavigate2 event? Can't you use that to cancel the original navigation and issue one of your own?
So I consider to replace all <MSHelp:link ...> tags by <a href="file_to_use.htm">, and pass that modified file to the browser. Can somebody shed a light on how to update an HTML file or XMLDoc accordingly?
My first thought is to use XSLT to transform the original XML into a new XML document. Most of it would be a straight copy of the original nodes, but any nodes named <MSHelp:link> would be transformed into a corresponding <a> node instead.
Otherwise, load the XML document, get a list of all the MSHelp:link nodes, and rename them. I don't think you can actually rename a node through any of Delphi's interfaces, though, so what you'd have to do is create a new node, clone the original's children (with IDOMNode.cloneNode(True)), and then replace the original with the new node.
--
Rob
.
- Follow-Ups:
- Re: Editing XML
- From: Hans-Peter Diettrich
- Re: Editing XML
- References:
- Editing XML
- From: Hans-Peter Diettrich
- Editing XML
- Prev by Date: Re: Set the CheckBox.Checked without the OnClick being called
- Next by Date: Re: Editing XML
- Previous by thread: Editing XML
- Next by thread: Re: Editing XML
- Index(es):
Relevant Pages
|