You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Ravi Kumar <rk...@inprise.com> on 2000/12/25 03:40:31 UTC

Compiled style sheets

Hi,

problem 1:
-----------
** processor.setStyleSheet ...
** processor.process(inputSource1, null, resultTarget)

This sequence should ignore the stylesheet PI in the inputSource as per
documentation.
But, instead it ignores the
** setStyleSheet(stylesheetRoot)
and instead applies the PI present in the input source.

problem 2:
------------
** processor.getAssociatedStylesheets (xsltinput1, null, null)
should return a vector of all stylesheets including css
But a css entry such as this
<?xml-stylesheet type="text/css" href="foo.css"?>
is not returned

Am I missing something?

Thanks
Ravi




Re: Compiled style sheets

Posted by Ravi Kumar <rk...@inprise.com>.
Looking through the usage patterns, I found the
** stylesheetRoot.process
approach. That one works fine and ignores the PI in the input.

A minor issue with this approach. Disabling warnings isn't possible as
there is no equivalent to setQuietConflictWarnings method in the
stylesheetRoot class.

The following code should do it, me thinks.

// to add to StylesheetRoot

boolean m_quietConflictWarnings = false;

public void setQuietConflictWarnings(boolean b) {
  m_quietConflictWarnings = b;
}

// at the begining of the process method add a line as follows
process (XSLTProcessor iprocessor, Node sourceTree, XSLTResultTarget
outputTarget) throws .... {
XSLTEngineImpl processor = iprocessor;
processor.setQuietConflictWarnings(m_quietConflictWarnings);

.......

Alternatively (and a cleaner way),
1. stylesheetRoot holds a reference to the processor instance which created
it.
2. Everytime it spawns a new processor, set's the *relevant* processor
properties from that of the parent.

I am getting started on Xalan hopefully am not way off the mark

Rgds
Ravi




Ravi Kumar wrote:

> Hi,
>
> problem 1:
> -----------
> ** processor.setStyleSheet ...
> ** processor.process(inputSource1, null, resultTarget)
>
> This sequence should ignore the stylesheet PI in the inputSource as per
> documentation.
> But, instead it ignores the
> ** setStyleSheet(stylesheetRoot)
> and instead applies the PI present in the input source.
>
> problem 2:
> ------------
> ** processor.getAssociatedStylesheets (xsltinput1, null, null)
> should return a vector of all stylesheets including css
> But a css entry such as this
> <?xml-stylesheet type="text/css" href="foo.css"?>
> is not returned
>
> Am I missing something?
>
> Thanks
> Ravi