Ack. Ok, for the record I'm working with XStream 1.1.3. My apologies
if this is really an XStream question (flame away!)
XStream has three main interfaces:
HierarchicalStreamDriver
HierarchicalStreamReader
HierarchicalStreamWriter
... and there is a corresponding Xpp implementation for each of those
interfaces.
What I've done is extended the Xpp driver and reader implementations
(I don't care about writer) and I've overridden certain methods to
enable the DOCDECL feature.
However, I'm getting this stack trace [0] when I attempt to set the
feature, and I'm not sure why. I am using XStream 1.1.3 and XPP
1.1.3.3 from the IBiblio maven repository
(http://www.ibiblio.org/maven2/xpp3/xpp3/1.1.3.3/xpp3-1.1.3.3.jar).
The exception puzzles me because it originates from
org.xmlpull.mxp1.MXParser.setFeature(MXParser.java:453). Am I using
an incorrect or older version of Xpp?
Thanks for your guidance to someone who knows enough to be dangerous,
Elliot
[0] Exception below:
Exception in thread "main"
edu.jhu.library.scratch.xstream.InitializationException: Unable to
create an XmlPullParser with feature
http://xmlpull.org/v1/doc/features.html#process-docdecl enabled.
at
edu.jhu.library.scratch.xstream.XppDocDeclEnabledReader.createParser(XppDocDeclE\
nabledReader.java:35)
at com.thoughtworks.xstream.io.xml.XppReader.<init>(XppReader.java:25)
at
edu.jhu.library.scratch.xstream.XppDocDeclEnabledReader.<init>(XppDocDeclEnabled\
Reader.java:18)
at
edu.jhu.library.scratch.xstream.XppDocDeclDriver.createReader(XppDocDeclDriver.j\
ava:22)
at
com.thoughtworks.xstream.XStream.createObjectInputStream(XStream.java:783)
at
edu.jhu.library.scratch.xstream.EresXstream.<init>(EresXstream.java:105)
at edu.jhu.library.scratch.xstream.EresXstream.main(EresXstream.java:152)
Caused by: org.xmlpull.v1.XmlPullParserException: processing DOCDECL
is not supported
at org.xmlpull.mxp1.MXParser.setFeature(MXParser.java:453)
at
edu.jhu.library.scratch.xstream.XppDocDeclEnabledReader.createParser(XppDocDeclE\
nabledReader.java:31)
... 6 more
--- In xmlpull-user@yahoogroups.com, Aleksander Slominski <aslom@...>
wrote:
>
> fibremux999 wrote:
> > Hi,
> >
> > I'm working with some software that uses xpp3 as its parser. However
> > the software as it is designed doesn't allow me to have access to the
> > parser factory.
> >
> > Since I don't have access to the parser factory, I'm unable to call
> > the setFeature() method on the factoy. Specifically I need to enable
> > the FEATURE_PROCESS_DOCDECL
> > (http://xmlpull.org/v1/doc/features.html#process-docdecl) feature.
> >
> > Am I able to enable factory features by setting a system property, or
> > can that only be done via the setFeature() method itself?
> >
> > I've attempted to set a variety of system properties, none of which
> > seem to work.
> >
> if you know the parser implementation class name you can create it
> directly without factory and call setFeature on that parser (that is
> what factory is typically doing)
>
> HTH,
>
> alek
>
> --
> The best way to predict the future is to invent it - Alan Kay
>