﻿<?xml version="1.0" encoding="utf-8"?>
<CodeSnippet Format="1.0.0" xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <Header>
    <Title>
      <!-- _locID_text="title" _locComment="" -->string restriction</Title>
    <Author>Microsoft Corporation</Author>
    <Shortcut>attrstring</Shortcut>
    <Description>
      <!-- _locID_text="description" _locComment="" -->XML snippet for defining XSD attribute wiht simpleType restriction of string</Description>
    <SnippetTypes>
      <SnippetType>SurroundsWith</SnippetType>
      <SnippetType>Expansion</SnippetType>
    </SnippetTypes>
  </Header>
  <Snippet>
    <Declarations>
      <Literal>
        <ID>name</ID>
        <ToolTip>
          <!-- _locID_text="tooltip1" _locComment="" -->Name of the attribute.</ToolTip>
        <Default>name</Default>
      </Literal>
      <Literal Editable="false">
        <ID>prefix</ID>
        <Function>LookupPrefix("http://www.w3.org/2001/XMLSchema")</Function>
      </Literal>
      <Literal>
        <ID>type</ID>
        <ToolTip>
          <!-- _locID_text="tooltip2" _locComment="" -->Type to restrict.</ToolTip>
        <Default>string</Default>
      </Literal>      
    </Declarations>
    <Code Language="XML"><![CDATA[<xsd:attribute name="$name$" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
     <xsd:simpleType>
      <xsd:restriction base="$prefix$$type$">$selected$$end$
      </xsd:restriction>
     </xsd:simpleType>
    </xsd:attribute>]]></Code>
  </Snippet>
</CodeSnippet>