swirl
Guide to OmniMark 9   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
    Other Library Functions  
function  

uri.collapse

 
 

Library: URI handling (OMURI)
Import: omuri.xmd
Return type: String

Returns: the resolved combination of all URIs


Declaration

export string function
   collapse read-only string URIs
  

Argument definitions

URIs
is a shelf containing URI strings to combine


Purpose

The function uri.collapse combines all given URIs into a single one. It is similar to uri.extend, but takes an arbitrary number of URIs and does not throw any exceptions. This function ignores all URIs shelf items that precede an absolute URI. If the last item in the shelf consists only of a URI fragment, it will be returned as the result.

In the following example, the function resolve-current-uri uses uri.collapse to combine all xml:base attributes specified in current elements into the current URI.

  import "omuri.xmd" prefixed by uri.
    
  define string function
     resolve-current-uri
  as
     local string URIs variable
  
     repeat over current elements as e
        set new URIs to attributes of current element e {"xml:base"}
           when attributes of current element e has key "xml:base"
     again
  
     return uri.collapse uris

      Other Library Functions
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 9.1.0 Documentation Generated: September 2, 2010 at 1:38:10 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2010.