cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

XML parser generating an '@' prefix before each parsed element

mohamadelmardin
New Contributor III

I am facing two issues when reading an XML message form a queue and parsing it using an XML parser:

  1. First issue: it is prefixing each data element with '@ โ€™ symbol.
  2. Second issue: I am losing the JMSMessageID . I understand that I can use the Binaryto Document snap as an alternative to keep the JMSMessageID and save the JMSMessageID in a variable or parameter for later use and then attempt to use the XML parser again on the $content but I am always ending up with the โ€˜@โ€™ prefix when I try to XML parse it again
3 REPLIES 3

Bhavin
Former Employee

@ means its the attribute of an xml element ex:

would be parsed as

$tag and @attrib , share data / content that you are trying to parse

XML_Input.docx (18.2 KB)

I attached my input. What would be the fastest way to get rid of the โ€˜@โ€™ after parsing? I am thinking of using a mapper but it will be cumbersome to do it individually for each field especially if the xml input payload change from a document to another with optional elements added or removed.

how about applying xslt to incoming xml?
check this pipeline out, I am getting some errors on xslt parsing but I think we are still able to apply this xsl and get move all attribs to elements.

attached pipeline and xsl file (source - Convert XML Attributes To Elements XSLT - Stack Overflow )

xsl file, rname extn to .xsl

convert-xml-attrib-to-elem.xsl.txt (469 Bytes)

PARSE-ORDER_2017_06_27.slp (5.0 KB)
bbf41ff20c5bf523b22ab2860f5bb57313676ef5.jpg4be02c901236a59ff393417a73121e9fea30ad2d.jpg