You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Scott Boag/CAM/Lotus <Sc...@lotus.com> on 2000/01/14 15:56:21 UTC

Re: Desired behavoir

Keith, this note from Mike Kay looks like it is the answer to our
discussion about how to flag an error if the wrong xslt namespace is
specified.  I didn't realize that this had been added.

-scott

----- Forwarded by Scott Boag/CAM/Lotus on 01/14/00 09:54 AM -----
                                                                                                                           
                    Kay Michael                                                                                            
                    <Mi...@icl.com>        To:     "'xsl-list@mulberrytech.com'" <xs...@mulberrytech.com>         
                    Sent by:                     cc:     (bcc: Scott Boag/CAM/Lotus)                                       
                    owner-xsl-list@mulber        Subject:     RE: Using XT                                                 
                    rytech.com                                                                                             
                                                                                                                           
                                                                                                                           
                    01/14/00 04:27 AM                                                                                      
                    Please respond to                                                                                      
                    xsl-list                                                                                               
                                                                                                                           
                                                                                                                           




> In the final REC version things changed so that in the
> simplified syntax there must be an xsl namespace declaration, and so
> now in principle xslt engines could give an error (but clearly some do
> not yet)

A conformant XSLT processor *MUST* signal an error in this situation.

Mike Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list




                                                                                                                   
                    Keith Visco                                                                                    
                    <kvisco@exoff        To:     Scott Boag/CAM/Lotus <Sc...@lotus.com>                       
                    ice.com>             cc:                                                                       
                                         Subject:     Re: Desired behavoir                                         
                    01/13/00                                                                                       
                    03:48 PM                                                                                       
                                                                                                                   
                                                                                                                   





Yes I was thinking about this more after I sent the message. I was thinking
that an Exception should not
be thrown, since a stylesheet with all literals is valid, but at least a
warning message stating something
like:

Warning: the stylesheet contained no elements from the XSLT namespace,
therefor there was nothing to do.

Also, since most people use the "xsl" prefix, the warning can be more
informative if it encounters this
prefix.

Warning: the stylesheet contained no elements from the XSLT namespace,
therefor there was nothing to do.
Some elements contained the "xsl" prefix. If these elements were intented
to be in the XSLT namespace,
they must be declared as such using the following valid namespace:
http://.....".

That way the user doesn't go about wondering why his Stylesheet isn't
getting processed.

So two simple flags are needed.

boolean xslActions = false;

this would get set to true once an XSLT action was encountered.

boolean xslPrefixEncountered = false;

this would get set once an element prefixed with "xsl" was encountered.

then the appropriate warning message would be triggered.

I also think if the use has specified the proper xsl namespace, but simply
used no xslt elements then no
warning should get displayed.

--Keith

Scott Boag/CAM/Lotus wrote:

> Sorry for the late reply... I've been on the road for the last couple of
> days and have been unable to get at my mail.
>
> I agree this isn't the desired behavior.  But I don't see what else can
be
> done (this is also what XT does).  Any of the old XSLT namespaces are
> legitimate namespaces.  If the namespace for the root stylesheet element
> isn't recognized as a valid XSLT namespace, it treats it has a "Literal
> Result Element as Stylesheet" (Section 2.3).
>
> What we might be able to do is recognize all the older XSLT namespaces,
and
> spit out a warning.  But I think an error would be a problem.  Does this
> sound right?
>
> -scott
>
>
>                     Keith Visco
>                     <kvisco@exoff        To:     Scott Boag/CAM/Lotus
<Sc...@lotus.com>
>                     ice.com>             cc:
>                                          Subject:     Desired behavoir
>                     01/10/00
>                     08:12 PM
>
>
>
> Scott,
>
> When using a stylesheet that doesn't have the proper namespace:
>
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
> Xalan simply reproduces the source stylesheet as the output file. I
> don't think this should be the desired behavoir. I was going to change
> Xalan to throw an exception and generate an error message, or something.
> But I don't think that producing the XSLT document as the result
> document is the correct behavoir. I wanted to ask you first before
> making any changes.
>
> --Keith