Forum Moderators: open

Message Too Old, No Replies

Can description contain only numerics?

rss description

         

buckyswider

1:36 am on Sep 18, 2021 (gmt 0)

Top Contributors Of The Month



0


I'm creating an RSS file- very simple, at that- that has only one interesting piece of data. It's for a dynamic LED display. The sign data provider (SMINFINITY) allows a custom RSS feed, where they take the data in a description tag and allow you to build a message using that dynamic data. So you set up the message, point it to the RSS feed, and then when the feed gets updated, the LED sign reflects the update with no intervention.

Took me a long while to figure this out, but the field I need to be dynamic (supplied in the RSS feed) is a numeric only. When I put a numeric only in the description, the sign software ignores it (actually it fails the validation check). Anything that also contains an alphabetic character works just fine. The xml file passes rss validation checks on other sites that specifically do RSS validation.

What I'm trying to find out is if this is an RSS thing or something in the sign company's software prohibiting this. If the former, then I guess I'll just abandon the project. If the latter, I can ask SMINFINTY if they could fix it.

Does anybody have any insights on this? Thanks.

NickMNS

3:40 pm on Sep 18, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hello buckyswider welcome to WW
Sounds like a cool project.

Just pass the number as a string.

buckyswider

3:49 pm on Sep 18, 2021 (gmt 0)

Top Contributors Of The Month



Thanks Nick! Do you happen to know how I would do that in an xml < descriptor > tag? I assumed anything in there was a string...no idea how to explicitly define it in XML!

NickMNS

4:18 pm on Sep 18, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I assumed anything in there was a string...

Good point. I was thinking server side, but then it would throw a server error to the effect that value must be a string.

I have no idea how to solve this, but you could try a few hacks:

Show the numbers followed by a character 0. or 1., such that it would be interpreted as a string.

Show a leading 0, so: 00, 01, 02

Here from the RSS specification:
All elements of an item are optional, however at least one of title or description must be present.

If you don't have a title, you could try to add one. This would allow the code to validate, and your device would ignore the title while getting the data from the description.

here is the spec: [rssboard.org...]

buckyswider

4:26 pm on Sep 18, 2021 (gmt 0)

Top Contributors Of The Month



Thanks! I had tried with punctuation characters, but they didn't work either. Seems the only thing it wants is [a:z,A:Z]. Tried leading zeroes, that doesn't work either. Tied both single a double quotes to make it a 'string literal'- still fails. :(

WAIT- single quotes work, but display on the message. So it's not strictly alphabetic characters....

But thanks for the ideas!

NickMNS

5:08 pm on Sep 18, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Try ascii encoding:
&#60;

buckyswider

9:29 pm on Sep 18, 2021 (gmt 0)

Top Contributors Of The Month



What should this look like? For the numeric 368, i tried &#c3;&#c6;&#c8; and the same without semicolons. No luck :(

NickMNS

10:28 pm on Sep 18, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Sorry, my bad, again... one needs to use the unicode encoding of the ascii characters.

from 0:
\u0030

...
to 9:
\u0039


and for 73:
\u0037\u0033


This should work. I think.

buckyswider

10:41 pm on Sep 18, 2021 (gmt 0)

Top Contributors Of The Month



No need to apologize, I appreciate you giving me stuff to try!

But this one didn't work either. It validated, but it showed exactly what was in the string: \u0033\u0038\u0036

NickMNS

12:08 am on Sep 19, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm sure that we are on the right track. This is an encoding issue. Hopefully @Lucy24 or maybe @phranque will chime in they have more experience with that kind of stuff.

One quick question, in your code, are you declaring the encoding like this:
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
...
</rss>

buckyswider

12:54 pm on Sep 19, 2021 (gmt 0)

Top Contributors Of The Month



I was not. But now I am! And still no go. :(

not2easy

1:18 pm on Sep 19, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Might it be an editor settings thing, something in your text editor? Or a MIME setting missing? (just grasping at straws...)

NickMNS

3:24 pm on Sep 19, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Instead of \u0000 notation, try &#x0000; so the number 7 would be:
&#x0037;


That should work according to:
[w3.org...]

buckyswider

8:20 pm on Sep 19, 2021 (gmt 0)

Top Contributors Of The Month



no go - that one doesn't even get through the external validation sites (where most of the other ones do)

XML parsing error: <unknown>:10:27: not well-formed (invalid token)

I have Notepad++ set to UTF-8. Not sure what else it would be.

Let's not lost sight of the initial conundrum- my feed gets cleared by all of the validation sites, but doesn't work on the reader that my sign vendor uses if it's all numeric. Coming to the conclusion that it's a bug on their end without any evidence to say the all numerics are invalid by the standards.