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
DOM2XmlPullBuilder   Message List  
Reply | Forward Message #282 of 308 |
Re: [xmlpull-user] DOM2XmlPullBuilder

hi Fred,

an excellent bug report - now in bugzilla
http://www.extreme.indiana.edu/bugzilla/show_bug.cgi?id=246

and it is now fixed in xpp3-1.1.4 and in CVS - it is just one-liner (see
below)

thanks,

alek

Revision Changes Path
1.9 +29 -26
xmlpull-api-v1/addons/java/dom2_builder/src/org/xmlpull/v1/dom2_builder/DOM2XmlP\
ullBuilder.java

Index: DOM2XmlPullBuilder.java
===================================================================
RCS file:
/l/extreme/cvspub/xmlpull-api-v1/addons/java/dom2_builder/src/org/xmlpull/v1/dom\
2_builder/DOM2XmlPullBuilder.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -t -w -r1.8 -r1.9
--- DOM2XmlPullBuilder.java 23 Oct 2006 04:01:08 -0000 1.8
+++ DOM2XmlPullBuilder.java 23 Oct 2006 05:05:58 -0000 1.9
@@ -182,7 +182,10 @@
String prefix = pp.getNamespacePrefix(i);
for (int j = top; j > i; --j)
{
- if(prefix.equals(pp.getNamespacePrefix(j))) {
+ String prefixJ = pp.getNamespacePrefix(j);
+ if((prefix != null && prefix.equals(prefixJ))
+ || (prefix != null && prefix == prefixJ) )
+ {
// prefix is already declared -- skip it
continue LOOP;
}






Frederick Burkley wrote:
> I'm looking into the DOM2XmlPullBuilder class and I get a
> NullPointerException when attempting to parse the following file:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <ServerConfiguration xmlns=" http://your-namespace-here
> <http://your-namespace-here/>"
> xmlns:xsi="http://www.w3.org/2001/XMLSchem a-instance
> <http://www.w3.org/2001/XMLSchema-instance>" xsi:schemaLocation="
> http://your-namespace-here <http://your-namespace-here/> test.xsd">
> <Server>savage-m60</Server>
> </ServerConfiguration>
>
>
> Although I can successfully parse the following:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <jtc:ServerConfiguration xmlns:jtc="http://your-namespace-here
> <http://your-namespace-here/>"
> xmlns:xsi="http://www.w3.org/2001/XMLSchem a-instance
> <http://www.w3.org/2001/XMLSchema-instance>"
> xsi:schemaLocation="http://your-namespace-here
> <http://your-namespace-here/> test.xsd">
> <jtc:Server>savage-m60</jtc
> :Server>
> </jtc:ServerConfiguration>
>
>
>
> Is there something wrong with the first form of this instance document?
>
>
> Respectfully,
> Fred Burkley
>
>
> The sample parse code follows.
>
>
> import java.io.File;
> import java.io.FileReader ;
> import org.xmlpull.v1.dom2_builder.DOM2XmlPullBuilder;
>
> public class PullParserTest {
> public static void main(String[] args) {
> File file;
> FileReader fileReader;
> DOM2XmlPullBuilder pullBuilder;
>
> if (args.length < 1) {
> System.out.println("Enter the name of the XML file on the
> command line.");
> System.exit(0);
> }
> try {
> file = new File(args[0]);
> fileReader = new FileReader(file);
> pullBuilder = new DOM2XmlPullBuilder();
> pullBuilder.parse(fileReader);
> }
> catch (Exception ex) {
> ex.printStackTrace();
> }
> }
> }
>
>
>


--
The best way to predict the future is to invent it - Alan Kay




Mon Oct 23, 2006 5:13 am

as10m
Offline Offline
Send Email Send Email

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

I'm looking into the DOM2XmlPullBuilder class and I get a NullPointerException when attempting to parse the following file: <?xml version="1.0"...
Frederick Burkley
fburkley
Offline Send Email
Oct 20, 2006
11:56 pm

hi Fred, an excellent bug report - now in bugzilla http://www.extreme.indiana.edu/bugzilla/show_bug.cgi?id=246 and it is now fixed in xpp3-1.1.4 and in CVS -...
Aleksander Slominski
as10m
Offline Send Email
Oct 23, 2006
5:19 am
Advanced

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