473,909 Members | 4,177 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

URL pattern

I need something like this:

<xsd:simpleTy pe name="url">
<xsd:restrictio n base="xsd:strin g">
<xsd:pattern value="http://(.)*"/>
</xsd:restriction >
</xsd:simpleType>

where (.)* is the right patter for an URL.

I can't find anything on web.. is there an URL type definition for XML
just done somewhere?

Mhaxx
Jul 20 '05 #1
8 7100


Mhaxx wrote:
I need something like this:

<xsd:simpleTy pe name="url">
<xsd:restrictio n base="xsd:strin g">
<xsd:pattern value="http://(.)*"/>
</xsd:restriction >
</xsd:simpleType>

where (.)* is the right patter for an URL.

I can't find anything on web.. is there an URL type definition for XML
just done somewhere?


What about xsd:anyURI, is that not restrictive enough?
http://www.w3.org/TR/xmlschema-2/#anyURI

--

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

Jul 20 '05 #2
> What about xsd:anyURI, is that not restrictive enough?
http://www.w3.org/TR/xmlschema-2/#anyURI


But how can I use it direclty in my XSD?

Mhaxx
Jul 20 '05 #3


Mhaxx wrote:
What about xsd:anyURI, is that not restrictive enough?
http://www.w3.org/TR/xmlschema-2/#anyURI

But how can I use it direclty in my XSD?


It is a defined type so you can do
<xsd:element type="xsd:anyUR I"
for instance.

--

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

Jul 20 '05 #4
It's perfect!!

Thank you very much.

Mhaxx
Jul 20 '05 #5
> It is a defined type so you can do
<xsd:element type="xsd:anyUR I"
for instance.


I've just tried to use an URL istance like "http://,,,^^^^^...." or
"pppp" and it seems to be ok (validated): why?? :-O

Mhaxx
Jul 20 '05 #6
Excuse me, where can I find a complete list of W3C data types like URI, .. ?

Mhaxx
Jul 20 '05 #7


Mhaxx wrote:
Excuse me, where can I find a complete list of W3C data types like URI,


http://www.w3.org/TR/xmlschema-2/#built-in-datatypes

--

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

Jul 20 '05 #8
booddu wrote:

Hi all,

I actually wanted to restrict some words from a valid URL.
I need something like
NOT ( some pattern )

which will restrict any URL which contains forum4designers any where.

like
^(http://.*forum4designers.*)
or
!(http://.*forum4designers.*)


In what language do you want to do this?

If it's XSLT then you want something like

<xsl:if test="not(conta ins($URL,'forum 4designers'))">

If you want more pattern-matching, you'll have to wait for XSLT2,
which has REs.

///Peter
--
"The cat in the box is both a wave and a particle"
-- Terry Pratchett, introducing quantum physics in _The Authentic Cat_
Jul 20 '05 #9

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

Similar topics

8
6988
by: gsv2com | last post by:
One of my weaknesses has always been pattern matching. Something I definitely need to study up on and maybe you guys can give me a pointer here. I'm looking to remove all of this code and just use pattern matching to determine if the proper amount of numeric characters has been met. Here is the function I've already done. Any help you can give in a pattern matching solution would be much appreciated and very educational.
0
7056
by: Andy Read | last post by:
Hello all, I have the requirement to produce source code that produces an object hierarchy. Example: Root | Folder 1
11
4333
by: FluffyCat | last post by:
In Febraury - April of 2002 I put together in Java examples of all 23 of the classic "Gang Of Four" design patterns for my website. Partly I wanted to get a better understanding of those patterns. They are still online at http://www.fluffycat.com/java/patterns.html Since September 2003 I've mainly been using PHP, and now that PHP 5 is becoming more available I am going to try the same thing I did in Java with PHP.
1
7033
by: Sea Sharper | last post by:
Hi, C#, from a FileSystemWatcher I would like to catch all files with a *.* filter but then inside the event handler compare against a list of wildcards (eg '*.abc;*.def') Is there anywhere inside the Framework where I can do something like Pattern x = new Pattern("*.abc"); if ( x.Matches(strFilename) )
12
3054
by: FluffyCat | last post by:
New on November 28, 2005 for www.FluffyCat.com PHP 5 Design Pattern Examples - the Visitor Pattern. In the Visitor pattern, one class calls a function in another class and passes an instance of itself. The called class has special functions for each class that can call it. With the visitor pattern, the calling class can have new operations added without being changed itself.
1
2520
by: ltruett | last post by:
Last week I continued my series of design patterns examples using PHP 5 with the Bridge Pattern, Flyweight Pattern, and Proxy Pattern. Here now is my 20th PHP 5 design pattern example, the Interpreter Pattern. http://www.fluffycat.com/PHP-Design-Patterns/Interpreter/ In the Interpreter Design Pattern you define a language syntax, and parse requests that use that syntax, and call the correct classes and methods to handle the request.
34
11231
by: Steven Nagy | last post by:
So I was needing some extra power from my enums and implemented the typesafe enum pattern. And it got me to thinking... why should I EVER use standard enums? There's now a nice little code snippet that I wrote today that gives me an instant implementation of the pattern. I could easily just always use such an implementation instead of a standard enum, so I wanted to know what you experts all thought. Is there a case for standard enums?
11
2649
by: td0g03 | last post by:
Hello, I just have a few questions. The first one be how would you print a pattern. I could use the if else, but I remember my teacher talking about something like for(i=1;i<=size;i) printf($); Code below will take the size of what I input and change the size of the pattern by adding more or less $
1
4166
by: halekio | last post by:
Hi all, Please bear with me as I've only started programming in C# 2 weeks ago and this is my first contact with OOP. I ran into a situation where I needed to catch an event in an object that had no connection or reference to the object that triggered it. It goes something like this: (not syntactically correct..it's just for the idea)
19
3184
by: konrad Krupa | last post by:
I'm not expert in Pattern Matching and it would take me a while to come up with the syntax for what I'm trying to do. I hope there are some experts that can help me. I'm trying to match /d/d/d/s/d/d in any text. There could be spaces in front or after the pattern (the nnn nn could be without spaces also) but it shouldn't pick it up in case like this 1234 56768
0
10035
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9877
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10919
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10538
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8097
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5938
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4774
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3357
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.