← Prev in month ← Prev in thread

A XSD regex to allow a QName in Clark form

From
<>
To
Date
2017-09-14T06:54:51Z
ID
<>
Thread
A XSD regex to allow a QName in Clark form
Hi !

I'm not a regex killer, especially when regex flavour is not the one I 
use on my linux box...

In a schema, I need a simple type that allows a QName, written either 
"prefix:localName" or in ClarkeForm "Q{nsUri}localName", or in 
the-last-one-I-cant-remember-the-name "{nsUri}localName"

I've started with the one available in XSD schema :

   <xs:simpleType name="QName">
     <xs:annotation>
       <xs:documentation> A QName. This schema does not use the built-in 
type xs:QName, but rather defines its own QName type. Although xs:QName 
would define the correct validation on these attributes, a schema 
processor would expand unprefixed QNames incorrectly when constructing 
the PSVI, because (as defined in XML Schema errata) an unprefixed 
xs:QName is assumed to be in the default namespace, which is not the 
correct assumption for XSLT. The data type is defined as a restriction 
of the built-in type Name, restricted so that it can only contain one 
colon which must not be the first or last character. TODO: change 
implementation to allow use ClarkeForm </xs:documentation>
     </xs:annotation>
     <xs:restriction base="xs:Name">
       <xs:pattern value="([^:]+:)?[^:]+"/>
     </xs:restriction>
   </xs:simpleType>

But my pattern for ClarkeForm isn't correct :
       <xs:pattern value="Q?\{[^\{]+\}[^:\{\}]+"/>

Any help will be appreciated.
Thanks in advance,
Christophe
← Prev in month ← Prev in thread