URL Document Literals

The URL document literal is always of type Document.
URLDocumentLiteral:
URLDocumentDeclarator [ComplexLiteralInputChars]
URLDocumentDeclarator [Expression]
URLDocumentDeclarator [Expression, Expression]
URLDocumentDeclarator:
any case for URL

URL document literals are used to represent a document using a URL scheme.

The ComplexLiteralInputChars can include the [ character as long as it has a balanced number of ] characters: one for every [ character found:
  • If the sequence of characters can be parsed as an Expression of type String or java.net.URL, then the resulting document is a URL document where the expression specifies the URL from where to retrieve the document.

  • If the sequence of characters can be parsed as two Expressions where the first one must have type String or java.net.URL and the second one must have type Document, then the resulting document is a URL document where the first argument specifies the URL of the document and the second one represents a document that is sent to the destination specified by the URL. This, for example, can be used to upload documents to a web server.

  • If the sequence of characters cannot be parsed properly as described above, then it is considered to be the URL from where to retrieve the document.

Example URL Document Literals:
URL[http://localhost/index.html]
URL[ftp://12.12.12.12:8080/schedule.doc]
URL["http://www.cisco.com/index.html"]
URL[new java.net.URL("http", "www.cisco.com", "index.html")]
URL[myURI + "index.html", DOC[docs\fax.txt]]