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

Re: Help me please

From: Jeni Tennison <jeni@jenitennison.com>
Date: Tue, 16 Apr 2002 10:35:20 +0100
Message-ID: <451216896825.20020416103520@jenitennison.com>
To: "Sridhar Raju Y" <sridhar_y@infy.com>
CC: xmlschema-dev@w3.org
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 05:35:22 GMT

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