Scott Bain

Ranch Hand
+ Follow
since Dec 21, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Scott Bain

...but if you DO want to try out UDDI without having to actually publish something to a public registry, you can get JEDDI, which is a UDDI testbed, for free from www.silverstream.com
-S-
23 years ago
I'd wager that lots of people will offer web services by directly emailing (or making available via their website), the WSDL files that describe the service, and never use UDDI or anything like it.
It would acually be one way to control the visibiliy of your service.
-S-
23 years ago
I'll let you know when it's up. In the mean time, you can get it here at the ranch:
Scott's Castor Article
Corey:
I wrote an article for Javaranch on Castor, which I think has the information you're asking for. I assume it's on the site here somewhere, or I could email you a copy if you like. They're also putting a .PDF version up at the Net Objectives site.
Whatever's the most convenient...
-S-
[ January 17, 2002: Message edited by: Scott Bain ]
Our webmaster at Net Objectives has kindly put together a FAQ page, based on the questions I've been asked here, along with my answers. If you'd like to take a look, visit the link below.
I'll be adding to it as we go.
Net Objectives Javaranch FAQ
[ January 17, 2002: Message edited by: Scott Bain ]
Another way to state the distinction:
HTML is a language. It has semantics and grammar, and a specific purpose (presentation)
XML is a meta-language. You can define other languages in it, by creating specific semantics and grammar (often expressed in a DTD or Schema). One such language is XHTML, another is XSLT, another is XML-Schema. All languages written in XML must conform to the rules of well-formedness (which traditional HTML does not).
-S-
Being a fan of open source, I have to say that Xerces is my clear choice.
However, there are others out there. MSXML (Microsoft) can provide a DOM tree, and IBM's XML4J is the supported version of Xerces. Oracle and Lotus also provide parsers.
Another way to go is to use JDOM (which is much friendlier to those comfortable with Java syntax), and then use one of the supplied to DOMAdapters to render the final result into standard DOM.
Or just forget parsing entirely and use Data Binding. I am doing this more and more these days.
HTH
Template based XSLT is usually used in a recursive way... along the lines of "whenever you find an element like this, do this with it", and then nested elements cause templates to be applied, etc...
The simpler form you're referring to is often called "fill in the blanks" XSLT, which is very much like a form letter used with a mail merge. You create lots of fixed (static) content, then insert xsl: elements for stuff that varies.
Here's an example of the latter, which writes a Java bean to represent state that's stored in an XML file:
Could we get a look at the actual XML file? Maybe something will jump out. It appears that you've got an invalid character in an attribute...
Are you using VB here?
-S-
PCDATA (or, actually #PCDATA) is the type of data an element contains when it's not "empty". It stands for "Parsed Character Data".
CDATA, on the other hand, is an attribute type. It stands for "Character Data" and the main difference between it and #PCDATA is that it may not contain carriage returns, nor entities (a la < for the less-than sign). The parser does not, in other words, expand entities that are in an attribute value.
It's a bit confusing, yes, and it's a left-over from SGML.
To get more specific type checking than this (to check that an attribute is an integer, or conforms to a regular expression, etc...), you need to constrain with XML-Schema instead of DTD.
HTH
Xerces is a package of classes that allows you to parse XML in your own application... so there's no executable per se, but rather a JAR file with various classes needed to perform parsing.
Here's an example of using Xerces as a DOM parser:


You would then call methods on myDocument to "walk the tree".
HTH
Sorry I've not made this terribly clear...
When you invoke the XMLRPC client, it generates the XML for you, sends it to the server, where it is decomposed back into the method call. You never have to create any XML, you never store it or manipulate it in any way. Unless someone told you, you would never ever know that XML was involved.
When the server returns the value from the method, here again the XML is invisible to you... you simply cast the return value back into the type you were expecting (yes, error checking is a bit thin here), and your method call is complete.
To more specifically answer your last question, the value returned in an object, not an XML file or stream. It's upcast to Object, so you have to cast it back to whatever you know it to be (String, in this case).
Make sense?
[ January 16, 2002: Message edited by: Scott Bain ]
Yes, thinking of elements as folders is not a bad way to look at it... it's a heirarchical structure, where things "contain" other things, and Xpath is designed to allow you to specify a thing or a set of things relative to a given position in the heirarchy. Just like folders in DOS, you have a "current" folder, and a way to refer to other folders (and the contents of folders) relative to the current one.
Namespaces are related, but different. A Namespace allows you to specify a family of element and attribute names, to make them unique from others that belong to other groups. You can establish a "default namespace" for an element and all its children, and so therefore a namespace can (and often does) parallel the heirarchy of nodes.
HTH

Originally posted by Corey McGlone:

Scott,
Thanks for the help. A couple more quick questions for you. We had a brief discussion earlier about the use of an XML-Schema rather than a DTD. I've never seen an XML-Schema before, but I'd like to include a description of it in this tutorial, if possible. Can you direct me to a source so that I can find some information and hopefully an example or two?
Also, You mentioned that XML files are generally named with the extenstion .xml and DTD files with the extenstion .dtd. I have followed these guidelines in the past but, just to be sure, is an XML file with an included DTD still named with the .xml extension. I had always assumed that it was.
Also, with XML-Schemas, is it possible to have both local and remote schemas (just like DTD's)? If it is possible to have a remote XML-Schema file, what extension is put onto that file?
Thanks again,
Corey


The XML-Schema primer at www.w3.org contains a purchase order example that I think is pretty good. Actually, the primer itself is really quite readable, which is not always the case with w3.org documents.
You can find it at
Schmea Primer
By "included DTD" do you mean a DOCTYPE reference to a DTD, or an actual embedded DTD? Either way, yes, an xml file will tend to use ".xml" as an extension, whether or not it refers to a constraint (dtd or xml-schema).
One can refer to a remote schema, yes. The xsi:schemaLocation attribute is used to point to a schema, either locally or at a remote URI.
Tangentially, xml-schema documents tend to use the extension "xsd" for "xml-schema definition". We often consider the schema document itself to be the "type" or "class" and the xml document being constrained as an "instance document".
Right. The general idea behand castor is one of "data-binding" -- that is, the automatic marshalling and unmarshalling of an XML structure into (and back out of) a set of objects.
You create objects (databeans), set their state, then marshall these into an XML structure (you can allow Castor to create this as it sees fit, or you can specify the nature of this structure with a mapping file, also in XML).
Subsequently, or alternatively, you un-marshall this XML structure into a series of objects with state.
You can start with the XML and have Castor make the objects, start with the objects and have Castor make the XML, or make both and create a mapping between them.