URL pattern

Mhaxx

Usenet Archive
Joined
Jul 19, 2004
Messages
12
Reaction score
0
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
 

Martin Honnen

Usenet Archive
Joined
Apr 8, 2000
Messages
6,174
Reaction score
0
Mhaxx said:
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
 

Mhaxx

Usenet Archive
Joined
Jul 19, 2004
Messages
12
Reaction score
0
Excuse me, where can I find a complete list of W3C data types like URI, .. ?

Mhaxx
 

booddu

Usenet Archive
Joined
Sep 13, 2004
Messages
1
Reaction score
0
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.*)

Thanks,
Pravin

Martin Honnen wrote:
*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
 

Peter Flynn

Usenet Archive
Joined
Jan 2, 2000
Messages
1,813
Reaction score
0
booddu said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top