RE: Help me please

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 UTC