How to write XML code in my docs?

Adding following in the class comments strips off tags.

Can anyone help.

Thanks

* <servlet>

*<name>Configuration</name>

* <description>Configuration initializer</description>

* <code>ik.common.ConfigurationServlet</code>

*<init-parameter>

* <name>configfile</name>

* <value>c:/properties/icsconfig.xml</value>

* <i>(Location of the file may be different on every workstation)</i>

*</init-parameter>

*<init-parameter>

* <name>state</name>

* <value>dev</value>

*</init-parameter>

*<autostart>true</autostart>

*</servlet>

[1039 byte] By [shaikhm] at [2007-9-26 14:20:57]
# 1

I don't see anything in this comment that would cause tags to be stripped.

I presume you're speaking of standalone tags that would trail these comments,

such as @return, @param, @see.

Which version of Javadoc are you using?

Please post the entire comment -- perhaps that will help me.

-Doug Kramer

Javadoc team

dkramer at 2007-7-2 15:58:59 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2

I ran it on both jdk1.3 and jdk 1.1.7 (IBM VAJ 3.02)

Here is the class comment :

/**

* Application Configuration class using xml input. <p>

* <b> User Guide </b><p>

* <p><u>Using configuration in your programs </u><p>

*1) Add project, "IBM XML Parser for Java" in your workspace

*2) Call <code>Configuration.getInstance ().getProperty ("name"); </code><p>

*<i>getInstance () throws IcsRuntimeException, client doesnt have to catch it.</i>

*If you want to add new parameters, please contact Mehmood Shaikh.

*

*

<u> Setting up your local Websphere Test Environment to use Configuration </u>

*Before you can test your code on WTE, a few changes in the environment will be required, as follows :

*1) Add following lines in C:\IBMVJava\IDE\project_resources\IBM WebSphere Test Environment\hosts\default_host\default_app\servlets\default_app.webapp

* <servlet>

*<name>ICSConfiguration</name>

* <description>ICS Configuration initializer</description>

* <code>ccra.ik.common.ConfigurationServlet</code>

*<init-parameter>

* <name>configfile</name>

* <value>c:/ics/properties/icsconfig.xml</value>

* <i>(Location of the file may be different on every workstation)</i>

*</init-parameter>

*<init-parameter>

* <name>state</name>

* <value>dev</value>

*</init-parameter>

*<autostart>true</autostart>

*</servlet>

*2) In icsconfig.xml, change the basedir parameter to the location of

* where all properties file reside.

* @author Mehmood Shaikh

* @todoCreate DTD for the xml file and use a validating parser.

*/

When i run javadoc, i get following error and xml tags are stripped off

C:\TEMP>javadoc ccra.ik.common.Configuration

Loading source file for class ccra.ik.common.Configuration...

Constructing Javadoc information...

Building tree for all the packages and classes...

Building index for all the packages and classes...

Generating overview-tree.html...

Generating index-all.html...

javadoc: warning - Configuration: @return tag has no arguments.

javadoc: warning - Configuration: @see tag has no arguments.

javadoc: warning - get: @return tag has no arguments.

javadoc: warning - get: @see tag has no arguments.

javadoc: warning - getAll: @see tag has no arguments.

javadoc: warning - getAllProperties: @see tag has no arguments.

javadoc: warning - getInstance: @see tag has no arguments.

javadoc: warning - getProperty: @see tag has no arguments.

javadoc: warning - getProperty: @see tag has no arguments.

Generating deprecated-list.html...

Building index for all classes...

Generating allclasses-frame.html...

Generating index.html...

Generating packages.html...

Generating ccra\ik\common\Configuration.html...

Tag @see: Malformed:

Tag @see: Malformed:

Tag @see: Malformed:

Tag @see: Malformed:

Tag @see: Malformed:

Tag @see: Malformed:

Tag @see: Malformed:

Generating serialized-form.html...

Generating package-list...

Generating help-doc.html...

Generating stylesheet.css...

9 warnings

This is what the javadoc output looks like

ccra.ik.common

Class Configuration

java.lang.Object

|

+--ccra.ik.common.Configuration

--

public class Configuration

extends java.lang.Object

Application Configuration class using xml input.

User Guide

Using configuration in your programs

