\hypertarget{elementIDREFS}{}\subsection{Example xs:IDREFS}\label{elementIDREFS}
In this example we define an element 'foo' whose content type is an xs:ID so the foo element itself is implicated in the naming. The 'bar' element is of type xs:IDREFS; a list of IDREFs. The IDREF type is not used directly as a datatype (because this has document scope), but becomes a global resource URI.



\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="list">
                <xs:complexType>
                        <xs:sequence>
                                <xs:element name="foo" type="xs:ID" />
                                <xs:element name="bar" type="xs:IDREFS" />
                        </xs:sequence>
                </xs:complexType>
        </xs:element>

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


The 'bar' element refers twice to the same ID. 

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


In N3 the content of an RDF list is contained in brackets. 

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