![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
How to use GetParent and GetParent2
How to use GetParent and GetParent2. This is a snippet of the document used in this example:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <% set xml0 = Server.CreateObject("Chilkat_9_5_0.Xml") ' The Chilkat XML component is freeware. ' Load an XML document. Typically you might call LoadXml ' to load an XML file. This example loads an XML file from ' a URL: Set xml = xml0.HttpGet("http://www.chilkatsoft.com/testData/bookstore.xml") ' The xml object points to the root node of the XML document. ' Set bookNode equal to the 1st child of the root. Set bookNode = xml.GetChild(0) ' Set titleNode equal to the title child of bookNode: Set titleNode = bookNode.GetChildWithTag("title") ' Call GetParent to return a new object pointing to the parent node: Set bookNode2 = titleNode.GetParent() ' bookNode2 and bookNode point to the same node. ' Call GetParent2 (which returns nothing) to modify the internal ' pointer within the calling object so that it points to the immediate parent: titleNode.GetParent2 ' Now titleNode points to the same node as bookNode2 and bookNode. ' To prove it, generate the XML sub-tree rooted at the calling ' node and display each: str1 = bookNode.GetXml() str2 = bookNode2.GetXml() str3 = titleNode.GetXml() Response.Write str1 & "<br>" Response.Write str2 & "<br>" Response.Write str3 & "<br>" %> </body> </html> |
||||
© 2000-2026 Chilkat Software, Inc. All Rights Reserved.