Ross Gardler wrote:
> Brian M Dube wrote:
> >Lipsius, Eric M wrote:
> >> This is how my code looks in my source file:
> >>
> >> <document>
> >>    <header>
> >>    <title>Search Tools</title>
> >>    <script type=text/javascript" src="/skins/validations.js"/>
> >>    </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 [1]
> (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 [2] 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
> please give plenty of details, most of us do not embed javascript in
> 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.
> 
> Ross
> 
> [1] http://www.mail-archive.com/user@forrest.apache.org/msg00993.html
> [2] 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.

-David