Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Create XML File with static form, placing single tag information.

Former Member
0 Kudos

Hello,

I need to create an XML File which is going to have a lot of static information, such as namespaces, version tags, IDs etc.

The only thing I want to set dynamically are a few tags in this fixed structure.

I tried to wrap my head around the Transformations but I can't figure out how to set the structure there and how to replace the specific tags then.

Best regards,

3 REPLIES 3

Sandra_Rossi
Active Contributor

The transformation will contain your static XML, and for variable parts you'll have to pass them via a root structure, and inject them using <tt:value or <xsl:value-of .... Please give more information about what issue you exactly have?

Former Member
0 Kudos

Thank you that did the trick.

I have another problem concerning the namespaces. In my root element i declare the needed namespaces like this in the simple transformation.

<ROOT xmlns="xyz" xmlns:cac="cac" xmlns:cbc="cbc">

<cac:child>...</cac:child>
<cac:child2>...</cac:child2>
<cbc:child3>...</cbc:child3>

...

What my Transformation then serializes looks like this:

<ROOT xmlns="xyz">

<cac:child xmlns:cac="cac">...</cac:child>
<cbc:child2 xmlns:cac="cac">...</cbc:child2>
<cbc:child3 xmlns:cbc="cbc">...</cbc:child3>

...

How can I prevent, that the namespaces are populated in every tag, and only displayed in the root tag?

Sandra_Rossi
Active Contributor
0 Kudos

That's a classic issue with transformations because it's a redundant information (and consumes memory for nothing). ABAP web services have this issue (because they rely on transformations). I'm not aware of a solution to clean the XML. But that should not be an issue, as only information systems read the files. Just tell worrying people that it's not a problem.