Mailing List
Home
Forum Home
Maven - Project building tool
Axis - Java SOAP implementation
Cocoon - MVC web framework based on XML/XSL
Lucene - Full-featured text search engine APIs
Log4J - A log library
Fop - Create PDF, PCL, PS, SVG, XML driven by XSL formatting objects.
POI - Java Excel, Word and other Microsoft Office files manipulating library
Oracle database error code ...
Subjects
log4j warning: No appenders could be found
java security AccessControlException: access denied (java io FilePermission clie
java lang InstantiationException: org apache tools ant Main
Apache Axis Tutorial
Struts <logic iterate >
log4j properties How to parse outpu to multiple files
configuring log4j with BEA Weblogic 8 1
How to use XSL FOP Java together
JSP precompile
Servlet File Download dialog problem (IE6,Adobe 6 0)
Proposal: Adding jar manifest classpath in jar and war plugins
Unsupported major minor version 48 0 problem while running the an
   telope task
java security AccessControlException: access denied (java io FilePermission
axis wsdl2java Ant Task usage
net sf hibernate MappingException: Error reading resource: test/User hbm xml
Building EAR ANT Script for websphere 5 0
CREATING WAR Files
jsp data into Excel
Classpath problem
Jboss 3 2 3+ vs Tomcat Axis Question
RE: How to include jars and add them into the MANIFEST MF/Class Path
attribute
Printing problem
InstantiationException
Couldn 't find trusted certificate
Please : How can one install ant 1 6 0 under Eclipse 2 1 ?
Excel: Too many different cell formats
Running junit tests fails
XDoclet, Struts and Maven: Where to start? SOLUTION
1 3 final: now giving me java io FileNotFoundException (Too many
open files)
AXIS: tomcat timeout ?
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
dynamic selection of stylesheet

dynamic selection of stylesheet

2004-11-25       - By Derek Hohls

 Back
Reply:     1     2  

Morus

It seems you should be able to do element matching in
your stylesheets, based on the doctype/namespace of
the document itself - eg. see the oblique reference at:

http://www.dpawson.co.uk/xsl/sect2/N2281.html#d3521e292

This would remove the need to do any kind of flowscript
or pipeline macthing.   Having said that, I cannot get a
sample to work & have posted for help on the XSL mail
list.

Derek

>>> morus.walter@(protected) 2004/11/24 12:18:11 PM >>>
Hi,

I'm new to cocoon and was trying to do a simple test application
reimplementing the core of some php application we are running.

The application consists of a search for xml articles, displaying
a hit list and displaying the articles itself using xslt.
The articles have different but similar doctypes and we have one
default xslt stylesheet and for some of the doctypes specialized
stylesheets that extend the default stylesheet (calling the default
stylesheet via xsl:import and overwrite some of the templates).

Most things worked fine but I'm having problems, how to choose the
right stylesheet.
I have the xml document and its doctype and have to check if there
is a specialized stylesheet. If I find one, that's the stylesheet to
use, otherwise the default stylesheet should be used.

How would that be done in cocoon?

The solution I found so far, is to have a flowscript checking for
the file. This has two problems:
a) I had to use the absolute path to the file instead of a relative
  pathname (currently in the flowscript itself. I guess it wouldn't
be
  a problem to move that to some parameter. But as long as I need
  the absolute path, it's ugly anyway). Any way to avoid that?
b) If I use the flowscript to select the stylesheet itself returning
  a call to a pipeline reading the stylesheet and serializing it as
  xml, I can select the default stylesheet, but the specialized
stylesheets
  break since they cannot import the relative adressed default
stylesheet
  any longer. Seems the base path got lost, when the stylesheet was
read
  by a file generator.
  So instead I have two pipelines for handling the article content
now,
  one of them using
  <map:transform src="xslt/html/{request-param:doctype}.xsl">
  the other
       <map:transform src="xslt/html/default.xsl">
  and the flowscript selects which one to use for the article
  transformation.
  That doesn't look like a reasonable solution to me, though.

Another problem I didn't look into so far is, how to get the doctype
of
the articles dynamically. Currently it's provided by the search result
but it would be nicer, if I could read it from the xml instance
itself.

Thanks for your help
      Morus

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.


-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)


Earn $52 per hosting referral at Lunarpages.