refInfoGetRawDocLength

SYNOPSIS

int64 refInfoGetRawDocLength(refInfo ref)

Parameters:

  • ref - A refInfo object

Returns:

  • The int64 character length of the reference's element in the raw document (HTML)


DESCRIPTION
The refInfoGetRawDocLength function returns the int64 character (not byte) length of the reference's element in the raw document (here), which is the original static HTML that was downloaded (after any transfer/content encodings are decoded). The length will generally span from the start of the opening tag through the end of the closing tag (if any).


EXAMPLE

<urlinfo rawdoc><$html = $ret>
  <$offset = (refInfoGetRawDocOffset($ref))>
  <$length = (refInfoGetRawDocLength($ref))>
  <substr $html $offset $length>
  Reference's HTML: $ret


CAVEATS
Note that the returned length is in characters, not bytes. Thus when using <substr>, a $mode argument suitable for the raw document's character set may need to be provided; i.e. ISO-8859-1 if the document is ISO-8859-1 not UTF-8.

The length may be -1 (unavailable) in some instances, e.g. if the reference was generated by JavaScript.


SEE ALSO
refInfoGetProcessedDocLength


Copyright © Thunderstone Software     Last updated: Jul 17 2021
Copyright © 2021 Thunderstone Software LLC. All rights reserved.