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:
Display XML Element Type Info with jaxp\TypeInfoWriter.java
How to display XML element type information with the jaxp\TypeInfoWriter.java provided in the Apache Xerces package?
✍: FYIcenter
If you have XML file with an XML schema that specifies types for each XML elements,
you can use the jaxp\TypeInfoWriter.java provided in the Apache Xerces package
to display element type information.
Compile and run jaxp\TypeInfoWriter.java, if you have Apache Xerces 2.11.0 installed:
\fyicenter\xerces-2_11_0\samples>\fyicenter\jdk-1.8.0\bin\javac jaxp\TypeInfoWriter.java
Note: jaxp\TypeInfoWriter.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: jaxp\TypeInfoWriter.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
\fyicenter\xerces-2_11_0\samples>\fyicenter\jdk-1.8.0\bin\java
-cp .;..\xercesImpl.jar jaxp.TypeInfoWriter -a User.xsd -i UserXSD.xml
setDocumentLocator(systemId="file:///C:/fyicenter/xerces-2_11_0/samples/UserXSD.xml", publicId=null)
startDocument()
startElement(name="{http://fyicenter.com}User",type="{http://fyicenter.com}#AnonType_User",
attributes={{name="{http://www.w3.org/2001/XMLSchema-instance}schemaLocation",
type="{http://www.w3.org/2001/XMLSchema-instance}#AnonType_schemaLocation",
id="false",specified="true"}})
startElement(name="{http://fyicenter.com}ID",type="{http://www.w3.org/2001/XMLSchema}integer",attributes={})
endElement(name="{http://fyicenter.com}ID")
startElement(name="{http://fyicenter.com}Name",type="{http://www.w3.org/2001/XMLSchema}string",attributes={})
endElement(name="{http://fyicenter.com}Name")
startElement(name="{http://fyicenter.com}BirthDate",type="{http://www.w3.org/2001/XMLSchema}dateTime",attributes={})
endElement(name="{http://fyicenter.com}BirthDate")
startElement(name="{http://fyicenter.com}Sex",type="{http://fyicenter.com}sexType",attributes={})
endElement(name="{http://fyicenter.com}Sex")
endElement(name="{http://fyicenter.com}User")
endDocument()
⇒ jaxp\DatatypeAPIUsage.java - Apache Xerves JAXP Sample
⇐ jaxp\TypeInfoWriter.java - Apache Xerves JAXP Sample
2017-09-28, ≈24🔥, 0💬
Popular Posts:
Joda-Time provides a quality replacement for the Java date and time classes. The design allows for m...
JDK 17 java.rmi.jmod is the JMOD file for JDK 17 RMI (Remote Method Invocation) module. JDK 17 RMI m...
Saxon-HE (home edition) is an open source product available under the Mozilla Public License. It pro...
JDK 11 java.smartcardio.jmod is the JMOD file for JDK 11 Smartcardio module. JDK 11 Smart Card IO mo...
JDK 11 java.smartcardio.jmod is the JMOD file for JDK 11 Smartcardio module. JDK 11 Smart Card IO mo...