[ 
https://issues.apache.org/jira/browse/NIFI-9083?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Enrico updated NIFI-9083:
-------------------------
    Priority: Minor  (was: Major)

> TRANSFORM_XML creates wrong output files in case of XSLT unmatch
> ----------------------------------------------------------------
>
>                 Key: NIFI-9083
>                 URL: https://issues.apache.org/jira/browse/NIFI-9083
>             Project: Apache NiFi
>          Issue Type: Bug
>         Environment: Linux CentOS 7.9, OpenJDK 1.8.0 - Nifi 1.13.2
>            Reporter: Enrico
>            Priority: Minor
>         Attachments: TT_incident.xml, TT_incident_nifi_output.xml, 
> TT_no_incident.xml, TT_no_incident_nifi_output.xml, transform.xslt
>
>
> Hi!
> on my production environment i need to transform an XML trhough an XSLT 
> schema, and i'm using TRANSFORM_XML 1.13.2 Nifi Block.
> I have many parallel TRANSFORMXML and it works fine.
> The problem happens when i use an XSLT like attached transform.xslt :
> {code:java}
> <?xml version="1.0"?>
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>      <xsl:template match="/Message">
>         <xsl:if test="Body/Msg/Incident">
>                <message>
>                         <aaa><xsl:value-of 
> select="Header/PlantInformation/Field1"/></aaa>
>                         <bbb><xsl:value-of 
> select="Header/PlantInformation/Field2"/></bbb>
>                         <ccc><xsl:value-of 
> select="Header/PlantInformation/Field3"/></ccc>
>                         <ddd>OP</ddd>
>                         <eee>spooler</eee>
>                         <ggg>0</ggg>
>                 </message>
>         </xsl:if>
>     </xsl:template>
> </xsl:stylesheet>
> {code}
> if the receiving xml msg has fields Body/Msg/Incident like attached 
> TT_incident.xml, then everything works fine and attached 
> TT_incident_nifi_output.xml is correctly created , but when i receive xml 
> source msg that do not contain Body/Msg/Incident, as on attached 
> TT_no_incident.xml, then the TransformXML create an output file just filled 
> with the header
>  
> {code:java}
> <?xml version="1.0" encoding="UTF-8"?>
> {code}
> as on attached TT_no_incident_nifi_output.xml, instead of doing nothing.
> thousands of this files with only this header create errors on nifi flow (ie 
> in PutDBRecord)
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to