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:
Read XML with Schema from Socket with socket\DelayedInput.java
How to read XML document with XML Schema validation from socket connections with the socket\DelayedInput.java provided in the Apache Xerces package?
✍: FYIcenter
If you want to see how XML parser handles XML document with Schema validation from socket connections,
you can try the socket\DelayedInput.java provided in the Apache Xerces package
to display element type information.
Run socket\DelayedInput.java with "-v -s" option, if you have Apache Xerces 2.11.0 installed:
\fyicenter\xerces-2_11_0\samples>\fyicenter\jdk-1.8.0\bin\java -cp .;..\xercesImpl.jar socket.DelayedInput -v -s UserXsdError.xml # filename: UserXsdError.xml read 48 bytes in 458 ms: [\n<!-- Copyright (c) 2017 FYIcenter.com -->\n<fyi:] read 48 bytes in 1553 ms: [User xmlns:xsi="http://www.w3.org/2001/XMLSchema] read 48 bytes in 1486 ms: [-instance"\n xmlns:fyi="http://fyicenter.com"\n ] read 48 bytes in 151 ms: [xsi:schemaLocation="http://fyicenter.com User.xs] read 48 bytes in 478 ms: [d">\n <fyi:ID>ONE</fyi:ID>\n <fyi:Name>Frank] (fyi:User Axsi:schemaLocation http://fyicenter.com User.xsd (fyi:ID [Error] UserXsdError.xml:6:25: cvc-datatype-valid.1.2.1: 'ONE' is not a valid va lue for 'integer'. [Error] UserXsdError.xml:6:25: cvc-type.3.1.3: The value 'ONE' of element 'fyi:I D' is not valid. )fyi:ID (fyi:Name read 48 bytes in 804 ms: [ Y. Ivy</fyi:Name>\n <fyi:BirthDate>1970-01-01] )fyi:Name (fyi:BirthDate read 48 bytes in 1246 ms: [+00:01</fyi:BirthDate>\n <fyi:Sex> Male</fyi:] [Error] UserXsdError.xml:8:52: cvc-datatype-valid.1.2.1: '1970-01-01+00:01' is n ot a valid value for 'dateTime'. [Error] UserXsdError.xml:8:52: cvc-type.3.1.3: The value '1970-01-01+00:01' of e lement 'fyi:BirthDate' is not valid. )fyi:BirthDate (fyi:Sex read 17 bytes in 1381 ms: [Sex>\n</fyi:User>\n] )fyi:Sex )fyi:User read -1 bytes in 1640 ms: no data read
Note that the XML schema is provided at a separated location: User.xsd.
⇒ socket\KeepSocketOpen.java - Apache Xerves Socket Sample
⇐ Read XML/DTD from Socket with socket\DelayedInput.java
2017-09-20, ≈58🔥, 0💬
Popular Posts:
JDK 11 jdk.scripting.nashorn.jm odis the JMOD file for JDK 11 Scripting Nashorn module. JDK 11 Scrip...
What Is commons-logging-1.2.jar? commons-logging-1.2.jar is the JAR file for Apache Commons Logging ...
What Is commons-io-2.11.jar? commons-io-2.11.jar is the JAR file for Commons IO 2.5, which is a libr...
JRE 8 deploy.jar is the JAR file for JRE 8 Java Control Panel and other deploy tools. JRE (Java Runt...
This package is the backport of java.util.concurrent API, introduced in Java 5.0 and further refined...