我正在使用DOM解析器来解析XML。 xml格式为:
<PriceList>
<PriceTag>
<Pricing priceCode = "EATIN">
<Price></Price>
<Tax
taxCode = "ALWAYS"
rule = "TAX_CHAIN"
entry = "4"/>
</Pricing>
<Pricing priceCode = "TAKEOUT">
<Price></Price>
<Tax
taxCode = "ALWAYS"
rule = "TAX_CHAIN"
entry = "4"/>
</Pricing>
<Pricing priceCode = "OTHER">
<Price></Price>
<Tax
taxCode = "ALWAYS"
rule = "TAX_CHAIN"
entry = "4"/>
</Pricing>
</PriceTag>
</PriceList>
如果priceCode =“EATIN”,我想看看价格。
任何人都可以帮我实现这个目标。
答案 0 :(得分:0)
尝试替换此行
fileName = ((FileSplit)context.getInputSplit()).getPath().toString();
与fileName = context.getConfiguration().get("mapreduce.input.fileinputformat.inputdir", null);