Tarin Gamberini

A software engineer and a passionate java programmer

Spring in Action Book Review

This summer I red “Spring in Action” by Craig Walls.

The book is well written, easy to read, with lots of code fragments which clarify textual descriptions, and with references to Design Pattern and JSR too.

How to validate DocBook 5.0 in Netbeans 7.0.1

This is the DocBook file I’d like to validate:

sample_article.xml
1
2
3
4
5
6
7
8
9
10
<?xml version='1.0' encoding='UTF-8'?>
<article version="5.0" xml:lang="en"
  xmlns="http://docbook.org/ns/docbook"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xlink="http://www.w3.org/1999/xlink"
  xsi:schemaLocation="
    http://docbook.org/ns/docbook http://docbook.org/xml/5.0/xsd/docbook.xsd">
    <title>Sample article</title>
    <para>This is a very short article.</para>
</article>

I’ve tried validating sample_article.xml In NetBeans:

unfortunately NetBeans logs:

1
2
3
4
5
6
7
8
9
10
11
XML validation started.
Checking file:/C:/sample_article.xml...
Referenced entity at "http://docbook.org/xml/5.0/xsd/docbook.xsd".
Referenced entity at "http://docbook.org/xml/5.0/xsd/xlink.xsd".
Referenced entity at "nbres:/org/netbeans/modules/j2ee/ddloaders/catalog/resources/XMLSchema.dtd".
Referenced entity at "nbres:/org/netbeans/modules/j2ee/ddloaders/catalog/resources/datatypes.dtd".
src-resolve: Cannot resolve the name 'xml:id' to a(n) 'attribute declaration' component. [6] http://docbook.org/xml/5.0/xsd/docbook.xsd
s4s-elt-must-match.1: The content of 'db.common.attributes' must match (annotation?, ((attribute | attributeGroup)*, anyAttribute?)). A problem was found starting at: attribute. [6] http://docbook.org/xml/5.0/xsd/docbook.xsd
cvc-complex-type.3.2.2: Attribute 'version' is not allowed to appear in element 'article'. [6]
cvc-complex-type.3.2.2: Attribute 'xml:lang' is not allowed to appear in element 'article'. [6]
XML validation finished.

complaining it Cannot resolve the name 'xml:id' as defined in the http://docbook.org/xml/5.0/xsd/docbook.xsd.

But wait a moment! Where does NetBeans get such http://docbook.org/xml/5.0/xsd/docbook.xsd?