Search the web
Sign In
New User? Sign Up
xmlpull-user
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Setting factory features from System properties?   Message List  
Reply | Forward Message #268 of 308 |
Re: Setting factory features from System properties?

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
>








Wed May 24, 2006 5:09 pm

fibremux999
Offline Offline
Send Email Send Email

Forward
Message #268 of 308 |
Expand Messages Author Sort by Date

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....
fibremux999
Offline Send Email
May 24, 2006
3:29 pm

... 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...
Aleksander Slominski
as10m
Offline Send Email
May 24, 2006
3:57 pm

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: ...
fibremux999
Offline Send Email
May 24, 2006
5:31 pm

XPP3 does nto support DOCDECL feature instead pull from CVS xni2xmlpull and use it instead (assuming sourceforge cvs works ...) ...
Aleksander Slominski
as10m
Offline Send Email
May 24, 2006
5:38 pm

... Apparently I don't know enough to read the implementation feature matrix at http://www.xmlpull.org/impls.shtml :) ... Ok, I'm not sure how much work needs...
fibremux999
Offline Send Email
May 24, 2006
8:33 pm

Hi Alek, ... I wrote an XNI driver and reader implementation for XStream, but when I attempted to set the DOCDECL feature it crashed and burned. I'm working...
fibremux999
Offline Send Email
May 26, 2006
3:24 am

Ok, Duh. I read that DOCDECL is always enabled for xni2xml. Sorry for making so much noise. Ok, so I have entities defined in my document declaration that...
fibremux999
Offline Send Email
May 26, 2006
3:24 am

... This was an Elliot issue. I was instatiating the parser like so: XmlPullParserFactory factory = X2ParserFactory.newInstance(); parser =...
fibremux999
Offline Send Email
May 26, 2006
5:37 pm

... <snip> ... It seems to be an Elliot issue. I was creating the parser via the X2ParserFactory thus: XmlPullParserFactory factory =...
fibremux999
Offline Send Email
May 26, 2006
5:38 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help