Home > XML IDE - XML Editor > XML Editor Key Features > DTD Tools > Java DTD Validation
Using DTDs in JavaOne method of constraining and validating the content of XML files is the Document Type Definition. Although part of the XML specification, DTDs (and XML files that reference them) aren't quite as straight-forward to parse as the standalone </>-type syntax we've come to know and love. But when one does need to parse them, there are tools in various languages, including Java. Parsing DTDs with Stylus Studio®Within Stylus Studio®, parsing DTDs with Java takes place when you use the Xerces-J validator in the XML editor. You can also add, as a Custom Validation Engine, the Sun Multi Schema Validator which will parse DTDs as part of its validation steps. It can also be invoked implicitly as part of the XML parsing process when running the various Java-based XSLT engines, such as Saxon and Xalan-J. Parsing DTDs in your own Java CodeThe two main methods of parsing DTDs are DOM (Document Object Model) and SAX (Simple API for XML). The difference is that the DOM builds the entire representation of the document in memory before parsing begins. But with SAX, as each item is seen as the document is parsed, an event is 'fired' into your program, and it is up to you to keep track of what you care about. The DOM interface in Java is well documented and managed by the World-Wide Web Consortium (W3C). The SAX interface is modular, and in SAX 2 includes several classes specifically designed for tracking SAX events. These include the following interfaces and methods, according to the SAX Project API documents. (This is not an exhaustive list, but an overview of some of the more useful and DTD-specific methods.)
Edit and Debug Java SourceNow, to write the code, you need an editor. Stylus Studio® includes a built-in Java Editor and Debugger and powerful Java code generation facilities. Take it out for a free test drive, and parse those DTDs!.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Try Stylus DTD GeneratorGenerate DTDs with our award-winning DTD conversion and DTD generation utilities - Download a free trial! Attend a Live Webinar This Week!Learn about Stylus Studio's unique features and benefits in just under an hour. Register for the Stylus Studio QuickStart Training WebCast! Why Pay More for XML Tools?With Stylus Studio® X16 XML Enterprise Suite, you get the most comprehensive XML tool suite at one incredibly low price. Value: it's just one of many reasons why smart XML developers are choosing Stylus Studio! |