Skip to Content
0

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

Apr 20, 2017 at 09:36 AM

98

avatar image

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,

10 |10000 characters needed characters left characters exceeded

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?

1

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?

0

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.

0
* Please Login or Register to Answer, Follow or Comment.

0 Answers