Name

rng:nsName — Specifies a name pattern that matches any name in a specified namespace

XML syntax example

<grammar xmlns="http://relaxng.org/ns/structure/1.0">

<start>
 <ref name="any"/>
</start>

<define name="any">
 <element>
  <nsName ns="http://simonstl.com/ns/address"/>
  <zeroOrMore>
   <choice>
    <attribute>
     <nsName ns="http://simonstl.com/ns/address"/>
    </attribute>
    <text/>
    <ref name="any"/>
   </choice>
  </zeroOrMore>
 </element>
</define>

</grammar>

Compact syntax example

namespace ad = "http://simonstl.com/ns/address"

start = any
any = element ad:* { (attribute ad:* { text } | text | any)* }

Parents

attribute, choice, element, except

Description

The nsName element specifies a name pattern that matches any name in a given namespace.

See also

§11, anyName, except, name

Get XML Pocket Reference, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.