cancel
Showing results for 
Search instead for 
Did you mean: 

XML extraction

Former Member
0 Kudos

Hi fellows,

this question is slightly complex and multifaceted.

First the business case:

I create a form feeding it textmodules containing dynamic fields, and variable values for those fields.

Like so:

textmodule_name1 = 'Z_ADDRESS'

Z_ADDRESS cotaining

&firstname&, &street& and so on.

This is not a problem, the form is created perfectly.

Now I want to use the text as a mail body. Prevoiusly I have tried the same with a smartform, using the OTF returned by the FM, no problems at all.

When I try the same for the adobe form I convert the rawstring to xml but here comes the problem.

I use interface IF_IXML_STREAM_FACTORY to create a document and getting the values. (have tried the code on other XML files and it works.

Now here I get an error, 1 parse errors have occured: line: 0 column: 39 no DTD specified, can't Validate

If I understand correctly there should be some sort of DOCTYPE declaration, to tell the parser how the XML three is built up? Can I get that from ADS or do I have to create a DTD file to extact my DATA?

I try this also with a uploaded file (the very same form, saved in LiveCycle designer as XDP file) now it works fine. No DOCTYPE needed.

Im a bit confused, is XDP a wrapper around the XML?

I also try with a very small xml file:

<?xml version="1.0"?>

<?xml-stylesheet type='text/xsl' href='MessageLog.xsl'?>

<Log FirstSessionID="1" LastSessionID="1">

<Message Date="2007-12-28" Time="22:48:34" DateTime="2007-12-28T21:48:34.218Z" SessionID="1">

<From><User FriendlyName="Me , Myself & I"/></From>

<To><User FriendlyName="Simon"/></To>

<Text Style="font-family:MS Shell Dlg; color:#000000; ">Hello, World</Text>

</Message></Log>

This also does not have any DOCTYPE or DTD declaration but workes just fine.

So to sum up as individual questions:

1. Can I use the XML raw string returned from ADS and extract the data to use as a mailbody?

2. Is there a DTD file created for my form somewhere so I can refere to it using the DOCTYPE statement?

3. Whats the deal with sometimes using DTD and sometimes not?

4. Why is the XML different from the returned XML (RAW) from ADS and the XML I get from LiveCycle designer?

5. Is there another way to go about this? Like some standard functionality to retreieve the text?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

After much work it did finally work.

It isn't pretty but it works

Sandra_Rossi
Active Contributor
0 Kudos

When I use this abap code after I retrieve the xml via ADS (into L_DATA variable), it works.

data l_string type string.
  CALL FUNCTION 'ECATT_CONV_XSTRING_TO_STRING'
    EXPORTING
      im_xstring = l_data
      im_encoding = 'UTF-8'
    IMPORTING
      ex_string  = l_string.
data lo_xml TYPE REF TO cl_xml_document.
CREATE OBJECT lo_xml.
* Put the XML string into the object with the method PARSE_STRING:
lo_xml->parse_string( stream = l_string ).
call method lo_xml->display.