Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes XML and Related Technologies and the fly likes More than one in XML tag? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "More than one in XML tag?" Watch "More than one in XML tag?" New topic
Author

More than one in XML tag?

Pan Niko
Ranch Hand

Joined: Mar 19, 2011
Posts: 86

Is possible to have more than one elements in a tag? For example, i want to have address of photos in the same tag. If yes, how?

Thank you
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12756
    
    5
Are you perhaps talking about "attributes" ?

Basic XML article in Wikipedia.

Bill
Pan Niko
Ranch Hand

Joined: Mar 19, 2011
Posts: 86

No, no..i mean something like that, <image>pic_1.jpg, pic_2.jpg, pic_3.jpg, pic_4.jpg</image>

is possible?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Sure, you can put any text you like inside an element. But your example is really not a good design, because it requires the consumer of the document to use some non-XML rules to split that text up into meaningful information. An obvious improvement is this:
 
Consider Paul's rocket mass heater.
 
subject: More than one in XML tag?
 
Similar Threads
Doubt regarding tld file
auth-constraint doubt
error in opening tld
Html tag
Using Hyperlink Tag in Div Tag