I am trying to parse the following XML doc using SweetXML library.
<A>
<B>23</B>
<B>34</B>
<B></B>
</A>
However when I try to parse the document using: xpath(~x"/A/B/text()"l)
I get the response ['23', '34']. Is there anyway I can get the list with nil value for the element having no text ? The response that I expect is: ['23', '34', nil].
Thanks for the response. But is there any way around this ? It will be really helpful even if I can get the count of all B elements. That way I can compare with the length of the list and figure out how many such elements are there.