This commit is contained in:
parent
443807d2b8
commit
ac8c7cd29a
@ -7,11 +7,24 @@ use crate::misc::{current_date, Error};
|
||||
|
||||
use super::parser::OgdSearchResult;
|
||||
|
||||
/// Parses a law text from the Austrian RIS (Rechtsinformationssystem) based on the given `law_id`.
|
||||
///
|
||||
/// This function iterates over all pages of the law text, with each page containing a maximum of 100
|
||||
/// paragraphs in XML format. It extracts and returns the links to each paragraph as XML URLs.
|
||||
///
|
||||
/// The first section of the first page is skipped (`skip` is set to true) because it always
|
||||
/// contains the table of contents. The function continues processing subsequent pages until there
|
||||
/// are no more pages left to fetch.
|
||||
///
|
||||
/// # Parameters
|
||||
/// - `law_id`: Id from RIS of a law
|
||||
///
|
||||
/// - `law_id`: The unique identifier of the law in the RIS system.
|
||||
///
|
||||
/// # Returns
|
||||
/// Error, or a list of Xml file links of the given law text
|
||||
///
|
||||
/// - `Ok(Vec<String>)`: A vector of XML file links representing paragraphs from the given law text.
|
||||
/// - `Err(Error)`: An error if there was an issue fetching or parsing the law text.
|
||||
/// ```
|
||||
pub fn parse(law_id: usize) -> Result<Vec<String>, Error> {
|
||||
let mut page = 1;
|
||||
let mut skip = true;
|
||||
|
Loading…
Reference in New Issue
Block a user