crossley at apache
Jun 6, 2007, 6:21 PM
Post #6 of 6
Ross Gardler wrote:
[In reply to]
> Brian M Dube wrote:
> >Lipsius, Eric M wrote:
> >> This is how my code looks in my source file:
> >> <document>
> >> <header>
> >> <title>Search Tools</title>
> >> </header>
> >> <body>
> >> .....
> >> </body>
> >> </document>
> >> Am I not calling it correctly?
> >XDoc has no script element. I don't recall at the moment how this is
> >done with skins. By looking at pelt's document-to-html stylesheet, it
> >looks like this element will be stripped implicitly. I don't think the
> >solution calls for a custom skin, but I don't remember the details. It
> >may be injected by skinconf.xml the way extra CSS is handled. With
> >skins, I think the solution applies to every document and is not handled
> >per document.
> Hmmm... that's interesting. Our FAQ clearly states that this is
> possible, but it appears the FAQ entry is misleading. Brian is correct
> that the script element is not allowed in our XDoc.
> There has been some discussion in the past, in particular see 
> (which interestingly enough was written by me, but it was a long time
> ago so you'll forgive me for not remembering, I hope. Note that my
> reference to forrest:views at the end should now be read as
> "dispatcher" which is now pretty stable in the whiteboard and will
> almost certainly be moving out sometime in the near(ish) future.
> In  you will find a little more discussion from someone who tried,
> but failed to get this working. Let us know if you too have help, but
> out source so we'll be providing options and pointers rather than
> direct answers.
> It would be really helpful if you could provide us with a better
> answer to the FAQ question once you have this nailed.
>  http://www.mail-archive.com/user [at] forrest/msg00993.html
>  http://thread.gmane.org/gmane.text.xml.forrest.user/3703/focus=3709
There is a way to do it using xdoc source format.
Add a "<script ..." to the body element and disable
validation of these xml sources. It is cheating
but it should work.
Another way might be to intercept the xml pipeline
and add another transformation to inject the extra
"<script ..." element.
Our internal format is not being validated, so it
should be able to be overloaded with extra elements.
Another way is to hack the pelt skin and explicitly
add the "<script ..." to the html output.
As Brian said above, we could add a basic solution
by doing something similar to "extra-css" in skinconf.
None of these solutions are ideal. Hence Dispatcher.