Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

importing/exporting XML Schema Issue

Avatar

Former Community Member
I have seen several posts that bring up aspects of the problem but I have not seen a clear answer.



Here is what I am trying to do:

I have a schema that defines my output structure (the example is highly simplified)



<Root>

<a> </a>

<b> </b>

<c> </c>

<d> </d>

</Root>



I have designed the form and it outputs perfectly based on the target schema, which is embedded.



As part of the workflow I want to import an XML fragment into the structure which has the following format and the same element names as the target:



<Different Root>

<a></a>

<d></d>

</Different Root>



I get SOM errors on import referring to the data types(data group) but that is not the main problem.

The output is:

<Different Root>

<a></a>

<d></d>

<Root>

<b></b>

<c></c>

</Root>

</Different Root>



I guess I thought this would be simple.

I've tried several different tricks including combining the schemas but nothing seems to work.

Is there an 'on import' script that can map this correctly or is there something really simple that I am missing?



I am at defcon 4 --any ideas would be appreciated
2 Replies

Avatar

Former Community Member
What are you expecting the output to be in this case?

Avatar

Former Community Member
I didn't get a lot of help from this forum but I thought it might be helpful to share one solution.



The solution is an XSLT that transforms the data on import.

Basically putting tag wrappers that mimic the final output schema.



Import wants to see the same root and basic structure so you basically select the elements you want on input and wrap them with the correct parent elements.