Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

How to read Xml Node in DDX process

Avatar

Level 1

Hi All,

I face problem when reading xml node with DDX process.

(this is more a syntax problem)

On a workbench process, I want insert header in a pdf file with some datas coming from Xml variable

So I use Invoke DDX process and try to use External Data Url but without success.

(this is ok for variable) :

<?xml version="1.0" encoding="UTF-8"?>
<DDX xmlns="http://ns.adobe.com/DDX/1.0/">
    <PDF result="outDoc">
        <PDF source="inDoc">
          <Header>
              <Right><StyledText><p><String url="process:///process_data/in_xml?serialize(in_xml/a/b)"/></p></StyledText></Right>
          </Header>         
        </PDF>
    </PDF>
</DDX>

I tried different thing, without success :

     <String url="process:///process_data/in_xml/a/b)"/>

     <String url="process:///process_data/in_xml?serialize(in_xml/a/b)

     ...

Somebody could help me ?

Thank you.

2 Replies

Avatar

Level 1

I resolve a part of my problem with the current syntax:

<String url="process:///?serialize(/process_data/in_xml/a/b)"/>

Xml file is :

...

<a>
    <b>Test b</b>
    <c>Test c</c>
</a>

so the 'full' ddx file :

<?xml version="1.0" encoding="UTF-8"?>
<DDX xmlns="http://ns.adobe.com/DDX/1.0/">
    <PDF result="outDoc">
        <PDF source="inDoc">
          <Header>
              <Right><StyledText><p color="red" font-size="9pt" font-family="Arial" ><String url="process:///?serialize(/process_data/in_xml/a/b)"/></p></StyledText></Right>
          </Header>         
        </PDF>       
    </PDF>
</DDX>

But the result is "<b>Test b</b>" and not just "Test b"

any idea ?

Avatar

Level 1

If this can help somebody :

<?xml version="1.0" encoding="UTF-8"?>
<DDX xmlns="http://ns.adobe.com/DDX/1.0/">
    <PDF result="outDoc">
        <PDF source="inDoc">
          <Header>
              <Right><StyledText><p><String url="process:///?substring-before(substring-after(serialize(/process_data/in_xml/a/b),'&gt;'),'&lt;')"/></p></StyledText></Right>
          </Header>         
        </PDF>       
    </PDF>
</DDX>

Is there easiest way ?