Re: Start a panel, border, or page with an XML declaration?
Thanks for sharing your thought and trick with me! The wicket user community is so helpful and friendly. Cheers! --- On Mon, 10/5/09, Phil Housley wrote: > From: Phil Housley > Subject: Re: Start a panel, border, or page with an XML declaration? > To: users@wicket.apache.org > Date: Monday, October 5, 2009, 4:27 AM > 2009/10/4 David Chang : > > Phil, > > > > Thanks very much for your reply. By XML declaration, > you mean something like: > > > > > > > > Correct? I found this piece and it may be interesting > to all: > > That's right. > > > http://learningtheworld.eu/2008/farewell-xml-declaration/ > > Well, it might make sense to skip the xml declaration when > the output > is being pushed straight the user agent (as with JSP, PHP > etc), but > with Wicket you require a full parsing of the xhtml data on > the server > side, so I would go with the best practice approach and > keep the > declaration. Wicket is much more able to transform > xhtml than other > frameworks, so the arguments aren't really the same. > > >>>I prefer to include it in my source, and then > have > > Wicket strip it out at the last moment - at least when > I'm forced to > > be IE6 compatible > > > > I am interested in this solution. Could you please > share with us the detailed how-to? > > There's no particular secret, just call > this.getMarkupSettings().setStripXmlDeclarationFromOutput(true); > in > your Application.init() method. > > > Regards. > > > > --- On Sun, 10/4/09, Phil Housley > wrote: > > > >> From: Phil Housley > >> Subject: Re: Start a panel, border, or page with > an XML declaration? > >> To: users@wicket.apache.org > >> Date: Sunday, October 4, 2009, 6:59 AM > >> 2009/10/4 David Chang : > >> > Hello, I am reading < Action>>. > >> The Tip on page 291 says "it is good practice to > start your > >> panels and borders (possibly your pages) with an > XML > >> declaration to force Wicket to work with them > using the > >> proper encoding". > >> > > >> > Does this mean that starting a panel, border, > or page > >> with something such as the following: > >> > -- > >> > 1.0 > >> Transitional//EN" > >> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > >> > http://www.w3.org/1999/xhtml"; lang="en" > >> xml:lang="en"> > >> > > >> > content="text/html; > >> charset=utf-8" /> > >> > ... > >> > > >> > -- > >> > >> Actually, the xml declaration is the one starting > >> which > >> includes your encoding as soon as possible in the > file, > >> before any > >> actual content. Adding the doctype is also good > >> practice, as it makes > >> sure wicket/the browser/anything else that reads > the file > >> understands > >> it exactly as you wrote it, but is a separate > issue. > >> > >> > > >> > is better than with: > >> > -- > >> > > >> > > >> > ... > >> > > >> > -- > >> > >> > If yes, why do all the examples of the WIA > book start > >> simply with > ...? > >> > >> To save space I assume. > >> > >> > Thanks for your help! > >> > > >> > >> One final thing to note is that IE6 will screw up > any page > >> with an > >> my > >> source, and then have > >> Wicket strip it out at the last moment - at least > when I'm > >> forced to > >> be IE6 compatible. > > -- > Phil Housley > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Start a panel, border, or page with an XML declaration?
2009/10/4 David Chang : > Phil, > > Thanks very much for your reply. By XML declaration, you mean something like: > > > > Correct? I found this piece and it may be interesting to all: That's right. > http://learningtheworld.eu/2008/farewell-xml-declaration/ Well, it might make sense to skip the xml declaration when the output is being pushed straight the user agent (as with JSP, PHP etc), but with Wicket you require a full parsing of the xhtml data on the server side, so I would go with the best practice approach and keep the declaration. Wicket is much more able to transform xhtml than other frameworks, so the arguments aren't really the same. >>>I prefer to include it in my source, and then have > Wicket strip it out at the last moment - at least when I'm forced to > be IE6 compatible > > I am interested in this solution. Could you please share with us the detailed > how-to? There's no particular secret, just call this.getMarkupSettings().setStripXmlDeclarationFromOutput(true); in your Application.init() method. > Regards. > > --- On Sun, 10/4/09, Phil Housley wrote: > >> From: Phil Housley >> Subject: Re: Start a panel, border, or page with an XML declaration? >> To: users@wicket.apache.org >> Date: Sunday, October 4, 2009, 6:59 AM >> 2009/10/4 David Chang : >> > Hello, I am reading <>. >> The Tip on page 291 says "it is good practice to start your >> panels and borders (possibly your pages) with an XML >> declaration to force Wicket to work with them using the >> proper encoding". >> > >> > Does this mean that starting a panel, border, or page >> with something such as the following: >> > -- >> > > Transitional//EN" >> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> >> > http://www.w3.org/1999/xhtml"; lang="en" >> xml:lang="en"> >> > >> > >> > ... >> > >> > -- >> >> Actually, the xml declaration is the one starting > which >> includes your encoding as soon as possible in the file, >> before any >> actual content. Adding the doctype is also good >> practice, as it makes >> sure wicket/the browser/anything else that reads the file >> understands >> it exactly as you wrote it, but is a separate issue. >> >> > >> > is better than with: >> > -- >> > >> > >> > ... >> > >> > -- >> >> > If yes, why do all the examples of the WIA book start >> simply with ...? >> >> To save space I assume. >> >> > Thanks for your help! >> > >> >> One final thing to note is that IE6 will screw up any page >> with an >> > source, and then have >> Wicket strip it out at the last moment - at least when I'm >> forced to >> be IE6 compatible. -- Phil Housley - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Start a panel, border, or page with an XML declaration?
Phil, Thanks very much for your reply. By XML declaration, you mean something like: Correct? I found this piece and it may be interesting to all: http://learningtheworld.eu/2008/farewell-xml-declaration/ >>I prefer to include it in my source, and then have Wicket strip it out at the last moment - at least when I'm forced to be IE6 compatible I am interested in this solution. Could you please share with us the detailed how-to? Regards. --- On Sun, 10/4/09, Phil Housley wrote: > From: Phil Housley > Subject: Re: Start a panel, border, or page with an XML declaration? > To: users@wicket.apache.org > Date: Sunday, October 4, 2009, 6:59 AM > 2009/10/4 David Chang : > > Hello, I am reading <>. > The Tip on page 291 says "it is good practice to start your > panels and borders (possibly your pages) with an XML > declaration to force Wicket to work with them using the > proper encoding". > > > > Does this mean that starting a panel, border, or page > with something such as the following: > > -- > > Transitional//EN" > > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > > http://www.w3.org/1999/xhtml"; lang="en" > xml:lang="en"> > > > > > > ... > > > > -- > > Actually, the xml declaration is the one starting which > includes your encoding as soon as possible in the file, > before any > actual content. Adding the doctype is also good > practice, as it makes > sure wicket/the browser/anything else that reads the file > understands > it exactly as you wrote it, but is a separate issue. > > > > > is better than with: > > -- > > > > > > ... > > > > -- > > > If yes, why do all the examples of the WIA book start > simply with ...? > > To save space I assume. > > > Thanks for your help! > > > > One final thing to note is that IE6 will screw up any page > with an > source, and then have > Wicket strip it out at the last moment - at least when I'm > forced to > be IE6 compatible. > > -- > Phil Housley > > - > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org > For additional commands, e-mail: users-h...@wicket.apache.org > > - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Start a panel, border, or page with an XML declaration?
2009/10/4 David Chang : > Hello, I am reading <>. The Tip on page 291 says "it is > good practice to start your panels and borders (possibly your pages) with an > XML declaration to force Wicket to work with them using the proper encoding". > > Does this mean that starting a panel, border, or page with something such as > the following: > -- > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> > http://www.w3.org/1999/xhtml"; lang="en" xml:lang="en"> > > > ... > > -- Actually, the xml declaration is the one starting > is better than with: > -- > > > ... > > -- > If yes, why do all the examples of the WIA book start simply with > ...? To save space I assume. > Thanks for your help! > One final thing to note is that IE6 will screw up any page with an
Start a panel, border, or page with an XML declaration?
Hello, I am reading <>. The Tip on page 291 says "it is good practice to start your panels and borders (possibly your pages) with an XML declaration to force Wicket to work with them using the proper encoding". Does this mean that starting a panel, border, or page with something such as the following: -- http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";> http://www.w3.org/1999/xhtml"; lang="en" xml:lang="en"> ... -- is better than with: -- ... -- If yes, why do all the examples of the WIA book start simply with ...? Thanks for your help! - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org