XML technologies / XML Schema / XML Schema element reference / xs:appinfo

(Excerpt from “XML Schema” by Eric van der Vlist)

Information for applications.

<xs:appinfo
    source = xs:anyURI
    >
    Content: ({any})*
</xs:appinfo>

May occur within: xs:annotation

Description

xs:appinfo is a container for structured information usable by applications. Its open content model accepts any element from any namespace, with validation lax; elements supplied here from W3C XML Schema must be valid. xs:appinfo can hold any kind of information, such as metadata, processing instructions or even program fragments.

Its content resembles that of xs:documentation, reserved for human-readable information, except for attribute xml:lang, allowed on xs:documentation but forbidden on xs:appinfo.

Restrictions

Foreign attributes cannot be specified for xs:appinfo.

Attribute source is insufficiently specified in the recommendation, possibly causing interoperability problems between applications accessing xs:appinfo when they use relative or shared URIs. For example, an application may use the XSLT-namespace within attribute source to indicate XSLT code, while another uses the same URI to indicate parameters to pass to an XSLT transformation.

Example

<xs:element name="author" type="author">
    <xs:annotation>
        <xs:appinfo xmlns:dc="http://purl.org/dc/Elemente/1.1/">
            <dc:creator>Eric van der Vlist (mailto:vdv@dyomedea.com)</dc:creator>
            <dc:date>2002-02-01</dc:date>
            <dc:subject>Autor,Person,Buch</dc:subject>
            <dc:description>Dieses Element beschreibt den Autor eines Buches.</dc:description>
        </xs:appinfo>
    </xs:annotation>
</xs:element>

<xs:element name="author" type="author">
    <xs:annotation>
        <xs:appinfo source="saf:meta-data-item" xmlns:sql="http://www.extensibility.com/saf/spec/safsample/sql-map.saf">
            <sql:select>
                select
                <sql:elem>
                    name
                </sql:elem>
                ,
                <sql:elem>
                    birthdate
                </sql:elem>
                ,
                <sql:attr>
                    deathdate
                </sql:attr>
                from tbl_author
            </sql:select>
        </xs:appinfo>
    </xs:annotation>
</xs:element>
<xs:element name="book" type="book">
    <xs:annotation>
        <xs:appinfo xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
            <xsl:template match="book">
                <xsl:apply-templates select="title"/>
                <xsl:apply-templates select="isbn"/>
                <p>Autoren:</p>
                <ul>
                    <xsl:apply-templates select="author"/>
                </ul>
                <p>Figuren:</p>
                <ul>
                    <xsl:apply-templates select="character"/>
                </ul>
            </xsl:template>
        </xs:appinfo>
    </xs:annotation>
</xs:element>

Attributes

source
Can link to the information source when a program fragment is given; can also act as a semantic attribute identifying the information’s nature.

   

 

 

 

back to top