Re: Kxml: Issues with WbxmlParser.java in KXML2 rel. 2.1.8
"Eric Vuillermet" <[email protected]> Mon, 20 Oct 2003 17:33:34 +0000
| Newsgroups | gmane.comp.java.enhydra.kxml |
|---|---|
| Message-ID | <[email protected]> |
Hi Stephan,
Thanks for your reply. I've downloaded the latest files under
src/kxml/kxml2/src/org/kxml2/wap/ to get your fixes. One of the test files I
was using failed with the latest changes, because of the commented out code
in the method parseElement of the WbxmlParser class.
I think I understand what the problem is: by default, the attribute
FEATURE_PROCESS_NAMESPACES is set to false in WbxmlParser. So, the code in
parseElement:
if (processNsp)
adjustNsp();
else
namespace = "";
prevents adjustNsp() from being called. Therefore, the array nspCounts never
grows. An example of xml that would not rountrip is:
<a><b><c><d></d></c></b></a>, whereas <a><b><c></c></b></a> roundtrips
correctly.
I tried to set FEATURE_PROCESS_NAMESPACES to true before parsing the wxbml
of the example above, but still fails because adjustNsp() hasn't adjusted
nspCounts. For now, I am going to keep the code uncommented until I figure
out how nspCounts works.
Eric
----Original Message Follows----
From: Stefan Haustein <[email protected]>
Reply-To: [email protected]
To: [email protected]
Subject: Re: Kxml: Issues with WbxmlParser.java in KXML2 rel. 2.1.8
Date: Sun, 19 Oct 2003 22:58:27 +0200
Eric Vuillermet wrote:
>I am using the WbxmlParser class in KXML2 2.1.8 and wasn't able to
>"roundtrip" my xml to wbxml and back. I found a few issues with the class
>that pushed me to debug it and figured out enough of those issues to make
>the parser work for the project I am working on.
>
>I am not sure if this is the right forum to post these changes, but I am
>outputting the changed class for anybody who is experiencing the same
>problems with this class (look for "EV>>>" comments).
Eric,
thanks a lot for your help!
Actually, most of the issues were already fixed in the version available via
public CVS, but there was no new release yet because I still have a bunch of
changes from Bogdan Onoi I still need to apply...
>It'd be nice if the author of the class could look at those changes and let
>everyone know if they are correct or not. One of the issue got fixed by
>uncommented code that worked perfectly, so I am curious to know why was
>this code commented in the first place !
The commented code was made obsolete by the adjustNsp() method. Can you
provide any hint how to reproduce the problem, perhaps an xml fragment I can
feed to the roundtrip so I can figure out what's going wrong with that?
I have added a Wbxml rountdtrip example to the version available in CVS:
http://cvs.sourceforge.net/viewcvs.py/kxml/kxml2/samples/WbxmlRoundtrip.java?view=markup
Cheers,
Stefan
_______________________________________________
Kxml mailing list
[email protected]
http://www.enhydra.org/mailman/listinfo.cgi/kxml
_________________________________________________________________
Enjoy MSN 8 patented spam control and more with MSN 8 Dial-up Internet
Service. Try it FREE for one month! http://join.msn.com/?page=dept/dialup