[XML Records] How to include attribute in header?
Question
xml-records
Service icon
Forge component by Afonso Carvalho

Hi! I would like to include an attribute in my XML header. Currently I'm only able to include the Version and Encoding.

I want to include the Standalone="Yes".

As the image follows:


Tks!

I found a solution. Maybe not the best best practices for using the app. But that's what unlocked me.

mvp_badge
MVP

Hello Danilo,

My apologies for not replying to this on a useful timeframe - this is a clever workaround. I did some quick search on the topic and an XML Declaration can have at most three attributes: version, encoding and standalone. It doesn't make sense to support the first two, but not standalone.

I will publish a new version of the component tomorrow with this feature. Thank you for your interest in the component.

mvp_badge
MVP

Version 1.6.13 of the component will now allow you to manipulate the standalone attribute of the declaration.

I tried to use an approach without using the XmlDeclaration.

I created a new structure with the name of ns1_Header to inform the attributes I need.

But when I pass my record list with the records (ns1_Header and ns1_BxfMessage) to the RecordListToXML component, it only returns a line that is the ns1_Header.

The image is how I'm sending the information to the RecordListToXML component.



Out:
<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes""?>
...The other information from the ns1_BxfMessagem record is not including...

I found a solution. Maybe not the best best practices for using the app. But that's what unlocked me.

mvp_badge
MVP

Hello Danilo,

My apologies for not replying to this on a useful timeframe - this is a clever workaround. I did some quick search on the topic and an XML Declaration can have at most three attributes: version, encoding and standalone. It doesn't make sense to support the first two, but not standalone.

I will publish a new version of the component tomorrow with this feature. Thank you for your interest in the component.

mvp_badge
MVP

Version 1.6.13 of the component will now allow you to manipulate the standalone attribute of the declaration.

I thank you for sharing this very valuable component on forge and always keeping it updated.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.