What is "Rest" in the return of xmerl_scan:string() ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

What is "Rest" in the return of xmerl_scan:string() ?

达曾
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.



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: What is "Rest" in the return of xmerl_scan:string() ?

Dmytro Lytovchenko
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 达曾 <[hidden email]>:
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.



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: What is "Rest" in the return of xmerl_scan:string() ?

Arif Ishaq-2
In reply to this post by 达曾
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 <[hidden email]>
To: ?? <[hidden email]>
Cc: Erlang/OTP discussions <[hidden email]>
Subject: Re: [erlang-questions] What is "Rest" in the return of
        xmerl_scan:string() ?
Message-ID:
        <CAOUb9CEidCqAcXGYC7mtRT=[hidden email]>
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 ?? <[hidden email]>:

> 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.
>
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Loading...