Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
How to use GetParent and GetParent2How to use GetParent and GetParent2. This is a snippet of the document used in this example:
LOCAL loXml0 LOCAL loXml LOCAL loBookNode LOCAL loTitleNode LOCAL loBookNode2 LOCAL lcStr1 LOCAL lcStr2 LOCAL lcStr3 loXml0 = CreateObject('Chilkat.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: loXml = loXml0.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. loBookNode = loXml.GetChild(0) * Set titleNode equal to the title child of bookNode: loTitleNode = loBookNode.GetChildWithTag("title") * Call GetParent to return a new object pointing to the parent node: loBookNode2 = loTitleNode.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: loTitleNode.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: lcStr1 = loBookNode.GetXml() lcStr2 = loBookNode2.GetXml() lcStr3 = loTitleNode.GetXml() ? lcStr1 ? lcStr2 ? lcStr3 |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2007 Chilkat Software, Inc. All Rights Reserved.
Mail Component · .NET Email Component · ASP Mail Component · XML Parser