You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by BUNBURY Myles <My...@alcatel-lucent.com> on 2010/03/18 18:01:15 UTC
StAXSources with Xalan
I'm wondering about StAXSource support in Xalan v2.7.1.
I've inherited a piece of code that creates a
javax.xml.transform.stax.StAXSource object, which is then fed into a
schema validator producted by a javax.xml.validation.SchemaFactory. When
validating, the schema validator creates a
javax.xml.transform.Transformer from a
javax.xml.transform.sax.SAXTransformerFactory. Now, when my transformer
factory is set to
"com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl",
everything works fine, but when it's set to
"org.apache.xalan.xsltc.trax.TransformerFactoryImpl", I get the message,
"ERROR: 'Source object passed to ''{0}'' has no contents.'", followed
by the exception, "javax.xml.stream.XMLStreamException: Trying to write
END_DOCUMENT when document has no root (ie. trying to output empty
document)".
Questions:
1. What's the difference between "com.sun.org.apache.xalan.*" and
"org.apache.xalan.*"?
2. Is one better to use versus the other?
3. If "com.sun.org.apache.xalan.*" has StAXSource support (even if it's
just a wrapper for SAX), why doesn't "org.apache.xalan.*"?
4. I came across a blurb that indicated that the
"com.sun.org.apache.xalan.*" was based off of "org.apache.xalan.*"
v2.6.0, but I think that was an older version of the JRE. I'm currently
working with Java 6 update 16. What version of "org.apache.xalan.*" is
"com.sun.org.apache.xalan.*" based off of in this JRE?
---
Myles Bunbury, P.Eng., BASc.
Software Development Engineering Specialist
Omni Access 8550 Web Services Gateway
Security Solutions Group - Applications Software Group
Alcatel-Lucent
Phone: (613) 784-4325
Fax: (613) 784-8944
Web: www.alcatel-lucent.com
Re: StAXSources with Xalan
Posted by ke...@us.ibm.com.
> StAXSource is a class that was introduced by JAXP 1.4. Xalan v2.7.1
> only supports JAXP 1.3 so the answer is no it's not supported.
Of course, if someone wanted to write and contribute an implementation,
that would be a good step towards adding JAXP 1.4 support...
Re: StAXSources with Xalan
Posted by Michael Glavassevich <mr...@ca.ibm.com>.
"BUNBURY Myles" <My...@alcatel-lucent.com> wrote on 03/18/2010
01:01:15 PM:
> I'm wondering about StAXSource support in Xalan v2.7.1.
StAXSource is a class that was introduced by JAXP 1.4. Xalan v2.7.1 only
supports JAXP 1.3 so the answer is no it's not supported.
Thanks.
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org
[ANN]VTD-XML 2.10
Posted by jimmy Zhang <jz...@ximpleware.com>.
VTD-XML 2.10 is now released. It can be downloaded at
https://sourceforge.net/projects/vtd-xml/files/vtd-xml/ximpleware_2.10/.
This release includes a number of new features and enhancement.
* The core API of VTD-XML has been expanded. Users can now perform
cut/paste/insert on an empty element.
* This release also adds the support of deeper location cache support for
parsing and indexing. This feature is useful for application performance
tuning for
processing various XML documents.
* The java version also added support for processing zip and gzip files.
Direct processing of httpURL based XML is enhanced.
* Extended Java version now support Iso-8859-10~16 encoding.
* A full featured C++ port is released.
* C version of VTD-XML now make use of thread local storage to achieve
thread safety for multi-threaded application.
* There are also a number of bugs fixed. Special thanks to Jozef Aerts, John
Sillers, Chris Tornau and a number of other users for input and suggestions
Re: StAXSources with Xalan
Posted by Santiago Pericas-Geertsen <Sa...@Sun.COM>.
On Mar 20, 2010, at 3:24 PM, Michael Ludwig wrote:
> But it's good to know that Sun does care about the quality of the
> versions shipping with the JDK, and from now on I'll follow your
> constructive suggestion and point people to http://bugs.sun.com/
> instead of just saying "don't use it, it's buggy".
Fantastic. And as I said, feel free to ping me if you need help getting your bug evaluated and fixed.
-- Santiago
Re: StAXSources with Xalan
Posted by Michael Ludwig <mi...@gmx.de>.
Hi Santiago,
Santiago Pericas-Geertsen schrieb am 19.03.2010 um 13:31:25 (-0400):
> On Mar 18, 2010, at 4:48 PM, Michael Ludwig wrote:
> > BUNBURY Myles schrieb am 18.03.2010 um 12:01:15 (-0500):
> >
> >> 1. What's the difference between "com.sun.org.apache.xalan.*" and
> >> "org.apache.xalan.*"?
> >
> > The former is Sun's fork of Xalan, which ships with the JRE, just
> > like their fork of Xerces. From numerous posts on XML-related lists
> > and from my own experience I know that it's best to avoid them
> > because they have numerous astonishing bugs, especially with JDK
> > 1.6.
>
> Have you ever filed any of these bugs? If you did, let me know and I
> can forward them to the right engineers. Is there any specific area
> where these bugs are concentrated?
I'm sorry I haven't ever filed any bug with Sun. It is too easy to just
use Apache Xerces or Xalan. I made a habit of installing the Apache
versions because I've been bitten several times by the Sun versions, and
also because more experienced XML users and implementors regularly warn
people not to use the Sun versions, especially Sun Xerces for JDK 1.6.
http://lists.ibiblio.org/pipermail/xom-interest/2009-September/003992.html
But it's good to know that Sun does care about the quality of the
versions shipping with the JDK, and from now on I'll follow your
constructive suggestion and point people to http://bugs.sun.com/
instead of just saying "don't use it, it's buggy".
Best,
--
Michael Ludwig
Re: StAXSources with Xalan
Posted by Santiago Pericas-Geertsen <Sa...@Sun.COM>.
Gary,
There were a number of discussions about the 2.0 specs last year, some on the expert group list. Some experts concluded that a new API is needed to take full advantage of the 2.0 features, and that requires a new JSR. At the time, it was difficult to start new JSRs; now that the Oracle acquisition is completed, I'm sure they'll revise this plan.
Comments can be sent to mailto:jsr-206-public@jcp.org
-- Santiago
On Mar 19, 2010, at 5:47 PM, Gary Gregory wrote:
> Since we have an @sun.com person here... What is Sun's stance on getting XPath 2, or better yet XSL 2 into Java?
>
> Thank you,
> Gary
>
> Gary Gregory
> Senior Software Engineer
> Seagull Software
> email: ggregory@seagullsoftware.com
> email: ggregory@apache.org
> www.seagullsoftware.com
>
>
>> -----Original Message-----
>> From: Santiago.Pericasgeertsen@Sun.COM
>> [mailto:Santiago.Pericasgeertsen@Sun.COM]
>> Sent: Friday, March 19, 2010 10:31
>> To: Michael Ludwig
>> Cc: xalan-j-users@xml.apache.org
>> Subject: Re: StAXSources with Xalan
>>
>>
>> On Mar 18, 2010, at 4:48 PM, Michael Ludwig wrote:
>>
>>> BUNBURY Myles schrieb am 18.03.2010 um 12:01:15 (-0500):
>>>
>>>> 1. What's the difference between "com.sun.org.apache.xalan.*" and
>>>> "org.apache.xalan.*"?
>>>
>>> The former is Sun's fork of Xalan, which ships with the JRE, just
>> like
>>> their fork of Xerces. From numerous posts on XML-related lists and
>> from
>>> my own experience I know that it's best to avoid them because they
>> have
>>> numerous astonishing bugs, especially with JDK 1.6.
>>
>> Have you ever filed any of these bugs? If you did, let me know and I
>> can forward them to the right engineers. Is there any specific area
>> where these bugs are concentrated?
>>
>> -- Santiago
>
Re: StAXSources with Xalan
Posted by Santiago Pericas-Geertsen <Sa...@Sun.COM>.
On Mar 18, 2010, at 4:48 PM, Michael Ludwig wrote:
> BUNBURY Myles schrieb am 18.03.2010 um 12:01:15 (-0500):
>
>> 1. What's the difference between "com.sun.org.apache.xalan.*" and
>> "org.apache.xalan.*"?
>
> The former is Sun's fork of Xalan, which ships with the JRE, just like
> their fork of Xerces. From numerous posts on XML-related lists and from
> my own experience I know that it's best to avoid them because they have
> numerous astonishing bugs, especially with JDK 1.6.
Have you ever filed any of these bugs? If you did, let me know and I can forward them to the right engineers. Is there any specific area where these bugs are concentrated?
-- Santiago
Re: StAXSources with Xalan
Posted by Santiago Pericas-Geertsen <Sa...@Sun.COM>.
On Mar 19, 2010, at 12:24 PM, Michael Glavassevich wrote:
> There's more info about the different versions here [1]. I'm not
> > sure about the EntityResolver2 issue; a lot of bug fixes have been
> > applied since the original fork and it's possible that someone re-
> > introduced some pre-2.7.0 code.
>
> At the time (February 2005) it absolutely had to have been based off of pre-2.7.0 code. Java 5 had already been released. Xerces 2.7.0 was still in development.
You may be right for FCS. However, there were syncs with Apache after that. So the update releases of 5 (and 6) that people are using nowadays should have 2.7.0 plus bug fixes.
-- Santiago
Re: StAXSources with Xalan
Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Santiago.Pericasgeertsen@Sun.COM wrote on 03/19/2010 09:02:20 AM:
> > > What version of "org.apache.xalan.*" is "com.sun.org.apache.xalan.*"
> > > based off of in this JRE?
> >
> > As far as I know, not even off of some stable release. If you want to
> > know, ask Sun.
>
> I have good reason to believe that it wasn't forked off stable
> releases for Java 5. I recall someone who was using the
> com.sun.org.apache.xerces.* version reporting a bug on the Xerces
> user list that must have been in unreleased code (something to do
> with the infrastructure I'd put down to support EntityResolver2 [1]
> if I recall correctly; at the time the code was unreachable through
> SAX) that I had written in between Xerces 2.6.2 and 2.7.0. That bug
> has never existed in any released version of Xerces so expect the
> snapshot was taken on some arbitrary day between the two releases.
> Perhaps the same thing happened with Java 6 and wouldn't be
> surprised if it has diverged significantly since then to support
> APIs like StAX which we haven't finished implementing here yet.
>
> There's more info about the different versions here [1]. I'm not
> sure about the EntityResolver2 issue; a lot of bug fixes have been
> applied since the original fork and it's possible that someone re-
> introduced some pre-2.7.0 code.
At the time (February 2005) it absolutely had to have been based off of
pre-2.7.0 code. Java 5 had already been released. Xerces 2.7.0 was still in
development.
> As you said, there have been a number of changes around StAX and
> also the Validation API in 1.4.
>
> -- Santiago
>
> [1] https://jaxp.dev.java.net/1.4/JAXP-FAQ.html
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org
Re: StAXSources with Xalan
Posted by Santiago Pericas-Geertsen <Sa...@Sun.COM>.
On Mar 18, 2010, at 11:47 PM, Michael Glavassevich wrote:
> Michael Ludwig <mi...@gmx.de> wrote on 03/18/2010 04:48:11 PM:
>
> > > What version of "org.apache.xalan.*" is "com.sun.org.apache.xalan.*"
> > > based off of in this JRE?
> >
> > As far as I know, not even off of some stable release. If you want to
> > know, ask Sun.
>
> I have good reason to believe that it wasn't forked off stable releases for Java 5. I recall someone who was using the com.sun.org.apache.xerces.* version reporting a bug on the Xerces user list that must have been in unreleased code (something to do with the infrastructure I'd put down to support EntityResolver2 [1] if I recall correctly; at the time the code was unreachable through SAX) that I had written in between Xerces 2.6.2 and 2.7.0. That bug has never existed in any released version of Xerces so expect the snapshot was taken on some arbitrary day between the two releases. Perhaps the same thing happened with Java 6 and wouldn't be surprised if it has diverged significantly since then to support APIs like StAX which we haven't finished implementing here yet.
>
There's more info about the different versions here [1]. I'm not sure about the EntityResolver2 issue; a lot of bug fixes have been applied since the original fork and it's possible that someone re-introduced some pre-2.7.0 code.
As you said, there have been a number of changes around StAX and also the Validation API in 1.4.
-- Santiago
[1] https://jaxp.dev.java.net/1.4/JAXP-FAQ.html
Re: StAXSources with Xalan
Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Michael Ludwig <mi...@gmx.de> wrote on 03/18/2010 04:48:11 PM:
> > What version of "org.apache.xalan.*" is "com.sun.org.apache.xalan.*"
> > based off of in this JRE?
>
> As far as I know, not even off of some stable release. If you want to
> know, ask Sun.
I have good reason to believe that it wasn't forked off stable releases for
Java 5. I recall someone who was using the com.sun.org.apache.xerces.*
version reporting a bug on the Xerces user list that must have been in
unreleased code (something to do with the infrastructure I'd put down to
support EntityResolver2 [1] if I recall correctly; at the time the code was
unreachable through SAX) that I had written in between Xerces 2.6.2 and
2.7.0. That bug has never existed in any released version of Xerces so
expect the snapshot was taken on some arbitrary day between the two
releases. Perhaps the same thing happened with Java 6 and wouldn't be
surprised if it has diverged significantly since then to support APIs like
StAX which we haven't finished implementing here yet.
> --
> Michael Ludwig
Thanks.>
[1] http://markmail.org/message/hptpaexe6ygh3e7v
Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org
Re: StAXSources with Xalan
Posted by Michael Ludwig <mi...@gmx.de>.
BUNBURY Myles schrieb am 18.03.2010 um 12:01:15 (-0500):
> 1. What's the difference between "com.sun.org.apache.xalan.*" and
> "org.apache.xalan.*"?
The former is Sun's fork of Xalan, which ships with the JRE, just like
their fork of Xerces. From numerous posts on XML-related lists and from
my own experience I know that it's best to avoid them because they have
numerous astonishing bugs, especially with JDK 1.6.
> 2. Is one better to use versus the other?
Yes. always use the original Apache versions.
> 3. If "com.sun.org.apache.xalan.*" has StAXSource support (even if
> it's just a wrapper for SAX), why doesn't "org.apache.xalan.*"?
I've never used that, so I can't comment on this one.
> 4. I came across a blurb that indicated that the
> "com.sun.org.apache.xalan.*" was based off of "org.apache.xalan.*"
> v2.6.0, but I think that was an older version of the JRE. I'm
> currently working with Java 6 update 16.
Alright, Java 6, so get rid of the Sun forks as soon as possible.
Simply drop the Apache versions into your extension directory.
> What version of "org.apache.xalan.*" is "com.sun.org.apache.xalan.*"
> based off of in this JRE?
As far as I know, not even off of some stable release. If you want to
know, ask Sun.
--
Michael Ludwig