Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
XML DTD Validaiton with dom\Writer.java
How to perform XML DTD validation with dom\Writer.java provided in the Apache Xerces package?
✍: FYIcenter
You can perform XML DTD validation with the dom\Writer.java program
provided in the Apache Xerces package as shown below.
Run the dom\Writer.java program with "-v" option to turn on validation. If the input XML file does not meet the requirements of its DTD, you will see validation errors:
\fyicenter\xerces-2_11_0\samples>\fyicenter\jdk-1.8.0\bin\java
-cp .;..\xercesSamples.jar;..\xercesImpl.jar;..\xml-apis.jar
dom.Writer -v UserError.xml
[Error] UserError.xml:14:8: The content of element type
"User" must match "(ID+,BirthDate+,Name+,Sex+)".
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE User [
<!ELEMENT User (ID+,BirthDate+,Name+,Sex+)>
<!ELEMENT ID (#PCDATA)>
<!ELEMENT BirthDate (#PCDATA)>
<!ELEMENT Name (#PCDATA)>
<!ELEMENT Sex (#PCDATA)>
]>
<User>
<ID>101</ID>
<Name>Frank Y. Ivy</Name>
</User>
⇒ XML Schema Validaiton with dom\Writer.java
⇐ JAR Files Required to Run dom\Writer.java
2017-11-11, ∼3837🔥, 0💬
Popular Posts:
JUnit Source Code Files are provided in the source package file, junit-4.13.2-sources.jar .You can b...
Java Servlet 3.0 Specification API. JAR File Size and Download Location: File name: servlet-api.jar,...
JDK 17 java.management.jmod is the JMOD file for JDK 17 Management module. JDK 17 Management module ...
Jettison is a collection of Java APIs (like STaX and DOM) which read and write JSON. This allows nea...
xml-commons External Source Code Files are provided in the source package file, xml-commons-external...