Mark,

My understanding is that GWT only supports HTML documents, not XHTML
or SVG documents. This restriction is related to the way GWT
initializes (there is a bootstrap process based on iframes, something
XHTML and SVG do not support). It is a rather old issue and people
(notably Archie Cobb) have tried to suggest improvements in this area
but they have not been integrated into GWT. Here are a few URLs from
past threads, worth reading:

http://code.google.com/p/google-web-toolkit/issues/detail?id=710&can=1&q=SVG
http://groups.google.com/group/google-web-toolkit-contributors/browse_thread/thread/1ccbfd663663e540/68b3b2a9b722d3c9?q=GWT+SVG#68b3b2a9b722d3c9
http://www.vectomatic.org/libgwtsvg/on-the-topic-of-gwt-intialization

I think one of the most valuable improvements the GWT team could do
for their next version would be to refactor this bootstrap process to
make it portable to other javascript containers (SVG, XHTML, HTML5
WebWorkers, ...). This would increase the domains to which GWT can be
applied.

If you want to do SVG with GWT, it is possible today though. But you
will need to instantiate your SVG graphical elements dynamically using
javascript DOM calls (to Document.createElementNS() or
DOMParser.parseFromString()) and add these to your DOM tree. You
cannot simply embed the SVG tags in HTML, as they will not be
recognized by the HTML parser.

By the way I am developing an SVG GWT library which does just that, in
case you are interested: http://www.vectomatic.org/libgwtsvg


?
On Feb 21, 1:09 am, Paul S <[email protected]> wrote:
> That is pretty curious that the svg would load just because you
> have .xhtml as the file extension instead of .html, I have never used
> svg so this may very well be true and I'm showing my ignorance. About
> the validator, it's not the Holy Grail, code validation is very handy
> and a good discipline to keep, but sometimes you just can't make your
> code validate simply because you are using a modern spec that is
> unsupported or some browser specific feature.
>
> I seehttp://jwatt.org/svg/demos/xhtml-with-inline-svg.xhtmldoes
> have .xhtml on the end. Hmm. Well, stick with your .xhtml extension,
> and live with the fact that GWT's plugin will not offer you the
> convenient link? What you could do is just manually type the
> "production mode" link into your browser and then bookmark that... oh,
> having said that, perhaps the production mode browser plugin will not
> accept non-html extensions?
>
> Is the SVG something that GWT interacts with?
>
> On Feb 21, 2:56 am, markww <[email protected]> wrote:
>
> > Hmm ok I see what you're saying. I'm trying to include an <svg>
> > element in my document.
>
> > If I use the xhtml doc type template you linked to, I get it validated
> > 100% in that validator you mentioned. Now I try adding a simple svg
> > element and it failes.
>
> > When I add my <svg> stuff to it, the validation fails. But I'm adding
> > it as specified from the mozilla page on 
> > svg:http://jwatt.org/svg/demos/xhtml-with-inline-svg.xhtml
>
> > when I leave this document as .html, no svg elements are rendered.
> > When switching to .xhtml, then the browsers render it.
>
> > I know this out of scope of GWT, just throwing it out there!
>
> > Thanks for your help!
>
> > On Feb 20, 3:35 pm, Paul S <[email protected]> wrote:
>
> > > Oh yeah you're right. GWT development mode just simply scans the war
> > > folder for anything ending in .html and then offers those options to
> > > you "for your convenience". So 2 things to say here,
> > > 1. you are not limited to these URLs, you can type anything in your
> > > browser
> > > 2. GWT plugin just isn't seeing your .xhtml file, doesn't mean it's
> > > not there.
> > > However, to make everyone happy I'd recommend you change your .xhtml
> > > back to .html and then fix up the doctype to be XHTML. Honestly,
> > > that's all that counts, not the file extension. In fact try this:
> > > 1. run your app
> > > 2. right click and view source
> > > 3. copy your (x)html source code
> > > 4. visithttp://validator.w3.organdclickthe Validate by Direct
> > > Input tab
> > > 5. paste your source code into there and click validate.
> > > If you have provided valid xhtml code it will detect that and tell
> > > you.
>
> > > Paul S
>
> > > On Feb 21, 2:29 am, markww <[email protected]> wrote:
>
> > > > Hi Paul,
>
> > > > Yes I set the path in web.xml, so it doesn't have any problem with
> > > > that, it looks like when I try to run my project as a web app, I get
> > > > the usual startup sequence, but no URL is provided for me when launch
> > > > is complete.
>
> > > > When I run a project using a .html file, I see this appear in the
> > > > console:
>
> > > >   "For your convenience, here are some URLs that you may wish to view
> > > > in development mode. Simply copy/paste a URL below into any suported
> > > > browser."
>
> > > > and normally the url is shown right there, but when using xhtml, no
> > > > url is shown, that area is just empty.
>
> > > > If I run a normal project, I can copy the url, then change it to point
> > > > to my other project's xhtml file, and it is shown by the browser, but
> > > > no javascript is executed.
>
> > > > I am using Safari so it should be able to handle xhtml documents. I
> > > > also updated the doc type via the url you had provided. This should be
> > > > working?
>
> > > > Thanks
>
> > > > On Feb 20, 3:14 pm, Paul S <[email protected]> wrote:
>
> > > > > Switching to XHTML is about changing the doctype of the page, not the
> > > > > file extension.
> > > > > See this:http://www.w3.org/QA/2002/04/valid-dtd-list.html
>
> > > > > When you say you have updated the references, where? Are you getting
> > > > > something like:
>
> > > > > HTTP ERROR: 404
> > > > > NOT_FOUND
> > > > > RequestURI=/index.html
> > > > > Powered by Jetty://
>
> > > > > If so then you need to tell browser to hit your new URL. Also go into
> > > > > web.xml and change the default welcome page URL.
>
> > > > > On Feb 21, 12:33 am, markww <[email protected]> wrote:
>
> > > > > > Hi,
>
> > > > > > I want to use an XHTML file instead of an HTML file as the entry 
> > > > > > page
> > > > > > for my project. If I change myproject.HTML to myproject.XHTML, the
> > > > > > project no longer works (I updated the other references to .HTML in 
> > > > > > my
> > > > > > project as well). Does gwt just not work with XHTML?
>
> > > > > > Thanks
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to