Re: Pattern.

John Cowan <[email protected]>
Newsgroups gmane.text.xml.relaxng.general
Message-ID <[email protected]>
[email protected] scripsit:

> I'm trying to find a pattern for the en-us attribute.

What you are trying to do is not possible.
You need to use a WXS pattern instead.

> <define name="LanguageCode">
>   <element name="languageCode">
>     <attribute name="lang">
>       <list>
> 	<ref name="PrimaryLang"/>
> 	<data type="string">
> 	  <param name="pattern">-</param>
> 	</data>
> 	<ref name="LangSubGroup"/>
>       </list>
>     </attribute>
>     <empty/>
>   </element>
> </define>

The list pattern can only cope with whitespace-separated items, not with
arbitrary concatenations.

In any case, the RFC 3066 language codes are an open set.  You should
either accept any arbitrary string of ASCII alphas, digits, and hyphen
(you can rule out initial, final, and consecutive hyphens if you like),
or else a fixed set of values that your application understands.

-- 
One art / There is                      John Cowan <[email protected]>
No less / No more                       http://www.reutershealth.com
All things / To do                      http://www.ccil.org/~cowan
With sparks / Galore                     -- Douglas Hofstadter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.