Azure / LogicAppsUX

https://learn.microsoft.com/azure/logic-apps
MIT License
75 stars 81 forks source link

An attribute node (SEGMENT) cannot be created after a child of the containing element. #3503

Closed bankarswapnil closed 8 months ago

bankarswapnil commented 11 months ago

Describe the Bug with repro steps

My requirement is to transform JSON to SAP IDoc using Data Mapper. IDoc has elements with couple of attributes as shown below in sample IDoc, [BEGIN/SEGMENT etc] Simple 1-1 mapping works well. But as soon as I add functions, attribute specific lines get moved and then I see following exception when I run the test,

[2023-10-23T09:04:57.219Z] Error on line 23 column 51 [2023-10-23T09:04:57.219Z] XTDE0410 An attribute node (SEGMENT) cannot be created after a child of the containing [2023-10-23T09:04:57.219Z] element. Most recent element start tag was output at line 22 of module [2023-10-23T09:04:57.219Z] invoked by xsl:for-each at #11 [2023-10-23T09:04:57.220Z] In template rule with match="/" on line 7 of [2023-10-23T09:04:57.221Z] invoked by xsl:apply-templates at #5 [2023-10-23T09:04:57.221Z] In template rule with match="/" on line 3 of [2023-10-23T09:04:57.244Z] An error occurred while transforming the given input with the provided map. Details: 'An attribute node (SEGMENT) cannot be created after a child of the containing element. Most recent element start tag was output at line 22 of module '. [2023-10-23T09:04:57.244Z] Result: An error occurred while transforming the given input with the provided map. Details: 'An attribute node (SEGMENT) cannot be created after a child of the containing element. Most recent element start tag was output at line 22 of module '. Exception: Microsoft.Azure.Workflows.BuiltIn.Xslt.Common.Exceptions.ErrorResponseMessageException: An error occurred while transforming the given input with the provided map. Details: 'An attribute node (SEGMENT) cannot be created after a child of the containing element. Most recent element start tag was output at line 22 of module '.

Sample IDoc :

<?xml version="1.0" encoding="UTF-8"?>

EXCHANGE_RATE01 EXCHANGE_RATE BOOMI LS BOOMI LS PE1CLNT100 BOOMIDEV X X 000 M EUR AED 20231003 3.84598 1 1

Screenshots or Videos

XSLT which is getting generated behind the scene and causing the given exception,

{/*/*[@key='meta']/*[@key='endpoint']} {*[@key='base_currency']} {*[@key='quote_currency']} {*[@key='start_time']} {*[@key='average_midpoint']} {'1'} {'1'} {'1'} {'1'} {'BOOMIDEV'} {'X'} {'X'} {'000'} {'1'} {'1'} {'EXCHANGE_RATE01'} {'EXCHANGE_RATE'} {'BOOMI'} {'LS'} {'BOOMI'} {''} {'LS'} {'PE1CLNT100'} ### Version Data Mapper : [2.70.1](https://github.com/Azure/LogicAppsUX/compare/v2.70.0...v2.70.1) (2023-09-22) ### Additional context Work around 👍 Adjust the Attribute specific lines at the start of the node respectively in XSLT as shown below and save it. But now do not Generate XSLT using given option else it will again disturb the xslt. Then if you run test, it works Corrected XSLT : ---------------- {'1'} {'1'} {'1'} {/*/*[@key='meta']/*[@key='endpoint']} {*[@key='base_currency']} {*[@key='quote_currency']} {*[@key='start_time']} {*[@key='average_midpoint']} {'1'} {'1'} {'BOOMIDEV'} {'X'} {'X'} {'000'} {'1'} {'EXCHANGE_RATE01'} {'EXCHANGE_RATE'} {'BOOMI'} {'LS'} {'BOOMI'} {''} {'LS'} {'PE1CLNT100'} AB#25565252
DanielleCogs commented 9 months ago

Hello @bankarswapnil I can work with you to figure out this issue. First if possible could you upload the schemas you are using, and the generated LML? That will help us to diagnose where the problem is coming from. A screenshot of the area of the visual map where the xslt is breaking would be helpful too!

github-actions[bot] commented 9 months ago

We requested more information to triage this issue. If the issue goes more than 7 days with no more information it'll be automatically closed.

github-actions[bot] commented 9 months ago

This issue has been closed because the information requested wasn't provided within 7 days.

github-actions[bot] commented 8 months ago

We requested more information to triage this issue. If the issue goes more than 7 days with no more information it'll be automatically closed.

github-actions[bot] commented 8 months ago

This issue has been closed because the information requested wasn't provided within 7 days.