You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xerces.apache.org by Brett McLaughlin <br...@earthlink.net> on 2000/02/26 03:28:26 UTC

SAX 2 and startElement()

I just hopped on the list (I've been offline for a while) so forgive me in
advance if this has been asked and answered (possibly multiple times).

I just pulled down the latest distribution of Xerces (1.0.2) and am seeing
some strange behavior from startElement() using
org.apache.xerces.parsers.SAXParser as an XMLReader implementation.

The rawName gets reported correctly, e.g. the complete
namespaceURI:localName element name.  However, both localName and
namespaceURI come up blank.  My XML has namespace prefixes on all elements,
but nothing else is even remotely unusual about the document.

Is this a noted bug, or am I getting unexpected behavior?  TIA.

-----
Brett McLaughlin
Metro Information Systems
Work: (972) 724-3161
Mobile: (817) 825-7187


Re: SAX 2 and startElement()

Posted by Pierpaolo Fumagalli <pi...@apache.org>.
Pierpaolo Fumagalli wrote:
> 
> yep... you're right, the spec says that that feature should be true by
> default, while on xerces it's false by default... not a big deal, anyway
> :)

Here's the patch...

cvs diff XMLParser.java (in directory C:\CVS
Archive\xml-xerces\java\src\org\apache\xerces\framework\)
Index: XMLParser.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/framework/XMLParser.java,v
retrieving revision 1.10
diff -r1.10 XMLParser.java
210c210
<     protected boolean fNamespacesEnabled = false;
---
>     protected boolean fNamespacesEnabled = true;

-- 
--------------------------------------------------------------------
-          P              I              E              R          -
stable structure erected over water to allow the docking of seacraft
<ma...@betaversion.org>    <http://www.betaversion.org/~pier/>
--------------------------------------------------------------------
- ApacheCON Y2K: Come to the official Apache developers conference -
-------------------- <http://www.apachecon.com> --------------------

Re: SAX 2 and startElement()

Posted by Pierpaolo Fumagalli <pi...@apache.org>.
Brett McLaughlin wrote:
> 
> The "http://xml.org/features/namespaces" feature controls general Namespace
> processing: when this feature is true (the default), ...

yep... you're right, the spec says that that feature should be true by
default, while on xerces it's false by default... not a big deal, anyway
:)

-- 
--------------------------------------------------------------------
-          P              I              E              R          -
stable structure erected over water to allow the docking of seacraft
<ma...@betaversion.org>    <http://www.betaversion.org/~pier/>
--------------------------------------------------------------------
- ApacheCON Y2K: Come to the official Apache developers conference -
-------------------- <http://www.apachecon.com> --------------------

Re: SAX 2 and startElement()

Posted by Brett McLaughlin <br...@earthlink.net>.
> Brett McLaughlin wrote:
> >
> > I just hopped on the list (I've been offline for a while) so forgive me
in
> > advance if this has been asked and answered (possibly multiple times).
> >
> > I just pulled down the latest distribution of Xerces (1.0.2) and am
seeing
> > some strange behavior from startElement() using
> > org.apache.xerces.parsers.SAXParser as an XMLReader implementation.
> >
> > The rawName gets reported correctly, e.g. the complete
> > namespaceURI:localName element name.  However, both localName and
> > namespaceURI come up blank.  My XML has namespace prefixes on all
elements,
> > but nothing else is even remotely unusual about the document.
> >
> > Is this a noted bug, or am I getting unexpected behavior?  TIA.
> >
> > -----
> > Brett McLaughlin
>
> Works fine for me when configured in this way:
>
> SAXParser p=new SAXParser();
> p.setFeature("http://xml.org/sax/features/namespaces",true);

Re: JAXP Version 1.0

Posted by James Duncan Davidson <ja...@eng.sun.com>.
> That's why we're friends, isn't it? :) Anyway thanks for helping :)

Not a problem. Rock and roll.. :)

----------------------------------------------------------------------
James Duncan Davidson                               duncan@eng.sun.com
Java + XML / Portable Code + Portable Data                 !try; do();


Re: JAXP Version 1.0

Posted by Pierpaolo Fumagalli <pi...@apache.org>.
James Duncan Davidson wrote:
> 
> > Now that's what I would call response time!  The spec was released on
> > 2/25/00, and the implementation is available on 2/26/00? Gee, just 11
> > minutes earlier and Xerces could claim same-day conformance...
> 
> Well, Pier is pretty quick. Of course it helped that he called me up asking
> "where the heck is the public release of the spec?" at the same time at
> which I was writing the message to xml-announce@java.sun.com announcing the
> release of the spec. ;)

That's why we're friends, isn't it? :) Anyway thanks for helping :)

	Pier
-- 
--------------------------------------------------------------------
-          P              I              E              R          -
stable structure erected over water to allow the docking of seacraft
<ma...@betaversion.org>    <http://www.betaversion.org/~pier/>
--------------------------------------------------------------------
- ApacheCON Y2K: Come to the official Apache developers conference -
-------------------- <http://www.apachecon.com> --------------------

Re: JAXP Version 1.0

