I am struggling with a problem using XML DSO and binding HTML elements to data that has been frustrating me for days so if anyone can help it would be very much appreciated.
To demonstrate the problem I have simplified it down to a few lines of HTML:
<div datasrc="#xmldso" datafld="FIRSTNAME"></div>
<div datasrc="#xmldso" datafld="LASTNAME"></div>
In the example above, the contents of the FIRSTNAME field are displayed fine (i.e. Joe) but the contents of the LASTNAME field (i.e. Bloggs) are not displayed because the XML element has an attribute called "id".
If I remove the attribute the field data is displayed. It does not matter what the attribute is called, as soon as an element has an attribute, its data is not displayed.
I have hunted everywhere for documentation, etc, but cannot find anything that discusses this or shows any examples.
I am not interested in extracting the value of the attribute only the value of the element. I have no control over the XML that I will be using i.e. all elements will contain a single attribute plus data.
Any help would save me from going mad!
I have found a resolution to this.
So for the benefit of others, here is how to do it ...
<table datasrc="#xmldso" datafld="LASTNAME">
... basically I had to bind a second table to not only the data source but also to the element containing the attribute and then access the data for that element by using the internal $text reference.