You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Sc...@lotus.com on 2001/07/02 21:10:37 UTC

Re: something funny with namespaces and xalan2.2dev (fwd)

> I'm not 100% sure, but it looks like the current
> SAX2DTM code expects to be passed both, and I can imagine that Cocoon
might
> be trying to take the shortcut...

The code should work fine if passed only startPrefixMapping and
endPrefixMapping events.  I just wrote a small test for this, and
everything seems pretty happy (though it gets confused for local-name() if
you pass null instead of "" for startPrefixMapping...).

My suspicion is that whoever is generating SAX events within the body
statement, i.e. the form, input, etc., is not generating the namespaceURI
argument for startElement. The SAX2DTM will not try and resolve the
namespace itself, as per:

     * <li>the Namespace URI and local name are required when
     * the namespaces property is <var>true</var> (the default), and are
     * optional when the namespaces property is <var>false</var> (if one is
     * specified, both must be);</li>

Since a ContentHandler doesn't have a way to set the namespace property by
itself, SAX2DTM assumes this property is always true.  (It is still in
error in that it requires the qName argument).  (This optionality on SAX2,
in my opinion, is really awful.)

Donald, is this making any sense?

-scott




                                                                                                                      
                    Joseph_Kesselman                                                                                  
                    @lotus.com              To:     xalan-dev@xml.apache.org                                          
                                            cc:     (bcc: Scott Boag/CAM/Lotus)                                       
                    06/29/2001 02:27        Subject:     Re: something funny with namespaces and xalan2.2dev (fwd)    
                    PM                                                                                                
                    Please respond                                                                                    
                    to xalan-dev                                                                                      
                                                                                                                      
                                                                                                                      





>i'm practically certain that the only namespace events that are being
>passed in to xalan are the startPrefixMapping at the document root that
>establishes the default namespace end the endPrefixMapping at the end that
>removes it...

One guess on what might be different between the command-line and cocoon2
version: Check whether the namespaces are being presented _only_ as
prefixMapping events rather than also appearing as attributes on the
appropriate element(s). I'm not 100% sure, but it looks like the current
SAX2DTM code expects to be passed both, and I can imagine that Cocoon might
be trying to take the shortcut...






Re: something funny with namespaces and xalan2.2dev (fwd)

Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 2 Jul 2001 Scott_Boag@lotus.com wrote:

> > I'm not 100% sure, but it looks like the current
> > SAX2DTM code expects to be passed both, and I can imagine that Cocoon
> might
> > be trying to take the shortcut...
>
> The code should work fine if passed only startPrefixMapping and
> endPrefixMapping events.  I just wrote a small test for this, and
> everything seems pretty happy (though it gets confused for local-name() if
> you pass null instead of "" for startPrefixMapping...).
>
> My suspicion is that whoever is generating SAX events within the body
> statement, i.e. the form, input, etc., is not generating the namespaceURI
> argument for startElement. The SAX2DTM will not try and resolve the
> namespace itself, as per:

(sorry for the lateness of this response)

all of the elements in the form were created using SAX by a custom
component. the component strictly creates nodes in the default namespace:

handler.startElement("","form","form",attributes);

the other elements on the page were generated using SAX by cocoon's
FileGenerator, which is ultimately using jaxp (xerces) to parse the file.

> Since a ContentHandler doesn't have a way to set the namespace property by
> itself, SAX2DTM assumes this property is always true.  (It is still in
> error in that it requires the qName argument).  (This optionality on SAX2,
> in my opinion, is really awful.)
>
> Donald, is this making any sense?

a bit. would it be helpful if i got a dump of the SAX events that are
being given to xalan for debugging? if so, let me know. for the time
being, i've simply removed the namespace from that layer. i'm actually
finding that the more i use namespaces, the more i dislike certain aspects
of working with them.

- donald


Re: something funny with namespaces and xalan2.2dev (fwd)

Posted by Donald Ball <ba...@webslingerZ.com>.
On Mon, 2 Jul 2001 Scott_Boag@lotus.com wrote:

> > I'm not 100% sure, but it looks like the current
> > SAX2DTM code expects to be passed both, and I can imagine that Cocoon
> might
> > be trying to take the shortcut...
>
> The code should work fine if passed only startPrefixMapping and
> endPrefixMapping events.  I just wrote a small test for this, and
> everything seems pretty happy (though it gets confused for local-name() if
> you pass null instead of "" for startPrefixMapping...).
>
> My suspicion is that whoever is generating SAX events within the body
> statement, i.e. the form, input, etc., is not generating the namespaceURI
> argument for startElement. The SAX2DTM will not try and resolve the
> namespace itself, as per:

(sorry for the lateness of this response)

all of the elements in the form were created using SAX by a custom
component. the component strictly creates nodes in the default namespace:

handler.startElement("","form","form",attributes);

the other elements on the page were generated using SAX by cocoon's
FileGenerator, which is ultimately using jaxp (xerces) to parse the file.

> Since a ContentHandler doesn't have a way to set the namespace property by
> itself, SAX2DTM assumes this property is always true.  (It is still in
> error in that it requires the qName argument).  (This optionality on SAX2,
> in my opinion, is really awful.)
>
> Donald, is this making any sense?

a bit. would it be helpful if i got a dump of the SAX events that are
being given to xalan for debugging? if so, let me know. for the time
being, i've simply removed the namespace from that layer. i'm actually
finding that the more i use namespaces, the more i dislike certain aspects
of working with them.

- donald


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org