swirl
Guide to OmniMark 8   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
  Related Syntax   Related Concepts  
control structure  

using output as

 
 

Syntax

using output as destination modifiers? (& destination modifiers?)*
 block

Argument definitions

destination
An output destination such as an open stream or an expression that returns a output destination (the file or referent keywords or an external string sink function)
modifiers
Modifiers that affect how data is written to the destination


Purpose

You can use using output as as a prefix to change the current output scope for the duration of a line or a block of code:

  process
     using output as file "out.txt"
        submit file "in.txt"

You can direct output to a file, as above, or to a stream, a referent, or an external string sink function as in the next three examples:

  process
     local stream foo
     open foo as buffer
     using output as foo
        submit file "in.txt"

  process
     using output as referent "foo"
        submit file "in.txt"

  process
     local xslt.stylesheet stylesheet initial { xslt.compile file "stylesheet1.xsl" }
  
     using output as xslt.writer with stylesheet into file "input1.out"
      submit file "input1.xml"

If you use using output as to direct output to a stream, that stream must be open:

  process
     local stream out-file
     open out-file as file "out.txt"
     using output as out-file
        submit file "in.txt"

If you use using output as with a steam, you can apply the following modifiers:

  1. a string expression containing element content modifiers
  2. the binary open modifier

    Related Syntax
   & (and)
   binary
   put
   set
 
Related Concepts
   Output
   String sink data type
 
 

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

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:33:48 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.