Hi,
using MashZone I'm pinging status of various components that return status in XML format. I was hoping to resolve a problem when component is down and no XML is returned with PREPROCESSING field (XML data feed). Using XSLT I wanted to generate XML with status that says component is down but so far no luck.
Outside of MashZone I can generate such a XML using this XSLT.
Can somebody help me out and give some example on this preprocessing feature?
Here is my example:
(xml)
<status>alive<status>
(xslt)
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" indent="yes"/> <xsl:template match="/"> <status> <xsl:if test="status">1</xsl:if> <xsl:if test="not(status)">0</xsl:if> </status> </xsl:template> </xsl:stylesheet>Thank you
In this case, the preprocessing feature of the XML source operator won't help you: It is intended to restructure an existing XML, but not to provide a fallback mechanism for empty input documents.
Currently, no MashZone source operator can work on empty files or "no files", since the whole feed processing depends on tabular data. If there is no data and not even at least some sort of structure, this cannot be processed.
So, your only possible approach would be to create some intermediary service that does your transformation, i.e. calling your XSLT for example (which looks correct to me), and then query that service with MashZone.