Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Is there a way to modify the schema-mapped XML that is generated by the submit action prior to submission?

Avatar

Former Community Member

I have a form created in LiveCycle ES2. I have mapped some fields to a schema that causes LC to generate XML that adheres to the import format of one of my company's internal databases.

There is one problem: the system's import function looks for a DTD DOCTYPE declaration between the XML declaration and root element. I've tried including the declaration in the schema, but LC does not include it in the mapped values or the export. I've spoken with the vendor about declaring the DTD as part of the import function and they have given a firm "No."

Is there a way to insert one line of markup into the XML that LC generates in the submit action before the XML is attached to the e-mail?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

you can use XSLT to transform the outgoing data.

I never did this for adding a DTD but Google found some solutions for the term "xslt add dtd" so it should be possible.

Adding a DOCTYPE declaration on XSL output - Scriptorium Publishing

Setting the DOCTYPE in XSL, Bernie Zimmermann

View solution in original post

2 Replies

Avatar

Correct answer by
Level 10

Hi,

you can use XSLT to transform the outgoing data.

I never did this for adding a DTD but Google found some solutions for the term "xslt add dtd" so it should be possible.

Adding a DOCTYPE declaration on XSL output - Scriptorium Publishing

Setting the DOCTYPE in XSL, Bernie Zimmermann

Avatar

Former Community Member

Thanks for pointing me at those. Worked like a charm. My stylesheet ended up looking like this (in case anyone is curious later on):

<?xml version="1.0" encoding="UTF-8"?>

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

        <xsl:template match="/">

            <xsl:text disable-output-escaping="yes">

&lt;!DOCTYPE name SYSTEM "http://location/DTD/name.dtd"[]&gt;

            </xsl:text>

            <xsl:copy-of select="root node"/>

        </xsl:template>

    </xsl:stylesheet>