Posted by James Duncan Davidson <ja...@eng.sun.com>.
> Now that's what I would call response time!  The spec was released on
> 2/25/00, and the implementation is available on 2/26/00? Gee, just 11
> minutes earlier and Xerces could claim same-day conformance...

Well, Pier is pretty quick. Of course it helped that he called me up asking
"where the heck is the public release of the spec?" at the same time at
which I was writing the message to xml-announce@java.sun.com announcing the
release of the spec. ;)

Talk about serendipity.

----------------------------------------------------------------------
James Duncan Davidson                               duncan@eng.sun.com
Java + XML / Portable Code + Portable Data                 !try; do();


Re: JAXP Version 1.0

Posted by Pierpaolo Fumagalli <pi...@apache.org>.
Jeff Mackay wrote:
> 
> Now that's what I would call response time!  The spec was released on
> 2/25/00, and the implementation is available on 2/26/00? Gee, just 11
> minutes earlier and Xerces could claim same-day conformance...

It depends on the timezone you're talking about... I got an email sayin'
that the spec was out at around 5PM PDT, and, let's say, it's not an EJB
container, it's a wrapper around a parser an a couple of factories
(development time 15 minutes, javadocs 45!)...

	Pier

-- 
--------------------------------------------------------------------
-          P              I              E              R          -
stable structure erected over water to allow the docking of seacraft
<ma...@betaversion.org>    <http://www.betaversion.org/~pier/>
--------------------------------------------------------------------
- ApacheCON Y2K: Come to the official Apache developers conference -
-------------------- <http://www.apachecon.com> --------------------

RE: JAXP Version 1.0

Posted by Jeff Mackay <jm...@vtopia.com>.
Now that's what I would call response time!  The spec was released on
2/25/00, and the implementation is available on 2/26/00? Gee, just 11
minutes earlier and Xerces could claim same-day conformance...

-----Original Message-----
From: Pierpaolo Fumagalli [mailto:pier@apache.org]
Sent: Saturday, February 26, 2000 12:11 AM
To: xerces-dev@xml.apache.org
Subject: JAXP Version 1.0


The "Java API for XML Parsing" version 1.0 is out, and I believe we're
the first ones to support it :)

http://java.sun.com/xml

	Pier

PS. Since there's no reference implementation for the current JAXP spec.
-right now- I uploaded my implementation of the javax.xml.parser
package. It's not (C) Apache since it's a javax implementation, and if
something happens, I don't want the whole group to be blamed...
--
--------------------------------------------------------------------
-          P              I              E              R          -
stable structure erected over water to allow the docking of seacraft
<ma...@betaversion.org>    <http://www.betaversion.org/~pier/>
--------------------------------------------------------------------
- ApacheCON Y2K: Come to the official Apache developers conference -
-------------------- <http://www.apachecon.com> --------------------


JAXP Version 1.0

Posted by Pierpaolo Fumagalli <pi...@apache.org>.
The "Java API for XML Parsing" version 1.0 is out, and I believe we're
the first ones to support it :)

http://java.sun.com/xml

	Pier

PS. Since there's no reference implementation for the current JAXP spec.
-right now- I uploaded my implementation of the javax.xml.parser
package. It's not (C) Apache since it's a javax implementation, and if
something happens, I don't want the whole group to be blamed...
-- 
--------------------------------------------------------------------
-          P              I              E              R          -
stable structure erected over water to allow the docking of seacraft
<ma...@betaversion.org>    <http://www.betaversion.org/~pier/>
--------------------------------------------------------------------
- ApacheCON Y2K: Come to the official Apache developers conference -
-------------------- <http://www.apachecon.com> --------------------

unsubsribe

Posted by Octav Chipara <oc...@cse.unl.edu>.
unsubscribe


Re: SAX 2 and startElement()

Posted by Pierpaolo Fumagalli <pi...@apache.org>.
Brett McLaughlin wrote:
> 
> I just hopped on the list (I've been offline for a while) so forgive me in
> advance if this has been asked and answered (possibly multiple times).
> 
> I just pulled down the latest distribution of Xerces (1.0.2) and am seeing
> some strange behavior from startElement() using
> org.apache.xerces.parsers.SAXParser as an XMLReader implementation.
> 
> The rawName gets reported correctly, e.g. the complete
> namespaceURI:localName element name.  However, both localName and
> namespaceURI come up blank.  My XML has namespace prefixes on all elements,
> but nothing else is even remotely unusual about the document.
> 
> Is this a noted bug, or am I getting unexpected behavior?  TIA.
> 
> -----
> Brett McLaughlin
> Metro Information Systems
> Work: (972) 724-3161
> Mobile: (817) 825-7187

Works fine for me when configured in this way:

SAXParser p=new SAXParser();
p.setFeature("http://xml.org/sax/features/namespaces",true);

-- 
--------------------------------------------------------------------
-          P              I              E              R          -
stable structure erected over water to allow the docking of seacraft
<ma...@betaversion.org>    <http://www.betaversion.org/~pier/>
--------------------------------------------------------------------
- ApacheCON Y2K: Come to the official Apache developers conference -
-------------------- <http://www.apachecon.com> --------------------