Application Development and Automation 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: 
Read only

Accessing node in xml via interface iXML

Former Member
0 Likes
504

Hey guys,

i am trying to acces a node within my generated xml document via iXML interface. I build up an excel via iXML and it is working fine.

Now i have two problems:

1. i want access to a tag 'PageSetup' which is the child of 'WorksheetOptions'

2. i want to create a new child from 'PageSetup'

How can i achieve this?

thx, Ming

2 REPLIES 2
Read only

former_member156446
Active Contributor
0 Likes
403

data:

  node type ref to IF_IXML_NODE,

  root type ref to IF_IXML_NODE,

  value type string,

  xml_doc type ref to cl_xml_document.

  create object xml_doc.

  xml_doc->parsestring( STREAM = g_filecontent ).

  node = xml_doc->find_node( name = <your name>

                             root = root ).

  value = xml_doc->get_node_attribute( node = node

                                       NAME = <attr_name> ).

Try this code and see if you can access the value. From post http://scn.sap.com/thread/34423

Read only

0 Likes
403

thx for your reply, but it is not working. 😞

I create the xml document by

data:   lo_xml                 type ref to if_ixml,

          lo_xml_doc          type ref to if_ixml_document.

lo_xml = cl_ixml=>create( ).

lo_xml_doc = lo_xml->create_document( ).

... lo_xml_doc->create_simple_element( .......

... adding some nodes and then i want to access the named node.

Could it be by adding the node 'Worksheet' the node children aren't visible yet? First after rendering the xml object, die children are inserted? It's just an assumption.