Hey,

You'll get this error typically when your page contains an '&' symbol. In
X(HT)ML the '&' has the meaning of entity encoding, to get a literal '&'
you need to put '&'

A tip is to use an XML editor to edit your XHTML contents as this will show
you these problems as well.

Regards,
koen


2014-07-21 1:50 GMT+02:00 Jeffrey Scott Flesher Gmail <
jeffrey.scott.fles...@gmail.com>:

>  Thanks, that helped clear up my confusion, I made the changes in my
> code, and so far it works great, but I did start getting this error message:
> [error] "RefEncoder: Error reading XHTML string: could not parse xhtml
> entity"
> My guess is that the encoding may not be XHTML compatible like it says,
> I did verify the code online and by hand, it does contain HTML 5 code, is
> that an issue?
> I say this because I noticed if I put over 30 HTML 5 audio controls on one
> page that the navigation stops working (page freezes up when you try to
> navigate using menu or other controls),
> still troubleshooting that one,
> but I decided to put push buttons there to activate the player so its not
> streaming all the feeds at the same time, and only loading those you listen
> too,
> but I have not tracked down the source of this error message yet, its
> generated after all the functions have exited and the page is being
> rendered,
> and I do not see any content missing from the page,
> so its possible its unrelated at this point, but it makes tracking it down
> real hard, but it is in this class, so I will figure it out,
> but it will make it easier if I know that HTML 5 Code is ok to use in Wt,
> by XHTML, I can assume nothing, is it XHTML 5, I did not find this listed
> in any documents, so I have to ask?
> keep in mind this data is coming from a database and wrapped in a
> WViewWidget,
> it also only uses single quotes, so I do not have to escape double quotes
> so I can use them in strings,
> as such, it contains: <br />, which could be <br> or like <b></b>, <p
> class='single-quotes'>it&prime;s “Content”</p>,
> as well as special tags: <audio controls>...
> and is not using messageResourceBundle,
> I will have to figure out where the error message is generated to start
> troubleshooting this,
> do you have any XHTML test functions for this purpose?
>
> I have a question on best Practice on this same question:
> The Content is Multilingual HTML pages, some very large,
> I want to add custom tags to it, so I can bind them to custom functions,
> so a template will work great,
> but I do not know what tags are being used in a page until after they are
> read in,
> that part seems real easy using messageResourceBundle,
> or even WLocalizedStrings (I have never used this before), using tr or
> resolveKey,
> so my question is:
>
> Is it faster to read a message bundle from an XML file or from a Database?
> I realize I can benchmark this and see for myself, but my guess is that
> you have already done that,
> but my question also deals with best Practices for Wt, and may not come
> down to a benchmark.
>
> If Database how do I read message resource bundle from a database,
> It looks like I can feed a database query into messageResourceBundle
> useBuiltin, I will start there,
> or I guess I could assign the database query to WLocalizedStrings,
> but what would be the Best Practice and do you have any examples or clues?
>
> Sorry if it reads long, I wanted to be clear.
> Thanks
> Flesher
>
>
> On Mon, 2014-07-14 at 16:43 +0200, Koen Deforche wrote:
>
> Hey,
>
>
>
>  Cannot widen() really means, as Stefan suggests, that somewhere you are
> messing up character formats. You should always use UTF-8 within a Wt
> application, unless you really need something else.
>
>
>
>  As to memory size: if you are only shown static contents, there is no
> need for a widget to keep memory around. You should use WViewWidget to wrap
> a widget into a 'view-only' non-interactive widget which is discarded as
> soon as it's rendered.
>
>
>
>  A WString::tr() function will by the way not store the actual resolved
> string, so if you really have huge strings that need to be displayed, it's
> worth considering whether they can be read from a message resource bundle
> (WLocalizedStrings can be specialized to resolve keys in a different way,
> e.g. reading from a database).
>
>
>
>  Regards,
>
>  koen
>
>
>
>
>
>  2014-07-13 3:11 GMT+02:00 Jeffrey Scott Flesher Gmail <
> jeffrey.scott.fles...@gmail.com>:
>
>  More testing left me wondering about this problem, increasing the memory
> stopped the error in one part of the code, as well as crashing the page,
> but then it popped up in another part, and adding:
> Wt::WString::fromUTF8() as you suggested fixed that, as ~
> bottomPage =  new Wt::WText(Wt::WString::fromUTF8("<div id='vpagebottom'
> class='vpagebottom' style='width:" + playVideo->pagebottomwidth +
> ";height:" + playVideo->pagebottomheight + ";'>" + playVideo->pagebottom +
> "</div>"), Wt::XHTMLUnsafeText
> the pageBottom is just html, and once it gets bigger then 50,000 it pops
> up as an error message without doing a fromUTF8,
> but ok before some limit like 45,119, but I get the message at 53,795, in
> some code, as I said,
> adding it to the database I did not have to do this once I added more
> memory,
> in fact I switched back to using string, after the upgrade,
> so this message is generated by Wt in an out of memory limit is hit (not
> sure if that is on purpose, in fact, I thought it might just be that
> programs on low memory start to do strange things),
> or by strings that are too large,
> so its clear I need to monitor the size of the string, but what size is
> too big?
>
> Is there a limit on the size a string (string::max_size) can be in Wt
> library?
>
> I never did loose any data, regardless of the message, after the memory
> upgrade that is, before it crashed the page, but doing this trick got rid
> of the message,
> so my question is, is this the best way to deal with strings that get up
> to lets say 50,000 to 100,000 or more?
>
> Basically I read in the html from an xml file, store it in a database (1
> time only, or on updates), then get it using dbo, create a WText widget
> then bind it to a template.
>
> The Problem is that web pages can get long if you let them, so I need to
> figure out how long I can let them get, any idea how to combat this issue?
>
> Thanks
>
>
>
> On Fri, 2014-07-11 at 16:19 +0200, Stefan Ruppert wrote:
>
>   Hi,
>
> from my experience this is mostly a character encoding problem. I
> noticed these errors by not using WString::fromUTF8() or if you use
> latin1 strings as plain UTF8 strings.
>
> Within our projects all source code uses UTF8 encoding:
>
> WString s = "Müller"; // will issue such an error
> WString s = WString::fromUTF8("Müller"); // is save
>
> See also WString::setDefaultEncoding().
>
> Regards,
> Stefan
>
> Am 10.07.2014 23:20, schrieb Jeffrey Scott Flesher Gmail:> I am reading in 
> from an XML file, a very long string of HTML using RAPIDXML:> std::string 
> mypagebottom(nodeAttrib->value(), nodeAttrib->value_size());> then I write it 
> to the database:> videoDb->pagebottom = mypagebottom;> and even> 
> videoDb->pagebottom = mypagebottom.c_str();> Originally I was using all 
> strings, but tried to fix it by defining them> as WString:> Wt::WString 
> pagebottom;> Wt::Dbo::field(a, pagebottom,       "pagebottom");> > It seems 
> to have written the data, is this a problem that I can fix, if> so how?> > I 
> do not see an overloaded WString function that takes value and size> like 
> string does,> is there a better way to write this that will avoid this 
> message?> > Thanks> > > 
> ------------------------------------------------------------------------------>
>  Open source business process management suite built on Java and Eclipse> 
> Turn processes into business applications with Bonita BPM Community Edition> 
> Quickly connect people, data, and systems into organized workflows> Winner of 
> BOSSIE, CODIE, OW2 and Gartner awards> http://p.sf.net/sfu/Bonitasoft> > > > 
> _______________________________________________> witty-interest mailing list> 
> witty-interest@lists.sourceforge.net> 
> https://lists.sourceforge.net/lists/listinfo/witty-interest>
>
>
> ------------------------------------------------------------------------------
> Open source business process management suite built on Java and Eclipse
> Turn processes into business applications with Bonita BPM Community Edition
> Quickly connect people, data, and systems into organized workflows
> Winner of BOSSIE, CODIE, OW2 and Gartner awardshttp://p.sf.net/sfu/Bonitasoft
> _______________________________________________
> witty-interest mailing 
> listwitty-interest@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
>
>  
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck&#174;
> Code Sight&#153; - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.http://p.sf.net/sfu/bds
>
> _______________________________________________ witty-interest mailing list 
> witty-interest@lists.sourceforge.net 
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
>
> ------------------------------------------------------------------------------
> Want fast and easy access to all the code in your enterprise? Index and
> search up to 200,000 lines of code with a free copy of Black Duck
> Code Sight - the same software that powers the world's largest code
> search on Ohloh, the Black Duck Open Hub! Try it now.
> http://p.sf.net/sfu/bds
> _______________________________________________
> witty-interest mailing list
> witty-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/witty-interest
>
>
------------------------------------------------------------------------------
Infragistics Professional
Build stunning WinForms apps today!
Reboot your WinForms applications with our WinForms controls. 
Build a bridge from your legacy apps to the future.
http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to