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

Coding and node context under MSXML3

Subject: Coding and node context under MSXML3
From: "Joel P Thornton" <joelt@xxxxxxxxxxxxx>
Date: Thu, 12 Apr 2001 13:19:33 -0700
node under documentelement
Hi.

I'm writing code using MSXML3/ASP to do various node creation and processing
tasks.  I'm having some trouble defining exactly where, who, and when it is
best to create nodes/documents.

Specifically -- when calling a function which creates a new node, say
fetchContentNode(), is it better to:


A) Have the caller create an XMLDOMDocument, and pass a context node into
the function for the function to create the new node on or as a child of?

B) Have the function itself create an XMLDOMDocument, and return the
document to the caller, who would then be responsible for appending the
returned DOMDocument.documentElement to its own working DOMDocument (or
doing something else with it)?

C) Have the caller create an XMLDOMDocument and pass it to the function,
then have the function return the newly created node -- whose parent is the
XMLDOMDocument originally passed in?


I'm looking for any advice on "best practices" in this area, because I'm
having trouble conceptualizing through the whole process.

Option A seems like it would make the best use of resources, however at the
cost of being able to control exactly what happens with the newly created
node.

Option B seems like an unnecessary waste of resources, since you would be
instantiating a new DOMDocument every time you wanted the function to create
a node for you, which would then be appended to another, pre-existing
DOMDocument (presumably).

So Option C seems to be a fair medium between the two:  it does not require
the called function to create a new DOMDocument to carry out its operation.
But it also seems rather messy to do it that way, e.g.:



[ create a new DOMDocument, xmlDoc, with some children nodes ]

Set nodContent = fetchContentNode(xmlDoc, "content-lookup-name")
xmlDoc.documentElement.appendChild nodContent




Ideas please! :)

joel


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


Current Thread

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.