sweetstuff4u / zaplink

Automatically exported from code.google.com/p/zaplink
0 stars 0 forks source link

Parsing errors with self_fieldname on ZAPLINK_EASYXML #38

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create object with the following attribute
begin of x,
  _ type string,
  begin of Y,
    _ type string
  end of x,
end of x.

2. fill data with
X-_ = 'first data'.
X-Y-_ = 'second data'.

3. convert in XML using ZAPLINK_EASYXML

4. read from XML using ZAPLINK_EASYXML

What is the expected output?
X-_ = 'first data'.
X-Y-_ = 'second data'.

What do you see instead?
X-_ = 'first datasecond data'.
X-Y-_ = 'second data'.

because node X as a subnode Y with text the get_value method do not works.
idem for IF_IXML_ELEMENT=>GET_CONTENT_AS_STRING

Original issue reported on code.google.com by taryck%b...@gtempaccount.com on 16 Feb 2010 at 5:43

GoogleCodeExporter commented 8 years ago
Have to use contains( if_ixml_node=>co_node_text ) to detect that node is has 
the
text returned by get_value attached to it.

Have to get the subnode of node_type co_node_text in order to get the right 
text and
only that. here it's returning 'first data' instead of 'first datasecond data'.

Full ABAP code :
  check xml_node->contains( if_ixml_node=>co_node_text ) = abap_true.    " value
returned by get_value is the right one.
  o_filter = xml_node->create_filter_node_type( if_ixml_node=>co_node_text ).
  o_iterator = xml_node->create_iterator_filtered( depth = 1
                                                  filter = o_filter ).
  o_text = o_iterator->get_next( ).
  result = o_text->get_value( ).

Original comment by taryck%b...@gtempaccount.com on 16 Feb 2010 at 5:46