[erlang-questions] What is "Rest" in the return of xmerl_scan:string() ?

Arif Ishaq arif.ishaq@REDACTED
Wed Apr 26 12:18:19 CEST 2017


In Telecom networks we often have ASN.1 documents that are bundled into files, one after the other, even though this is not correct ASN.1. 
The Rest variable will help you decode such bundled documents.


Date: Tue, 25 Apr 2017 13:03:40 +0200
From: Dmytro Lytovchenko <dmytro.lytovchenko@REDACTED>
To: ?? <johnzeng91@REDACTED>
Cc: Erlang/OTP discussions <erlang-questions@REDACTED>
Subject: Re: [erlang-questions] What is "Rest" in the return of
	xmerl_scan:string() ?
Message-ID:
	<CAOUb9CEidCqAcXGYC7mtRT=_Ox1rYrT0UZWOTbiGyXWUNrQYMA@REDACTED>
Content-Type: text/plain; charset="utf-8"

In all parsers, that would be the tail of input, which does not match the rules anymore. Empty string if your input is correct.

2017-04-25 9:14 GMT+02:00 ?? <johnzeng91@REDACTED>:

> Hi all,
>   I am using xmerl_scan to decode a xml string, but when calling 
> xmerl_scan:sting, it returns in a tuple:
>
> {xmlElement{}, Rest}
>
> I've searched about this API, looks like we all ignore the Rest in return.
>
> So what is the Rest used for?? Should I ignore them??
>
> Here is the defination of  xmerl_scan:string/1 in erlang OTP 19,
>
> *string(Text::list()) -> {**xmlElement()**, Rest}*
>
>
>  Great thanks.
>



More information about the erlang-questions mailing list