Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在xmlinputformat hadoop中为xml开始标记提供属性_Xml_Hadoop - Fatal编程技术网

如何在xmlinputformat hadoop中为xml开始标记提供属性

如何在xmlinputformat hadoop中为xml开始标记提供属性,xml,hadoop,Xml,Hadoop,我想在hadoop中解析xml文件。它包含一个标签,如 <article name="..." year="...." /> 如果我在xmlinputformat start\u tag\u key中将article作为我的开始标记,它将无法识别article标记,因为我的文件包含带有属性的article标记 如何在xmlinputformat中为上述文章标记指定start\u tag\u key。您必须这样指定它- Configuration conf = new Conf

我想在
hadoop
中解析xml文件。它包含一个标签,如

<article name="..." year="...." /> 

如果我在
xmlinputformat start\u tag\u key
中将
article
作为我的开始标记,它将无法识别article标记,因为我的文件包含带有属性的article标记


如何在
xmlinputformat
中为上述文章标记指定
start\u tag\u key

您必须这样指定它-

Configuration conf = new Configuration();
conf.set("xmlinput.start", "<article>");
Configuration conf=new Configuration();
conf.set(“xmlinput.start”和“”);

如果XML开始标记包含如下属性

<article name="..." year="...." /> 

然后,您应该将开始标记和结束标记用作:

configuration.set("xmlinput.start", "<article");
configuration.set("xmlinput.end", "</article>");

configuration.set(“xmlinput.start”)这个问题解决了吗?