Re: scrollIntoView for XML documents
"conor325" <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.xml |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <[email protected]> |
An xpointer like "http://www.the325project.org/factlog/EusebiusLifeOfConstantine.xml#xpointer(/xhtml2:html[1]/xhtml2:body[1]/xhtml2:section[4]/xhtml2:section[59]/range-to(/xhtml2:html[1]/xhtml2:body[1]/xhtml2:section[4]/xhtml2:section[62]))" where the xml file is xhtml2 (section, h etc). It's easy to split the xpointer now and use xpath resolution to resolve a selection of text. The missing piece is being able to scrollIntoView! I don't think styled XML is ever arbitrary - after all the style sheet defines what to render as a block or inline etc. What I'm trying to say is that thanks to XML/CSS/XPath support, Firefox can render any document and if the XML DOM supported scrollIntoView, it could allow full navigation using intra-doc links, menus etc. I do this right now but I cheat: I redefine xhtml2 with xhtml's namespace. The browser then uses the HTML DOM and scrollIntoView works. "section" etc are still rendered - the DOM is flexible. However, this a hack. One change - supporting positioning in XML documents - and the plain XML DOM and renderer can be used. Boris Zbarsky wrote: > conor325 wrote: > > And would it then make sense to go "the whole way" and support > > scrollIntoView for such mixed namespace documents too? Given that > > Mozilla supports CSS styling and XPath resolution for arbitrary XML > > already, add this and there is little or no reason to recompose XML > > into HTML for viewing. > > Except if you want your documents to be accessible. Or have useful semantics in > general.... > > Sending arbitrary XML on the wire is generally NOT a good idea. > > > With this triple, a pointer to any place in an > > XML document is easy to render in a browser window. > > Define "place in an XML document", please? > > -Boris