469,366 Members | 2,254 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,366 developers. It's quick & easy.

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 6917


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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by gsv2com | last post: by
reply views Thread by Andy Read | last post: by
1 post views Thread by Sea Sharper | last post: by
12 posts views Thread by FluffyCat | last post: by
1 post views Thread by ltruett | last post: by
34 posts views Thread by Steven Nagy | last post: by
11 posts views Thread by td0g03 | last post: by
19 posts views Thread by konrad Krupa | last post: by
1 post views Thread by CARIGAR | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.