The first four XML-XSL options are all supported currently. For the XML file
options, use a DocumentView, transformed through an XSLTransform. For the
XML memory data, use a TrivialView and set the XML string as the model, then
transform through an XSLTransform.

As for caching the XSL, that is handled by the stylesheet processor (i.e.
xalan). Maverick lets you set how you want templates cached: precompiled
(all loaded and cached at startup), lazy loaded (loaded and cached when
first accessed), or not cached. If you need some templates cached and others
not cached, you could use two XSLTransformFactories, one set to precompiled
and the other set to not cached. Assign them each different labels (i.e.
xsl-cached, xsl-no-cache).

<modules>
    <transform-factory type="xslt-cached"
provider="org.infohazard.maverick.transform.XSLTransformFactory">
        <default-output-type value="text/html"/>
        <template-caching value="preload"/>
        <uri-resolver value=""/>
     </transform-factory>

    <transform-factory type="xslt-no-cache"
provider="org.infohazard.maverick.transform.XSLTransformFactory">
        <default-output-type value="text/html"/>
        <template-caching value="disabled"/>
        <uri-resolver value=""/>
    </transform-factory>
</modules>

Then use them as such

<!--cached-->
<view type="document " path="foo.xml">
    <transform type="xslt-cached" path="bar.xsl">
</view>

<!--not cached-->
<view type="document " path="foo2.xml">
    <transform type="xslt-no-cache" path="bar2.xsl">
</view>

As for writing out to a file, this is not currently supported, but it should
be trivial extend maverick to support this by writing a custom "file
writing" transform that you could place last in the transform chain.

As for internationalization, this is already supported. More information is
available in the maverick manual:

http://mav.sourceforge.net/maverick-manual.html#N40015B

--jim

----- Original Message -----
From: "Al Butler" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Mougenot Sylvain" <[EMAIL PROTECTED]>
Sent: Tuesday, October 01, 2002 9:20 AM
Subject: RE: [Mav-user] Domify, adding my own xml to the model.


>
> If you have not realized by now from this posting and earlier
> ones that XML-XSL xlations are not really working in Maverick.
>
> I'm looking for a MVC that can easily handle XML-XSL. It's either
> Maverick or WebWorks and either one I can't get working.
>
> I need options.
>
> XML file / XSL file.
> XML memory data / XSL file.
> XML file / XSL cached file.
> XML memory data / XSL cached file.
>
> those 4 above displayed back to calling device.
>
> XML memory data / XSL file out to FILE
> XML file / XSL file out to FILE
>
>
> docs, samples, whatever.
>
> Internationalization.
> XSL files are named differently for each languge.
> Examples:
> getLogin.xsl (english, US) (lazy approach)
> getLogin_en_US.xsl (proper approach)
> getLogin_ko_KR.xsl (Korean).
>
> My products do this in a servlet:
>
>  Retrieve request.getHeader("accept-language");
>  Form locale:
>   if (lang !=null && !lang.startsWith("en-us") ) {
>       currentLocale = new Locale ("ko","KO");
>     } else {
>       currentLocale = new Locale ("en","US");
>     }
>
>   Get XSL file:
> XSL_Filename = this.cti_properties.getXSLFile(user_command,lang);
>    Example:
>    if (lang !=null && !lang.startsWith("en-us")) {
>           /* only korean is supported*/
>           if (lang.startsWith("ko")) {
>             String opint = new String (operation+"_ko");
>             return(props.getProperty( opint, "" ));
>           } else
>             return null;
>
>
> The Korean XSL file holds ONLY Korean text.
> It IMPORTS the Englsih XSL file, which causes the Korean
> text to over-write the English XSL parameters.
>
> Th English file contains all of the HTML and Javascript in
> one centralized location.
>
>
>
> thanks,
> al
>
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Schnitzer,
> Jeff
> Sent: Monday, September 30, 2002 4:03 PM
> To: [EMAIL PROTECTED]
> Cc: Mougenot Sylvain
> Subject: RE: [Mav-user] Domify, adding my own xml to the model.
>
>
> > From: Mougenot Sylvain [mailto:[EMAIL PROTECTED]]
> >
> > Aim:
> > The controller have to pass the selected contents (as XML
> Strings)
> > to the vue XSL throught domify.
> >
> > Problem:
> > Domify treat the XML String as a CData. I mean it masks "<"
> ">",...
> > so that I've no more XML structure at the output.
>
> Right, that's as intended.  Think of the model as a DOM, not an XML
> stream - strings in the nodes (or within SAX events) are not
> re-interpreted as XML.
>
> There are a couple easy ways to do what you want to do.  The first (and
> more complicated) way is to parse the XML yourself using the JAXP api in
> your Controller and put the DOM objects in your model.  If you want fine
> control of the model, this is probably your best bet.
>
> If you're fine with the XML string itself being the whole model, then
> the easiest way to do this by far is to use the "trivial" view type.
> You simply set the String (or a Reader to the XML stream) as the model
> (by calling ControllerContext.setModel() ).  It will be passed into the
> transform process and processed automatically.
>
> I suspect the second option is what you're looking for.
>
> <view type="trivial">
>   <transform path="blah.xsl"/>
> </view>
>
> The documentation for TrivialViewFactory:
>
> http://mav.sourceforge.net/api/org/infohazard/maverick/view/TrivialViewF
> actory.html
>
> Jeff Schnitzer
> [EMAIL PROTECTED]
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> [INVALID FOOTER]
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by: DEDICATED SERVERS only $89!
> Linux or FreeBSD, FREE setup, FAST network. Get your own server
> today at http://www.ServePath.com/indexfm.htm
> [INVALID FOOTER]



-------------------------------------------------------
This sf.net email is sponsored by: DEDICATED SERVERS only $89!
Linux or FreeBSD, FREE setup, FAST network. Get your own server 
today at http://www.ServePath.com/indexfm.htm
[INVALID FOOTER]

Reply via email to