Skip to Content
0
Former Member
Feb 24, 2009 at 09:11 AM

XML extraction

290 Views

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?