Skip to main content

how to generate tags on runtime?

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
1 reply [Last post]
ayeshasilvia
Offline
Joined: 2011-08-15

hello,

I am in an urgent need of a solution! I was reading the following tutorial:

http://jaxb.java.net/tutorial/section_6_2_7_6-Collecting-Unspecified-Ele...

what i'm looking for is the marshalling procedure to generate such xml. that is, to generate the xml tag runtime. for example, if value="5" then the tag will be numeric:

<numeric>5</numeric>

if value="hello" then xml tag will be text:

<text>hello</text>

can anyone pls pls pls tell me how can i achieve such output?

Regards,

Ayesha.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
780 Guest 1
Offline
Joined: 2011-08-16

hello,

I am in an urgent need of a solution! I was reading the following tutorial:

http://jaxb.java.net/tutorial/section_6_2_7_6-Collecting-Unspecified-Ele...

what i'm looking for is the marshalling procedure to generate such xml. that
is, to generate the xml tag runtime. for example, if value="5" then the tag
will be numeric:

5

if value="hello" then xml tag will be text:

hello

can anyone pls pls pls tell me how can i achieve such output?

 

Regards,

Ayesha.