URL pattern

M

Mhaxx

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
 
M

Martin Honnen

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
 
P

Peter Flynn

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

Staff online

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,805
Latest member
ClydeHeld1

Latest Threads

Top