Hello, I have a listbox in which I would like to load transformed XML data. Say I have an XML file that contains information about persons: <root> <person enabled="yes"> <name>Jesse Hiemstra</name> <address>Stellingmûne 110</address> </person> <person enabled="no"> <name>Sjoukje Kingma</name> <address>Wetterstritte 1</address> </person> </root> For example: Could I load data from this XML - only where the "enabled" attribute has the value "yes" - into the listbox using XSLT? I use the Win32 API in combination with the C programming language. Thanks in advance!
wrote in message news:4328fc54-2c5f-486e-81a9-7bbe90b7e924@27g2000hsf.googlegroups.com... Hello, I have a listbox in which I would like to load transformed XML data. Say I have an XML file that contains information about persons: <root> <person enabled="yes"> <name>Jesse Hiemstra</name> <address>Stellingmûne 110</address> </person> <person enabled="no"> <name>Sjoukje Kingma</name> <address>Wetterstritte 1</address> </person> </root> For example: Could I load data from this XML - only where the "enabled" attribute has the value "yes" - into the listbox using XSLT? I use the Win32 API in combination with the C programming language. Thanks in advance! Yes, using ASP.NET for example you could transform the XML using XSLT and bind this to a listbox using an XmlDataSource Control. In C/Win32 API I think you'd need to select the person elements where enabled equals yes and then loop through the collection to add each to the listbox. I'm not conversant enough with C/Win32 API to know what tools you have available for this, if using COM you'd probably use the MXSML2 library. -- Joe Fawcett (MVP - XML) http://joe.fawcett.name
Essentially no. The requirements you describe are implemented using two different APIs. There is nothing that XSLT provides that is specific to listboxes. You must either loop through the XML directly or if you use XSLT then you must transform to a format that you loop through. A listbox must be filled by adding each item individually. Note that I am answering your question as closely as possible to the question you asked; that is, using the Windows API, listboxes and C or C++. If those requirements change or can vary, then the answer would vary. wrote in message news:4328fc54-2c5f-486e-81a9-7bbe90b7e924@27g2000hsf.googlegroups.com... Hello, I have a listbox in which I would like to load transformed XML data. Say I have an XML file that contains information about persons: <root> <person enabled="yes"> <name>Jesse Hiemstra</name> <address>Stellingmûne 110</address> </person> <person enabled="no"> <name>Sjoukje Kingma</name> <address>Wetterstritte 1</address> </person> </root> For example: Could I load data from this XML - only where the "enabled" attribute has the value "yes" - into the listbox using XSLT? I use the Win32 API in combination with the C programming language. Thanks in advance!