XML output type

  
Hi All,

I'm trying to create an XML output that can be picked up by a Jasper Reports server.
For this a certain XML structure is preferrable.

NOTE: Below examples are dramatically decreased in attribute count.

The default Serialization_RecordListToXml (
or Serialization_ObjectToXml; what's the difference??) results in:
<?xml version="1.0" encoding="utf-8"?>
<DBExport>
  <Entity name="S_WARRANT_ISSUE_BATCH">
    <Attribute>
      <Name>MessageNumber</Name>
      <Value>22</Value>
    </Attribute>
  </Entity>
</DBExport>

While I would really like to see something like:
<?xml version="1.0" encoding="UTF-8"?>
<DBExport xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  < S_WARRANT_ISSUE_BATCH >
    <MessageNumber>22</MessageNumber>
 < /S_WARRANT_ISSUE_BATCH >
</DBExport>

Is there a generic (easy) method to create above structure instead of the 'default' structure?
Hi Eric,

You should be able to acomplish that with a XSL Transformation of that output.
Take a look into http://solutiontrial.outsystems.net/XmlSample/ (Manipulate XML > Transform XML)
(To test your XSLT you can use this page)


Cheers,
Tiago Simões
Hi Tiago,

Thanks for your reply.
The structure I'm looking for is (I think) a very common translation.

Creating an XSLT for this could be an option, but as far as I know and have seen, this kind of translation is always based on 1 on 1 data mapping.
The consequence would be a manual 'mapping' for every translation we would need while the translation is actually something
that could be done by 'describing' the translation instead.
Note that I'm a rookie in XML communitations part so please don't blame me if the type of translation would be possible with a generic usable XSLT.
The result that I'm showing is something one of our Java data mapping team members created from an XSLT mapping.

I'll manage to create an algorithm to generate a suitable XSLT at runtime so no XSLT change would be necessary on an entity change,
but I reckon I'm not the only one that would like a 'translation' to the structure I'm looking for.
According to our Java data mapping team the structure I'm looking for is more common for data mapping (Mule / Tibco) and java environments.
Besides that; I think it's more 'readable'

I'm hoping there's a generic applyable solution for this because else I'll probably be making one myself. :)
I believe the following XSLT does what you are looking for:
This is EXACTLY what I needed!


Thanks; this gives me a good reason to kick our Java developers to an XSLT course.

This was bugging me so yesterday night I've created a comparible output through a piece of outsystems design.
Your solution doesn't have any "newlines" in it, but the structure is created on a standard, which makes it far
more reliable than my piece of work and based on a widely used standard.
In this thread you can find an Extension that does what above XSLT transformation does.