File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What do tags with semicolons mean?

 
K Riaz
Ranch Hand
Posts: 375
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic