[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: URI regex ?

  • From: Michael Kay <mike@saxonica.com>
  • To: Christophe Marchand <cmarchand@oxiane.com>
  • Date: Wed, 4 May 2016 11:17:12 +0100

Re:  URI regex ?
Michael Sperberg-McQueen has defined XSD types (and regexes) that match different flavours of URI in

http://www.w3.org/2011/04/XMLSchema/TypeLibrary-URI-RFC3986.xsd

and

http://www.w3.org/2011/04/XMLSchema/TypeLibrary-IRI-RFC3987.xsd

To see the way these complex regular expressions are constructed, view these documents at the raw XML level using (for example) curl.

Michael Kay
Saxonica


> On 4 May 2016, at 10:52, Christophe Marchand <cmarchand@oxiane.com> wrote:
> 
> Hi all !
> 
> I have to rewrite URI in many files :
> 
> * xsl
> * schemas
> * RNG/RNC grammars
> * schematrons
> * nvdl
> * DTD
> * etc...
> 
> 
> I exactly know the protocol(s) of the URI I have to rewrite, so I can detect all URIs by a starting string
> As I have to work on various file types, and as URI may be in known tags (xsl:import, sch:validate, ...) as in variables or anywhere else, I would like to process the files as text files.
> 
> I have 2 questions :
> 
> * files may use various encoding. Is there a pre-defined encoding
>   where URI are always correct ? Or should I check the file encoding
>   before reading it ?
> * Is there a regex I can use to detect the end of the URI, knowing the
>   start of the URI ? Reading RFC3987 is not so easy...
> 
> 
> Thanks in advance,
> Christophe
> 
> _______________________________________________________________________
> 
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
> 
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php



  • References:
    • URI regex ?
      • From: Christophe Marchand <cmarchand@oxiane.com>

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.