\hypertarget{nil}{}\subsection{xsi:nil}\label{nil}
XML differentiates between empty and null data. Such {\em nillable\/} elements can be described in the XML schema.



\begin{DocInclude}\begin{verbatim}<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.org/">
        <xs:element name="foobar" type="xs:String" nillable="true"/>
</xs:schema>
\end{verbatim}
\end{DocInclude}


An example of a nil element is shown in the example below. A null value is represented in RDF using rdf:nil, the empty list.



\begin{DocInclude}\begin{verbatim}<?xml version="1.0" encoding="UTF-8"?>
<foobar xmlns="http://example.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xsi:nil="true"/>

\end{verbatim}
\end{DocInclude}
 

\begin{DocInclude}\begin{verbatim}# Base: http://example.org/nil.xml
@prefix ns1:     <http://example.org/def/> .
@prefix xs:      <http://www.w3.org/2001/XMLSchema> .
@prefix ns2:     <http://example.org/> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xs_:     <http://www.w3.org/2001/XMLSchema#> .
@prefix :        <#> .

<>    ns2:foobar () .
\end{verbatim}
\end{DocInclude}


Compare this with the same element simply left empty.



\begin{DocInclude}\begin{verbatim}<?xml version="1.0" encoding="UTF-8"?>
<foobar xmlns="http://example.org/" />

\end{verbatim}
\end{DocInclude}
 

\begin{DocInclude}\begin{verbatim}# Base: http://example.org/nil1.xml
@prefix ns1:     <http://example.org/def/> .
@prefix xs:      <http://www.w3.org/2001/XMLSchema> .
@prefix ns2:     <http://example.org/> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xs_:     <http://www.w3.org/2001/XMLSchema#> .
@prefix :        <#> .

<>    ns2:foobar "" .
\end{verbatim}
\end{DocInclude}
 