Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

xml file parse event base

Former Member
0 Kudos

hello all,

i am learning xml file with sap help sample. I have a FM, that change xml-file into if_ixml_parser, but when i wrote the xml " <person status="retired">Walt Whitman</person>" and debug it.

event_sub was 312, <b>event was always initial</b>.

data: event type ref to if_ixml_event,

event_sub type i.

  • let the parser know which events I am interested in

event_sub = if_ixml_event=>co_event_element_pre2 +

if_ixml_event=>co_event_element_post.

parser->set_event_subscription( events = event_sub ).

do.

event = parser->parse_event( ).

if event is initial.

exit. ' either end reached or error (check below)

endif.

data: str type string.

case event->get_type( ).

when if_ixml_event~co_event_element_pre2.

str = event->get_name( ).

write: '<' str '>'.

when if_ixml_event~co_event_text_post.

str = event->get_value( ).

write: str.

endcase.

enddo.

Thanks for Request.

<a href="http://help.sap.com/saphelp_nwmobile71/helpdata/de/47/b5413acdb62f70e10000000a114084/frameset.htm">sap library - Parsing an XML document event-based</a>

Best regards

Shuo

2 REPLIES 2

0 Kudos

Hi Kiran,

thanks for your Request?

I have no xslt transform base, is that easy to learn?

can you give me a example for the event base xml ?

Regards

Shuo