1) Add project, "IBM XML Parser for Java" in your workspace

2) Call Configuration.getInstance ().getProperty ("name");

getInstance () throws IcsRuntimeException, client doesnt have to catch it.

If you want to add new parameters, please contact Mehmood Shaikh.

Setting up your local Websphere Test Environment to use Configuration

Before you can test your code on WTE, a few changes in the environment will be required, as follows :

1) Add following lines in C:\IBMVJava\IDE\project_resources\IBM WebSphere Test Environment\hosts\default_host\default_app\servlets\default_app.webapp

ICSConfiguration

ICS Configuration initializer

ccra.ik.common.ConfigurationServlet

configfile

c:/ics/properties/icsconfig.xml

(Location of the file may be different on every workstation)

state

dev

true

2) In icsconfig.xml, change the basedir parameter to the location of where all properties file reside.

shaikhm at 2007-7-2 15:58:59 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 3

From what I've seen so far, Javadoc appears to be behaving the way it should (except

the first @return and @see warnings are inexplicable). The @author and @todo tags

output nothing by default. (Nothing in the XML is causing them to be stripped.)

To output @author tag, you need to supply the -author option on the command line.

To output @todo tag, you need to use Javadoc 1.4 and use the "-tag todo:a:"To Do:" option.

This is a non-standard, or custom, tag. Custom tags are not supported in previous versions.

For more info: http://java.sun.com/j2se/1.4/docs/tooldocs/solaris/javadoc.html#tag

Javadoc passes all text prior to the first standalone @tag to the output untouched, except for

processing inline tags, such as {@link}.

best regards,

-Doug Kramer

Javadoc team

dkramer at 2007-7-2 15:58:59 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 4
If you tried running javadoc on the comment i enclosed in my previous email, you'll see that all the tags between <servlet> and </servlet> is removed.RegardsMehmood
shaikhm at 2007-7-2 15:58:59 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 5

Aha, so you're saying the XML tags are missing, not the javadoc tags. The following HTML is generated by Javadoc 1.3.1.

It properly includes all of the XML tags between <servlet> and </servlet>. If you look at the source code of your file, I believe you'll see the same thing. However, when I display this in Netscape, everything after <init-parameter> is not displayed. This is a brower "problem", not a javadoc bug. I'm not familiar with the <init-parameter> tag, but it apparently is not ignored by HTML browsers.

The proper way to insert the <init-parameter> tag is to use the entities for the angle brackets:

<int-parameter>

This would prevent it from being interpreted as an HTML tag by the browsers.

Here is the output I get:

<P>

Application Configuration class using xml input. <p>

<b> User Guide </b><p>

<p><u>Using configuration in your programs </u><p>

1) Add project, "IBM XML Parser for Java" in your workspace

2) Call <code>Configuration.getInstance ().getProperty ("name"); </code><p>

<i>getInstance () throws IcsRuntimeException, client doesnt have to catch it.</i>

If you want to add new parameters, please contact Mehmood Shaikh.

<u> Setting up your local Websphere Test Environment to use Configuration </u>

Before you can test your code on WTE, a few changes in the environment will be required, as follows :

1) Add following lines in C:\IBMVJava\IDE\project_resources\IBM WebSphere Test Environment\hosts\default_host\default_app\servlets\default_app.webapp

<servlet>

<name>ICSConfiguration</name>

<description>ICS Configuration initializer</description>

<code>ccra.ik.common.ConfigurationServlet</code>

<init-parameter>

<name>configfile</name>

<value>c:/ics/properties/icsconfig.xml</value>

<i>(Location of the file may be different on every workstation)</i>

</init-parameter>

<init-parameter>

<name>state</name>

<value>dev</value>

</init-parameter>

<autostart>true</autostart>

</servlet>

2) In icsconfig.xml, change the basedir parameter to the location of

where all properties file reside.

<P>

-Doug Kramer

Javadoc team

dkramer at 2007-7-2 15:58:59 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 6

Unfortunately, my previous message was not displayed as I had intended. It should have looked like this:

The proper way to insert the <init-parameter> tag is to use the entities for the angle brackets:

&lt;int-parameter&gt;

-Doug Kramer

Javadoc team

dkramer at 2007-7-2 15:58:59 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...