Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7939173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:01:19+00:00 2026-06-03T23:01:19+00:00

I have a strange behavior when parsing a large xml (but I’m not sure

  • 0

I have a strange behavior when parsing a large xml (but I’m not sure if the fact that is large is causing the problem).
This is the xml format:

<?xml version="1.0" encoding="UTF-8"?>
  <webservice>
    <control>
   <operation>get_clips</operation>
   <status>0</status>
    </control>
    <data>
       <cat size="4" lang="EN"/>
       <cat size="3" lang="EN"/>
       ' and 19 more other similar 'cat' elements
     </data>
  </webservice> 

and this is the code, where m.rawResponse is the above xml string.

if m.rawResponse <> "" then
  xml = CreateObject("roXMLElement")
  print "################ "; m.rawResponse ' contains the entire xml
  xml.Parse( m.rawResponse )
  print "################ "; m.rawResponse ' contains the entire xml

  ' I've tried like this
  categories = xml.data.GetChildElements()
  print "number of categories: " ; categories.Count() ' prints 14

  ' and also like this
  i = 0
  for each categ in xml.data.cat
     i = i +1    
  end for
  print i ' prints 14
end if 

The problem is that is only processing 14 cat elements, instead of 21 and I really don’t know why.
Please help me with any ideas.
Thanks a lot!

Later edit
I’ve added a check to see if the parsing is successful and something went wrong there. The problem is related to the symbol & – I have in the xml the following line:

<director>Donald Nij & Rick Senjin</director>

How can I resolve this issue, but not on the server side, but on the Roku code? I could not find any solution searching over the internet. Tks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T23:01:21+00:00Added an answer on June 3, 2026 at 11:01 pm

    In the Roku SDK pull the ReplaceSubstring function from the generalUtils.brs and insert it in your project. Use that to replace the “&” in your code with “&amp”. You can also use the roRegex component which might be faster. Ideally, you should fix this on the server, because the problem is you are feeding bad xml to your device, anything else is a kludge.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The <button> tag appears to have strange behavior in Safari and Opera (but not
I have a horizontal animated menu that has a strange behavior because it works
I have some strange behavior occurring in an ASP.NET application that I am trying
This situation might seem strange but this is what i have to do: Situation,
I have a strange behavior with PHP system function. In this php script there
I have a strange behavior in a tests where I want to test that
I have an strange behavior, which looks lika an problem with (a)synchronous method calls?!?
I have a strange behavior of Rails 3.0.10. Got this application controller: app/controllers/application_controller.rb require
I have a strange behavior. The code below worked from a long time but
I have this extremely strange behavior coming : In the below code: If I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.