Author Topic: Text Source - N/A text displayed when an XML element is blank  (Read 1795 times)

South Coast FM Tech

  • Newbie
  • *
  • Posts: 29
Text Source - N/A text displayed when an XML element is blank
« on: December 13, 2021, 01:30:25 am »
Hi Jan,

I'm using MagicRSD4 V4.0.33.

Receiving Now Playing XML from Station Playlist.

Please refer to attached images of example XML & Text Sources setup.

Text sources setup:
File/Class/URL: \\3mfmnas\StudioAutomation\StationPlaylist\NowPlaying.xml
Element name or full path for value %1% :  /NowPlaying/Current/Artist/#cdata-section
Element name or full path for value %2% :  /NowPlaying/Current/Title/#cdata-section
Element name or full path for value %3% :  /NowPlaying/Current/Category/#cdata-section
Element name or full path for value %4% :  /NowPlaying/Current/Temperature/#cdata-section
Output template: %1% - %2% [CAT-%3%] [TMP-%4%]

Occasionally there is no Artist %1% or Title %2%, so a blank passed.
When this happens, MagicRDS4 uses the default N/A text, rather than just passing the blank Artist or Title.

For example: <Artist><![CDATA[]]></Artist> causes N/A text is be used.

Help says that N/A text: This text is returned if the source fails (file not found, server not responding etc.).

Is there any way to stop the N/A text being forced when one argument is blank?

Thanks, Rod

Jan

  • Hero Member
  • *****
  • Posts: 1069
Re: Text Source - N/A text displayed when an XML element is blank
« Reply #1 on: December 13, 2021, 09:39:49 pm »
Thanks for this report, it is a bug of course. Depending on the Windows version, Microsoft's XML parser considers empty string to be a NULL, i.e. not a string at all. This raises an exception and the function fails, so it returns the N/A text. The fix is on the way...

Jan

  • Hero Member
  • *****
  • Posts: 1069
Re: Text Source - N/A text displayed when an XML element is blank
« Reply #2 on: December 13, 2021, 10:12:15 pm »
Shoud be fixed in today's release: https://pira.cz/rds/magicrds/MagicRDS_Setup.exe

South Coast FM Tech

  • Newbie
  • *
  • Posts: 29
Re: Text Source - N/A text displayed when an XML element is blank
« Reply #3 on: December 13, 2021, 10:58:05 pm »
Hi Jan,
Yes, your update fixed it.
XML items are now passed if one is blank.
Thanks, Rod