[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: html inside xml

Subject: Re: html inside xml
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Mon, 15 Oct 2001 16:08:43 +0100
javascript html inside xml
Hi Henry,

>      Set innernode = xmldoc.createNode("element","value","")
>     ??? ???
>
> Here I want to append htmlDom to the value node, but I am not sure
> how to do it. I have a play with Chris Bayes's domtodom.js but have
> no idea how to implement his javascript functions into my case here.
> If you can go through a little more detail in this topic here, it
> will be very very helpful.

The point that's addressed in the domtodom.js functions is that, the
way the DOM API is designed, a node in one DOM cannot be directly
copied into another DOM. So you have to look at the node you want to
copy in the HTMLDOM and create a new node in the xmldoc DOM that looks
exactly the same.

You should be able to create the equivalent of Chris' copyNode() and
copyAttributes() functions in VB just by changing the syntax a bit
(you have access to exactly the same methods and properties as Chris
does in Javascript, since you're both using MSXML).

You can then call the copyNode() function with something like:

  copyNode(HTMLDOM.documentElement, innernode, HTMLDOM, xmldoc)

The function goes through all the children of the node passed as the
first argument and creates new equivalent nodes as a children of the
node passed as the second argument, which is in the document passed as
the fourth argument. The third argument isn't used at all as far as I
can tell.

Once you've copied the contents of the HTMLDOM onto the innernode
element that you've created, remember to add the innernode (value)
element to the xmldoc DOM that you're generating, using the same
syntax as you've used to add the other elements, with the
appendChild() method.

I hope that helps,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • html inside xml, (continued)
      • henry - Thu, 11 Oct 2001 22:02:29 -0400 (EDT)
        • David Carlisle - Fri, 12 Oct 2001 04:38:34 -0400 (EDT)
        • Jeni Tennison - Fri, 12 Oct 2001 05:08:44 -0400 (EDT)
        • henry - Sun, 14 Oct 2001 20:26:42 -0400 (EDT)
        • Jeni Tennison - Mon, 15 Oct 2001 12:44:41 -0400 (EDT) <=

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.