tags:

views:

153

answers:

2

hello how do i,restrict special characters in my XSD validation , i am able to handle , some characters with this pattern "([a-zA-Z0-9_.' !@#$%^*()_+={}|/:;,>?/`~ ])+"

but not able to handle below :

" & ' < \ ® ™

any ideas ?

also not able to handle them with [^] pattern

A: 

I think you need to use character entities. &amp; for the ampersand, for example, and &lt; for the less. XML Schema is XML, and you have to live with XML rules. Expanding your question to actually show us the schema context would help.

bmargulies
ok , thnx ,i am able to handle them still no luck to allow characters ® ™
Himanshu
A: 

You want define a type that extends string and add a restriction with a pattern Something like

<xs:element name="your_element">
  <xs:simpleType>
    <xs:restriction base="xs:string">
      <xs:pattern value="[a-zA-Z0-9_.' !@#$%^*()_+={}|/:;,>?/`~ ]"/>
    </xs:restriction>
  </xs:simpleType>
</xs:element>
Trey