Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Parsing through XSL [Thread Next] Re: Parsing through XSLTo: NULL Date: 2/7/2006 11:08:00 AM On 6 Feb 2006 22:45:15 -0800, "sp" <Praveen.Kumar.SP@g...> wrote: >i have an xml file > > > <catalog> > <cd> > <title>Empire Burlesque</title> > <artist>Bob Dylan</artist> > <country>USA</country> > <company>Columbia</company> > <price>10.90</price> > <year>1985</year> > </cd> > </catalog> > > >now i am working in C++ and my requirement >is to get the artist value of each cd and store it in a array > >i wonder whether XSL could help me out in this scenario Actually you want to just use XPath, which is the selection language used in XSL. I'm not sure of the C++ syntax, but basically you want a DOM method to get the results back - in Javascript this *is* returned as an array of DOMNode objects : var result = xmlDoc.selectNodes("/catalog/cd/artist"); if (result != null) { for (i=0; i<result.length; i++) { alert(result[i].text); } } I'm sure you can adapt this easily enough - selectNodes is a standard DOM function which should be available within your XML environment in C++ HTH Cheers - Neil | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
