Android Tutorial [java] Auto generate library documentation with xml2bb

warwound

Expert
Licensed User
Longtime User
I just added the word doesn't to a library class and generated the xml file.
Looking in the xml file with a text editor i see the apostrophe has not been escaped.
Uploading the xml file to my xml2bb script and generating BB or HTML documentation works as expected - no errors relating to the apostrophe.

Do you want to upload the xml file that causes this error and i'll take a look?

Martin.
 

tchart

Well-Known Member
Licensed User
Longtime User
Thanks Warwound. Ive tried it again and its not crashing now. Did anything change? Either way, Im happy.
 

DonManfred

Expert
Licensed User
Longtime User

walterf25

Expert
Licensed User
Longtime User
Library reference generator

This isn't so much a tutorial but i'll post it here anyway...

Have you spent ages laboriously adding javadoc comments to your B4A libraries and then, when you are ready to publish the library and create a new forum thread, find you have to either copy/paste and modify all those javadoc comments to create some documentation in the new thread OR you simply do not bother and leave the library user to figure things out themselves?

Try my xml2bb script.

Copy n paste a library's XML file into the textarea and hit Submit and my script will generate some nicely formatted BB code ready for you to copy into your new thread.

Got a thread where a library has been updated many times and the documentation is fragmented over many pages?
No probs - just generate some new BB code and keep all that documentation in a single post!

I've just updated my YouTubeStreamFinder and Geocoder library documentation if you want to see the format of BB code produced.

All classes, methods, properties, events and permissions are sorted by the script and a bit of color added.

If anyone shows interest i'll add some formatting options - so you can customise it's output.

Martin.
Hi Martin thanks for this great tool, i've used it a few times for the few libraries i've wrapped, unfortunately i just tried using it to create the documentation for an updated library but i keep getting an error, It says "String could not be parsed", do you have any idea why this is, i've double checked my xml file and i don't see anything out of the ordinary, i'd really appreciate it if you could take a look and let me know what you find out.

Thanks,
Walter
 

warwound

Expert
Licensed User
Longtime User
Hi Walter.

Can you let me have a copy of the xml file that causes this error?

Martin.
 

walterf25

Expert
Licensed User
Longtime User

Attachments

  • B4AGraphView.xml
    30.3 KB · Views: 811

warwound

Expert
Licensed User
Longtime User
I just tried to open your xml file in Firefox and got this error:

XML Parsing Error: not well-formed
Location: file:///home/martin/Public/B4AGraphView.xml
Line Number 131, Column 40: &lt;code&gt;graphview.SetCustomLabel("￿")&lt;/code&gt;</comment>
---------------------------------------^

The pointer ^ points to the unrecognized character in SetCustomLabel("￿").
(It doesn't align here as i've copy/pasted the error from Firefox).

Martin.
 

walterf25

Expert
Licensed User
Longtime User
I just tried to open your xml file in Firefox and got this error:



The pointer ^ points to the unrecognized character in SetCustomLabel("￿").
(It doesn't align here as i've copy/pasted the error from Firefox)."

Martin.
Wow i can't believe that, in the documention i have an example to set a custom label format where I put the Euro sign "€",LOL i can't believe this was it, any how i've changed it to the Dollar sign "$" it seems like it doesn't complain about this one. Thanks Martin, appreciate it.

Cheers,
Walter
 

tchart

Well-Known Member
Licensed User
Longtime User
Martin,

Ive noticed your wonderful tool doesn't handle a few cases as they should be handled. For example;

@Events(values={"ButtonPress(Result as Int)", "Cancel()", "Dismiss()"... etc

Comes out as

Events:
  • ButtonPress (Result as Int As )
  • Cancel ( As )
  • Dismiss ( As )
  • Show ( As )
So for ButtonPress I've figured out it needs to be "As" and not "as"

Cancel() needs to be Cancel.

But it would be nice if it would handle these cases automatically.

Thanks again for your tool, I would be lost without it.

Trevor
 

warwound

Expert
Licensed User
Longtime User
@tchart

Yes, the tool fails to correctly handle various Events.
Events that return a value also fail.

The tool uses a PHP script to parse the library XML file and it's not easy to update it to handle each and every possibility.
Rather than try to fix the existing tool my plan is to create a new tool based on the BADoclet class.
The BADoclet correctly handles all possible scenarios in the library classes and produces the XML required for the b4a IDE.
So i thought it'd be easier to modify the BADoclet or create a new Doclet with similar functionality and this doclet would output an HTML help document instead of the b4a IDE XML file.

I've no idea when i'll have time to look at this update - it's 'on the back burner' as they say!
 

warwound

Expert
Licensed User
Longtime User
I could share - no problems there.
But having looked at BADoclet using JD-GUI i see the java Doclet class is the tool for this job and not php.
The Doclet class is intended to read class comments and generate documentation so its the obvious choice.

Ideally we could use the Doclet class in b4j and create our own custom library reference generators.
Just needs one of us members to go first and put an example together which others could modify to suit.
 

somed3v3loper

Well-Known Member
Licensed User
Longtime User
Hi Martin ,
This great tool is not working for me any more .
After clicking upload , the page seems to reload but without BBCode box
 
Top