28 Juli 2014

Include XML Schema Reference in XML to get IDE Code Completion

One thing that I find very often is the missing XML schema reference in XML files.
The advantage of including the reference is code completion in your IDE because with the xml schema the IDE knows about the structure of the XML document.

<?xml version="1.0" encoding="UTF-8"?>
    xsi:schemaLocation='http://xmlns.jcp.org/xml/ns/javaee http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/javaee/jobXML_1_0.xsd'>

    <batch:step id="step1">
            <batch:reader ref="Reader" />
            <batch:processor ref="Processor" />
            <batch:writer ref="Writer" />

An even worse pratice is using XML without a schema. But more about that in another post...

Keine Kommentare: