\hypertarget{elementID}{}\subsection{Element Identity}\label{elementID}
This example includes an element 'foobar' with xs:ID content. This identifies the immediately containing element , 'foobar' itself.



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

\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/" elementFormDefault="qualified">
        
        <xs:element name="identity">
                <xs:complexType>
                        <xs:sequence>
                                <xs:element name="foo" type="xs:ID" />
                                <xs:element name="bar" type="xs:IDREF" />
                        </xs:sequence>
                </xs:complexType>
        </xs:element>

</xs:schema>
\end{verbatim}
\end{DocInclude}
 

\begin{DocInclude}\begin{verbatim}# Base: http://example.org/elementIdentity1.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:identity
              [ ns2:bar :foobar ;
                ns2:foo :foobar
              ] .
\end{verbatim}
\end{DocInclude}
 