我正在嘗試從科學期刊(以 JSON 格式提供)中提取提取資料,但是 JSON 的一個值(鍵 = 摘要)以 JATS-XML 格式回傳,這是科學研究出版物的標準化 XML 格式。
"abstract": "<jats:title>Summary</jats:title>\n
<jats:sec>\n <jats:title>Objective</jats:title>\n
<jats:p>To systematically evaluate all the evidence assessing variations in the depth of the curve of Spee (COS) according to the presence/absence of different dentoskeletal characteristics.</jats:p>\n
</jats:sec>\n <jats:sec>\n
<jats:title>Search methods and eligibility criteria</jats:title>\n
<jats:p>The eligibility criteria were outlined following the PECO framework, as follows: studies evaluating individuals with complete permanent dentition including second molars (P), which compared a group with a certain dentoskeletal variation (E) versus another group without the variation (C), regarding the depth of the COS (O). MEDLINE (via PubMed), Scopus, Web of Science, The Cochrane Library, LILACS and BBO (via Virtual Health Library), OpenGrey, and Google Scholar were searched up to September 2021 to identify eligible reports.</jats:p>\n
</jats:sec>\n <jats:sec>\n
<jats:title>Data collection and analysis</jats:title>\n
<jats:p>Duplicates were removed from all the records retrieved. The selection process and data collection were performed independently by two review members. The risk of bias was also assessed independently and in duplicate, using the guideline described by Fowkes and Fulton. Several meta-analyses (α = 0.05) were conducted to estimate the mean differences (MD) or standardized mean differences (SMD) in the depth of COS between individuals presenting or not certain dentoskeletal characteristics. The certainty of evidence was assessed using the GRADE tool.</jats:p>\n </jats:sec>\n
<jats:sec>\n <jats:title>Results</jats:title>\n
<jats:p>Thirty-five studies were selected for qualitative synthesis, and 29 of them for quantitative synthesis. All studies had methodological limitations that affected the risk of bias and increased the likelihood that results were due to chance. Syntheses showed that Class II malocclusion (SMD = 0.87; 95% CI: 0.61, 1.13; P &lt; 0.00001; six datasets including 260 subjects analysed), Class II division 1 (SMD = 1.09; 95% CI: 0.62, 1.56; P &lt; 0.00001; 14 datasets including 823 subjects analysed) and Class II division 2 (SMD = 2.65; 95% CI: 1.51, 3.79; P &lt; 0.00001; eight datasets including 476 subjects analysed) had deeper COS than Class I malocclusion. The skeletal Class II also presented higher COS values than skeletal Class I (SMD = 0.57; 95% CI: 0.02, 1.12; P = 0.04; four datasets including 299 subjects analysed). Individuals with Class III malocclusion had flatter COS than the subjects having Class I malocclusion (SMD = ?0.57; 95% CI: ?1.07, ?0.08; P = 0.02; nine datasets including 505 individuals analysed). No difference was shown in the COS depth between skeletal Class III and Class I (P &gt; 0.05). Deep bite individuals had higher COS depth than those with normal overbite (MD = 0.61; 95% CI: 0.41, 0.82; P &lt; 0.00001; two datasets including 250 subjects analysed). In addition, hypodivergent individuals presented deeper COS than normodivergents (SMD = 0.62; 95% CI: 0.37, 0.86; P &lt; 0.00001; six datasets including 305 subjects analysed), and there was no significant difference in the COS depth between hyperdivergent and normodivergent individuals (P = 0.66). The certainty of evidence was rated as very low for all the syntheses.</jats:p>\n </jats:sec>\n <jats:sec>\n
<jats:title>Limitations</jats:title>\n <jats:p>All the quantitative syntheses included results from studies with methodological flaws. Therefore, they are potentially biased. Moreover, the evidence was also mainly affected in terms of the inconsistency of the results and the imprecision of the estimates.</jats:p>\n </jats:sec>\n
<jats:sec>\n <jats:title>Conclusions</jats:title>\n
<jats:p>Although an apparent influence of dentoskeletal Class II, Class III malocclusion, deep bite, and the hypodivergent skeletal pattern on the depth of the COS is suggested, it is not possible to make definitive conclusions on the matter due to the very low certainty of the evidence. Further high-quality research is necessary.</jats:p>\n </jats:sec>"
我曾嘗試使用Dart XML包,但沒有任何運氣。
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http;
import 'dart:convert';
import 'package:deep_pick/deep_pick.dart';
import 'package:xml/xml.dart';
Future<void> main() async {
final response =
await http.get(Uri.parse( < api > ));
final json = jsonDecode(response.body);
final abstract = pick(json, 'abstract').asStringOrThrow();
final abstractParse = XmlDocument.parse(abstract);
print(XmlDocument.parse(abstract).toXmlString(pretty: true));
uj5u.com熱心網友回復:
由于某種原因,您的 XML 沒有整體封閉標記,但您可以添加一個。
void main() {
final cleanInput = input.replaceAll('\\n', '');
final enclosedInput = '<root>$cleanInput</root>';
final doc = XmlDocument.parse(enclosedInput);
print(doc.firstElementChild!.firstElementChild); // prints <jats:title>Summary</jats:title>
}
\n首先,可選地,用-去掉 ,replaceAll即使決議器實際上似乎并不介意它們。
然后在您選擇的任何標簽(例如<root>)之間插入您的 XML,并對其進行決議。頂部元素現在將是您添加的根標簽,它的第一個子元素將是title標簽。
所以,改為:
final abstract = pick(json, 'abstract').asStringOrThrow().replaceAll('\\n', '');
final abstractDocument = XmlDocument.parse('<root>$abstract</root>');
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/426586.html
