"greubel" wrote:
It would be nice if the parse routine recognized them and handled the codes BUT he doesn't.
Without doing the regex() calls, I get one long field for most of the data from parse().
Either I'm not following what you're saying, or something funky is going on with your XML. The following code:
xmlString = "<test>quote: ", ampersand: &, greater than: >, less than: <</test>"
xml = CreateObject("roXmlElement")
xml.Parse(xmlString)
?xml.GetText()
Correctly prints the following to the console for me:
quote: ", ampersand: &, greater than: >, less than: <
Am I misunderstanding the issue?
"greubel" wrote:
Is there a way for regex() to handle all four values on one call ?
Nothing that I could figure out. I spent a couple of hours trying to come up with something faster the other day when you first posted the issue, but the best I could come up with was the following, which finds all instances of encoded characters in a single Regex, but you'd still have to walk through the matches to do the replacements, which is much slower than what you're doing.
regex = CreateObject("roRegex", "&#?([0-9|quot|lt|gt|amp|nbsp|apos]+?);", "i")
Ideally you could use the roRegex.Split() method with the above, then do something similar to what you're already doing, but Split() doesn't give you the match that caused the split. I suppose you could do some Mid() parsing on the original string based on the Split() string lengths, but I can't imagine that'd be any faster than what you're currently doing.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)