File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes OO, Patterns, UML and Refactoring and the fly likes Using XML for string message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Using XML for string message" Watch "Using XML for string message" New topic

Using XML for string message

Deepti Bhatia

Joined: Oct 19, 2006
Posts: 25

We have to design our application to communicate to other java system with string messages. Could you guide if we can use XML to validate the message length , indivisual parameters rather than having string comparision coded for huge message.

Duc Vo
Ranch Hand

Joined: Nov 20, 2008
Posts: 254
XML is a string. There should be no restriction that stops you from passing XML there.

“Everything should be as simple as it is, but not simpler.” Albert Einstein
Deepti Bhatia

Joined: Oct 19, 2006
Posts: 25
Ok...and what about the XML tags. When the XML is formed they are part of it.The string message that we have would be something like eg : FULLNAME length 10, FirstName length 7.

Request message - FULLNAME00DRAGO00. something like. How do we get this from an XML. Am very new to XML can you guide.

Sergey Arnaut

Joined: Nov 03, 2008
Posts: 7
Why cant you use xsd schema? It can define the max and min length of element text and attribute. Or you can possibly use DTD.
And the most "stupid" variant. Every time you pass the XML you can add "rule" tags, for example:

[ November 25, 2008: Message edited by: Sergey Arnaut ]
I agree. Here's the link:
subject: Using XML for string message
jQuery in Action, 3rd edition