|
using System;
using System;
using System.Collections.Generic;
using System.Text;
using com.ximpleware;
namespace tutorial
{
public class hello_world
{
public static void Main(string[] args)
{
VTDGen vg = new VTDGen();
if (vg.parseFile("d:/C#_tutorial_by_code_examples/1/input.xml",true)){
VTDNav vn = vg.getNav();
//toElementNS is the namespace aware version of toElement which navigates the cursor
if (vn.toElementNS(VTDNav.FIRST_CHILD, "someURL", "b")){
int i= vn.getText();
// convert i into string before printing,
// toNormalizedString(i) and toRawString(i) are two other options
if (i!=-1){
Console.WriteLine("the text node value at "+i+" ==> "+ vn.toString(i));
}
}
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Jimmy Zhang is a cofounder of XimpleWare, a provider of high performance XML processing solutions. He has working experience in the fields of electronic design automation and Voice over IP for a number of Silicon Valley high-tech companies. He holds both a BS and MS from the department of EECS from U.C. Berkeley.