IBM Integration Bus XSL Transform node not generating XML - xslt

I am pretty new to IIB. I am creating a mediation service on IBM Integration Bus 10. First node is SOAP node and second node is an XSL transform. Complete flow of the service
XSL transform is working fine with my SOAP input when I test it in a different tool. But it fails here when I am testing from soapui. After Transform node, I am getting the output without XML tags (all values appended in single string)
I have no clue why it is happening. Any help is well appreciated.

I am getting the output without xml tags (all values appended in single string)
IIB will not assume that the output of an XSLTransform node is XML. An XSL stylesheet can output formatted text. So you must set the 'Domain' property in the 'Output message parsing' section of the XSLTransform node. Set it to XMLNSC, obviously.
First node is SOAP node and second node is xsl transform
Is there a particular reason why you have chosen to use the XSLTransform node? A Mapping node or a Compute node will perform better, and will be more maintainable than XSL (unless you are doing some genuinely complex transformations in XSL).

Maybe you have to see what is the version of the XSLT. If it is 2.0, XSL Transform Node is not supporting it. Try to rewrite it in XSLT version 1.0.

Related

XSLT template outputting differently under different Saxon installs? (eXist-db)

In my site I use XQuery 3.1 (under eXist-db 4.4) to output XSLT 2.0 transformations of TEI-XML documents.
Take for example this document http://medieval-inquisition.huma-num.fr/doc/MS609-0176
In my function I get the tei-xml document MS609-0176.xml as $doc and the dynamically prepared XSLT as $stylesheet and then execute the transform:transform
The serialized $stylesheet (with all nodes included for the parameters) and the tei-xml document are pasted here:
https://xsltfiddle.liberty-development.net/bdxtrg/6
One of the principle jobs of this transformation is to output footnotes.
The transformation in XSLT fiddle outputs correctly: there are 3 footnotes.
But on the website, the identical transformation and Saxon processor using the identical documents outputs 5 footnotes.
In fact, the problem (across all transformations) is only with processing tei:date[#type='deposition_date']. The transformation is 'triple-processing' all references to tei:date[#type='deposition_date'] where it only ever exists once in the file. This is happening to this one element in every document (as can be seen by looking at any on the site).
In terms of process steps: footnote numbers are added to the body, then in a separate mode, the XSLT file then uses those numbers to build the footnotes at the bottom. Therefore the problem is in the first step.
The footnote numbers are assigned to tei:date[#type='deposition_date'] at line 80-84 in the XSLT fiddle. They are processed in a unique template from the other elements.
For reference, the Xquery function is:
declare function document:doc-docview($node as node(), $model as map(*), $docset as xs:string)
{
let $stylesheet := document-view:doc-view-xslt($docset)
let $doc := doc(concat($globalvar:URIdata,$docset))
return transform:transform($doc,$stylesheet,())
}
I am completely mystified about how to handle this problem. It's the same processor (Saxon) but different result? Is there some adjustment I can make to the the XSLT file to mitigate this problem?
(I have run the exact same transformation in Oxygen (using Saxon as well), and it produces the correct results as well.)
The eXist-db environment can be accessed and tested here http://ciham-digital.huma-num.fr/exist/apps/eXide/index.html under /db/apps/deheresi/data/MS609-0176.xml and /db/apps/deheresi/modules/document-view (function) document-view:doc-view-xslt

tibco bw 6.4 XSLT out of sync with schema component properties

During mapping to subprocesses, Tibco duplicates the xsd structure and I often get an xslt out of sync error.
Is this a Tibco related issue? How can I solve it?
It happens when the xsd schema changes (input of the subprocess). An element becomes facutative for example (minoccurs = 0). It is therefore necessary to update the transformation xslt to align it with the schema. To do this, just right click on the mapping and check the correction of the error

How to XSLT-transform in-memory xml DOM tree?

How to XSLT-transform in-memory xml DOM tree? For example I create(with DOM) in memory XML tree and want to XSLT-transform it. I want to omit phase of serializing created DOM tree in XML and then send xml serialized document to XSLT processor(that will waist time to deserialize it again). Just directly send DOM tree as input to XSLT processor. Implementation in MSXML is preferable.
With MSXML a DOM node exposes methods transformNode (taking a DOM node with the stylesheet code as its argument and creating a string with the transformation result, see https://msdn.microsoft.com/en-us/library/ms761399%28v=vs.85%29.aspx) and transformNodeToObject (taking a DOM node with the stylesheet code as its first argument and a result object like a stream or another DOM node as the second argument, see https://msdn.microsoft.com/en-us/library/ms766561%28v=vs.85%29.aspx) so it is easy to apply XSLT to a DOM node created in memory.

Create XML nodes using XPath

Is it possible to create XML nodes using XPath?
Assume i got the following XML:
<data>
<someValue1></someValue2>
<someValue2></someValue2>
<someArray>
<val></val>
<val></val>
<val></val>
</someArray>
</data>
What I am trying to do is getting a node inside the XML using XPath (e.g. /data/someValue1) and setting the value of the node. This is of course easy to achieve with any language and framework supporting XML + XPath.
But when my XPath expression is pointing to a non existing node I want to somehow create this node. Even if the XPath expression is more complex (e.g. /data/someArray/val[5]).
At best this automatic node creation should be supported by some library. Is there an easy way for what I am trying to achieve? Currently I am using C++ with Qt and the QXmlQuery class.
Is it possible to create XML nodes using XPath?
No, it isn't. XPath can only select existing nodes.
If you want to create new nodes, you need XSLT or XQuery.
But even then, creating a node that satisfies a given path like /a/b/c/foo[5] is non-trivial, and not something that the languages can do automatically.

Transforming one XML document into another with C++

What would be a straightforward way to transform a source XML document into a destination XML document. There are only small differences between source and destination: Specifically I want to delete the first UnitIDRecord-Node within each UnitIDGroup-Node.
What would be the appropriate model for this task DOM or SAX?
What XML-library would best fit this problem (which guarantees that the source and destination only differs in the deleted nodes, no missing namespace, attributes, encoding, ...)?
I read about XSLT, could this be an option?
The XML document looks like following:
<?xml version="1.0" encoding="UTF-8"?>
<ExPostInformationRealGeneration xmlns="http://schemas.seven2one.de/EEX/TransparencyPlatform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.seven2one.de/EEX/TransparencyPlatform EEXTransparencyPlatform.xsd">
<DispatcherID>XYZ</DispatcherID>
<CreationDateTime>2012-05-22T13:57:00Z</CreationDateTime>
<MessageText>1 - Positiv - Meldung mit Quality-Tag - L000</MessageText>
<UnitIDGroup>
<UnitID>E110200-001</UnitID>
<UnitIDRecord><Quantity>16.9</Quantity><Starttime>2008-04-30T22:00:00Z</Starttime><Period>PT1H</Period><MessageText></MessageText></UnitIDRecord>
<UnitIDRecord><Quantity>16.6</Quantity><Starttime>2008-04-30T23:00:00Z</Starttime><Period>PT1H</Period><MessageText></MessageText></UnitIDRecord>
<UnitIDRecord><Quantity>16.4</Quantity><Starttime>2008-05-01T00:00:00Z</Starttime><Period>PT1H</Period><MessageText></MessageText></UnitIDRecord>
</UnitIDGroup>
<UnitIDGroup>
<UnitID>E110200-002</UnitID>
<UnitIDRecord><Quantity>16.9</Quantity><Starttime>2008-04-30T22:00:00Z</Starttime><Period>PT1H</Period><MessageText></MessageText></UnitIDRecord>
<UnitIDRecord><Quantity>16.6</Quantity><Starttime>2008-04-30T23:00:00Z</Starttime><Period>PT1H</Period><MessageText></MessageText></UnitIDRecord>
<UnitIDRecord><Quantity>16.4</Quantity><Starttime>2008-05-01T00:00:00Z</Starttime><Period>PT1H</Period><MessageText></MessageText></UnitIDRecord>
</UnitIDGroup>
<UnitIDGroup>
<UnitID>E110201-001</UnitID>
<UnitIDRecord><Quantity>7.0</Quantity><Starttime>2008-04-30T22:00:00Z</Starttime><Period>PT1H</Period><MessageText></MessageText></UnitIDRecord>
<UnitIDRecord><Quantity>7.1</Quantity><Starttime>2008-04-30T23:00:00Z</Starttime><Period>PT1H</Period><MessageText></MessageText></UnitIDRecord>
<UnitIDRecord><Quantity>7.1</Quantity><Starttime>2008-05-01T00:00:00Z</Starttime><Period>PT1H</Period><MessageText></MessageText></UnitIDRecord>
</UnitIDGroup>
<!-- other UnitIDGroup elements -->
</ExPostInformationRealGeneration>
I would consider the possibility of reading the file in as strings and writing the string out to another file if it matches your criteria. That's a 5 line program and avoids any parsing etc. It will run quickly and is simple. But, it is specific to this problem and not reusable. I offer this therefore as a suggestion not the correct solution!