473,322 Members | 1,703 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,322 software developers and data experts.

XSD: ways of restricting xml to non-empty tags?

Hi,

I'd like to know if there are any more ways of restricting an XML
document to having only non-empty tags (containing Strings).

I can think of 2 ways:

1)

<xs:simpleType name="tagName">
<xs:restriction base="xs:string">
<xs:pattern value="([a-zA-Z0-9])+"/>
</xs:restriction>
</xs:simpleType>

2)

<xs:simpleType name="tagName">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>

But approach #2 would allow the user to get away with spaces between
the tags.

Are there any other ways of doing this?

Thanks
Rohit.

Dec 21 '05 #1
1 2141
Piper707 writes:
<xs:simpleType name="tagName">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>

But [this] approach would allow the user to get away with spaces between
the tags.


use base="xs:token" instead, which implies aggressive whiteSpace
normalization.

ht
--
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
Half-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Dec 21 '05 #2

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

Similar topics

3
by: Shock | last post by:
Hey all, I am currently researching ways to compare databases via an XSD schema. I wrote a small app that creates a dataset from a database and exports that dataset to XSD. This gives me an XSD...
3
by: Matthet | last post by:
Hi, Is there any difference if I write sth like this: <xsd:simpleType name="Name"> <xsd:restriction base="xsd:string"> <xsd:minLength value="1"> <xsd:maxLength value="10">...
1
by: Roland | last post by:
hi all having designed my schema to use repeating groups of elements, I found that some applications (eg. Microsoft InfoPath) refused to recognised that element as a repeating element. I...
1
by: Brett Gerhardi | last post by:
Can anyone explain how I can do the following correctly: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"...
2
by: Martijn | last post by:
Because XSD (XML Schema Document) is a definition of the XML document, there must be a parser that can read a XSD file and give the complete XML file as a result. Is there something like this,...
2
by: yaya9 | last post by:
pls help me! I have a nested xml: <?xml version="1.0" encoding="utf-8" ?> <root> <myType> <FName /> <pop /> </myType> </root>
3
by: Pascal Brunot | last post by:
Hi, That's my first post here so I hope this is the right group to post to. I have to design a good strategy to manipulate XML data in VB.net language. Here's the business case: - I will...
1
by: Clodo | last post by:
I need to create a PHP page that use an XSL file for transforming a generic XSD in their XHTML with inputbox,select etc.., for allow users to insert data in a user-friendly html-based editor, and...
6
by: burkley | last post by:
In XML Schema, is it possible to derive a complex type via restriction and have the new derived type be in a different namespace than the original base type? I've banged on this for 2 days now...
0
by: liuhengyi | last post by:
Hi, I also have a question when using VS 2008 to edit the xml file. In my xml file, I used schemaLocation attribute to specify the xsd. If I put the xsd in our internal sharepoint site such as:...
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...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.