This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes What do tags with semicolons mean? 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 "What do tags with semicolons mean?" Watch "What do tags with semicolons mean?" New topic
Author

What do tags with semicolons mean?

K Riaz
Ranch Hand

Joined: Jan 08, 2005
Posts: 375
I keep seeing tags with semicolons like the one below and wonder why they exist?



Whats with the "<journal:journal" part?

Also, in another XML document:



Why not " <tspan space="preserve"></tspan>" without the "xml:" bit? How is it like to parse the above elements? Do you need to do anything special, particularly in JDOM?

Thanks.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12760
    
    5
The part before the colon establishes the "namespace" that the tag belongs to. The start of the XML document establishes the namespaces that are in use and how they will be referrd to.
Here is a short article on handling namespaces.
The fact that you might see a reference to "xml:space" in one document and "space" in another depends on how the document is set up.
For example, I am working with the FOP (formatting objects project) fo tags - mixed with XSL tags. By starting the document:

I don't have to write "fo:block" but can use "block" - the "fo:" is default for the document, but I do have to write all xsl tags with "xsl:"

Just another source of confusion - XML has plenty of them.
Bill
 
wood burning stoves
 
subject: What do tags with semicolons mean?
 
Similar Threads
create calendar java
XPath
global forward not overwriting url
Newbie: javax . xml . transform . Transformer Configuration Exception
setting HTML format for only one item in a JSP/EL list