Re: Editing XML



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
.



Relevant Pages

  • Need xsl help
    ... I'm trying to transform an XML document into another ... XML document with a slightly different format. ... Here's the xsl I tried using: ... the value of the colname attribute, ...
    (comp.lang.java.help)
  • Need xsl help
    ... I'm trying to transform an XML document into another ... XML document with a slightly different format. ... Here's the xsl I tried using: ... the value of the colname attribute, ...
    (comp.text.xml)
  • Re: Please help :-) Sorting XML data in a DataGrid
    ... An XSL Transform creates an XML document from another XML document. ... Still, since you're using a DataSet, wouldn't it be easier to sort it rather ...
    (microsoft.public.dotnet.framework)
  • XML to XML Using XSLT
    ... I need to transform one xml document into a second xml document. ... 19495 BISCAYNE BLVD ... but HOW I do that in XSLT? ...
    (microsoft.public.dotnet.xml)
  • XML to XML Using XSLT
    ... I need to transform one xml document into a second xml document. ... 19495 BISCAYNE BLVD ... but HOW I do that in XSLT? ...
    (microsoft.public.dotnet.general)