ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> exslt
exslt
Re: [exslt] URL check
by Jeni Tennison other posts by this author
Aug 8 2001 8:36AM messages near this date
Re: [exslt] URL check | Re: [exslt] URL check
Bruce Gray wrote:
>  Therefore it would seem either two functions are required (one
>  accepting only well formed resources, the other accepting any
>  existing resource) or one function that provides some mechanism for
>  handling these different scenarios.

It sounds to me like three separate functions:

  document() - accesses a well-formed XML document; returns an empty
               node set if the document is unavailable or not a
               well-formed XML document

  file() - accesses a text document; returns a string with the content
           of the text document (not interpreted as XML), or an empty
           string if the file is unavailable

  file-exists() - returns true if a file exists, false if it does not;
                  the file may be of any type, which allows you to
                  check for the existence of images etc.

I/O always leads to the possibility of side-effects, so these should
be carefully worded to indicate that calling the three functions on
the same document will result in only one access of the document; if a
file exists it *must* be accessible through file(), and if you access
an XML document with document() then the string that you get from
file() must be a logical representation of the node tree retrieved
through the document() function.

There would be encoding issues with the file() function, I think? We
would need to have a third argument to indicate the expected content
encoding of the file (which could be overridden through by an encoding
indicated by HTTP headers).

The file-exists() function would meet Oliver's original requirements,
but there is the possibility of going further with a whole host of
HTTP-related functions that we should probably steer clear of for now?

As far as a module for all this goes, we've had several suggestions:

  HTML (html)
  Network (net)
  System (sys)

Could also be Files (file). Possibly document() could go in the Common
module. Any ideas/preferences?

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

_______________________________________________
exslt mailing list
list@[...].org
http://www.exslt.org/list
Thread:
Bruce Gray
Jeni Tennison
Norman Walsh
Michael Kay
Jeni Tennison
Michael Kay

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved