--- doc/homework/xml.html 2002/05/23 21:17:19 1.4 +++ doc/homework/xml.html 2002/06/06 07:14:18 1.5 @@ -23,7 +23,8 @@ $Apache::lonxml::debug - debugging control
  • - @Apache::lonxml::pwd - path to the directory containing the file currently being processed + @Apache::lonxml::pwd - path to the directory containing + the file currently being processed
  • @Apache::lonxml::outputstack
    @@ -41,12 +42,12 @@ (images, and links)
  • - #Apache::lonxml::metamode - some output is turned off, + $Apache::lonxml::metamode - some output is turned off, the meta target wants a specific subset, use <output> to guarentee that the catianed data will be in the parsing output
  • - #Apache::lonxml::evaluate - controls whether + $Apache::lonxml::evaluate - controls whether run::evaluate actually derefences variable references
  • @@ -66,15 +67,43 @@ $Apache::lonxml::request - current Apache request object, or undef
  • +
  • + $Apache::lonxml::curdepth - current depth of the + overall parse depth. Will be a string like: 2_3_1 (first tag + in the third second level tag in the second toplevel tag). It + gets set by callsub, and can be used in Perl tag + implementations. It relies upon the internal globals: + @Apache::lonxml::depthcounter, + $Apache::lonxml::depth, + $Apache::lonxml::olddepth +
  • +
  • + $Apache::lonxml::prevent_entity_encode - By default the + xmlparser will try to rencode any 8-bit characters into HTML + Entity Codes, If this is set to a true value it will be + prevented. - + +

    + In common usage, $Apache::lonxml::prevent_entity_encode, + $Apache::lonxml::evaluate, + $Apache::lonxml::metamode, + $Apache::lonxml::import, should never be set to a value + directly, but rather incremented when you want the effect on, + and decremented when you want the effect off. +

    +

    Notable Perl subroutines

    If not specified these functions are in Apache::lonxml

    Functions Tag Handlers can use

    @@ -137,14 +177,48 @@ Apache::scripttag::start_script for an example of usage.)

  • - get_param - 4 arguments, firsth is a scaler sting of + get_param - 4 arguments, first is a scaler sting of the argument needed, second is a reference to the parser arguments stack, third is a reference to the Safe space, and fourth is an optional "context" value. This subroutine allows a tag to get a tag argument, after being interpolated inside the Safe space. This should be used if the tag might use a safe space variable reference for the tag argument. (See - Apaceh::scripttag::start_script for an example.) + Apache::scripttag::start_script for an example.) + + This version only handles scalar variables. +
  • +
  • + get_param_var - 4 arguments, first is a scaler sting of + the argument needed, second is a reference to the parser + arguments stack, third is a reference to the Safe space, and + fourth is an optional "context" value. This subroutine allows + a tag to get a tag argument, after being interpolated inside + the Safe space. This should be used if the tag might use a + safe space variable reference for the tag argument. (See + Apache::scripttag::start_script for an example.) + + This version can handle list or hash variables properly. +
  • +
  • + description - 1 argument, the token object. This will + return the textual decription of the current tag from the + insertlist.tab file. +
  • +
  • + whichuser - 0 arguments. This will take a look at the + current environment setting and return the current $symb, + $courseid, $udom, $uname. You should always use this function + if you want to determine who the current user is. (Since a + instructor might be trying to view a students version of a + resource.) +
  • +
  • + inner_xmlparse - 6 arguments, the target, an array + pointer to the current stack of tags, and array pointer to the + current stack of tag arguments, an array pointer to the + current stack of LCParser's, a pointer to the current Safe + space, a pointer to the hash of current style definitions
  • newparser - 3 args, first is a reference to the parser @@ -165,7 +239,14 @@ sub BEGIN { } Would tell xmlparse that in Apache::scripttag it can find - handlers for <script> and <display> + handlers for <script> and <display>, if one + regsiters a tag that was already registered the previous one + is remembered and will be restored on a deregister. +
  • +
  • + deregister - used to remove a previously registered tag + implementation. It will restore the previous registration if + there was one.
  • startredirection - used when a tag wants to save a @@ -184,7 +265,7 @@ sub BEGIN { a reference to the Safe space, 3 a string to be evaluated before the first arg. This subroutine will do variable interpolation and simple function interpolations on the first - argument. (See Apache::lonxml::xmlparse for an example.) + argument. (See Apache::lonxml::inner_xmlparse for an example.)
  • Apache::run::run - 2 args, first a string, second a @@ -220,7 +301,7 @@ sub BEGIN {
    Guy Albertelli
    -Last modified: Thu May 23 17:19:29 EDT 2002 +Last modified: Thu Jun 6 01:16:44 EDT 2002