W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2002

RE: Help me please

From: Andy Del Rio <adelrio@decadesystems.com>
Date: Tue, 16 Apr 2002 10:01:02 -0400
To: <xmlschema-dev@w3.org>
Message-ID: <PJEGLHABDMFKMBPDFGKAOEADCBAA.adelrio@decadesystems.com>
Hi Sridhar,

Why not do away with pattern for the exception of (@start|@end) and change
the datatype to QName.


-----Original Message-----
From: xmlschema-dev-request@w3.org
[mailto:xmlschema-dev-request@w3.org]On Behalf Of Jeni Tennison
Sent: Tuesday, April 16, 2002 5:35 AM
To: Sridhar Raju Y
Cc: xmlschema-dev@w3.org
Subject: Re: Help me please


Hi Sridhar,

> I am unable to understand the pattern mentioned in xml schema file.
>
> <xsd:pattern value="[\i-[:]][\c-[:]]*:[\i-[:]][\c-[:]]*(@start|@end)"/>
>
> The above one is the pattern specified in schema file . I'ld like to
> know how it looks like in instance document.

The pattern [\i-[:]] means "any character that can be the initial
character of an XML name, except a colon" and the pattern [\c-[:]]
means "any character that can be a character within an XML name,
except a colon". Put them together as [\i-[:]][\c-[:]]* and you have
"any XML name, without a colon in it", in other words an xs:NCName
(non-colonised name) such as:

  foo
  _bar

The start of your pattern has a xs:NCName, followed by a colon,
followed by an xs:NCName. Together, that makes a qualified name
(xs:QName), so something like:

  foo:_bar

After this qualified name, you have a choice between two patterns. The
@ isn't significant in a regular expression, so the two strings are
literally "@start" or "@end".

So a matching string for the entire pattern might look like:

  foo:_bar@start

or:

  xs:string@end

or:

  xsl:value-of@start

or anything that's a qualified name immediately followed by either
'@start' or '@end'.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Tuesday, 16 April 2002 10:01:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:30 GMT