473,320 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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!
Sep 4 '08 #1
1 1191
zmunkz wrote:
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/
Sep 4 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Wiebke Pätzold | last post by:
Hi all! I create a database that contains a table. 'Nachname' is one of 13 column names. This program can search for a special letter. In my example it is 'ra'. and the search takes place in...
1
by: Don Adams | last post by:
I would like to have the following XML: <phone type="work">555-123-1234</phone> <phone type="home">555-123-4321</phone> Is it possible to write a schema to restrict the contents of the type...
1
by: Maksim | last post by:
Trying to find out a way how to restrict value of the element by name of an element, it might be not even possible, but anyhow. Let's consider following snippet: <xs:element name="tag1"...
28
by: gc | last post by:
Hi, What is the purpose of the restrict keyword? gc
6
by: Larry Woods | last post by:
I am trying to name my submenus (MainMenu control) and they show up in the menu dropdown...like they are O.K., but when I check my controls the names are still "MenuItemX". OTOH, the top-level...
3
by: Agnes | last post by:
In textbox, I know I can set e.handled = false in keypressevent , So I can restrict the user to input some invalid character or disallow the user to input any thing Now, in datagrid, there are 3...
2
by: Prabhudhas Peter | last post by:
If I click a menu to open a form which already open...the vb.net opens a new window while existing open window is there...i want to restric the opening of a new instance of an already opened...
3
by: Anil Mamede | last post by:
Hi, I'm having an hard time to build a regular expression that: - Will accept words; - Will accept spaces; - But cannot accept digits; Examples: This is a game
10
by: Brent | last post by:
I have a list of company names (say, IBM, Corning, General Motors, and another 5,000 of them). If I take a body of text, a news article, for instance, and I want to see which company names...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.