472,378 Members | 1,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

URL pattern

I need something like this:

<xsd:simpleType name="url">
<xsd:restriction base="xsd:string">
<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 7021


Mhaxx wrote:
I need something like this:

<xsd:simpleType name="url">
<xsd:restriction base="xsd:string">
<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:anyURI"
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:anyURI"
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(contains($URL,'forum4designers'))">

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
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...
0
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
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....
1
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...
12
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...
1
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...
34
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...
11
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) ...
1
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...
19
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...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.
0
by: F22F35 | last post by:
I am a newbie to Access (most programming for that matter). I need help in creating an Access database that keeps the history of each user in a database. For example, a user might have lesson 1 sent...

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.