Skip to Content
avatar image
Former Member

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

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,

Add comment
10|10000 characters needed 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?

  • Former Member Sandra Rossi

    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?

  • 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.

  • Get RSS Feed

0 Answers