Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old September 4th, 2008, 04:15 PM
zmunkz
Guest
 
Posts: n/a
Default restrict tag names to a pattern?

Does anyone know if an XSD can define tags that match a pattern? I
know I can setup restrictions on the values of a tag, but I want to
control the tag names themselves. For example, I would like this to
validate against my XSD (the child tags are required to start with
"var-" but can end in anything):

<some-parent>
<var-FOO>value</var-FOO>
<var-BAR>value</var-BAR>
</some-parent>

So this one would be no good:

<some-parent>
<FOO>value</FOO>
<va-BAR>value</va-BAR>
</some-parent>

There must be a way to do this, I just can't find it anywhere...
Thanks in advance for the help!
  #2  
Old September 4th, 2008, 04:55 PM
Martin Honnen
Guest
 
Posts: n/a
Default Re: restrict tag names to a pattern?

zmunkz wrote:
Quote:
Does anyone know if an XSD can define tags that match a pattern? I
know I can setup restrictions on the values of a tag, but I want to
control the tag names themselves. For example, I would like this to
validate against my XSD (the child tags are required to start with
"var-" but can end in anything):
>
<some-parent>
<var-FOO>value</var-FOO>
<var-BAR>value</var-BAR>
</some-parent>
>
So this one would be no good:
>
<some-parent>
<FOO>value</FOO>
<va-BAR>value</va-BAR>
</some-parent>
>
There must be a way to do this, I just can't find it anywhere...

No, that is not possible with the W3C XML schema language.


--

Martin Honnen
http://JavaScript.FAQTs.com/
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles