The XML is not bad :) If you can give me the DTD or shema, it will be very helpful to solve the problem. Two approaches towards the data you need:1. Use DOM and hard code your qualification into Java code. 2. Use XPath to retrieve the qualified data.imo, the second may be the better. Just according to the XML snippet you posted, the XPath expression that matchs your demand is:/ROOT/List[Name='FSMount']/List[Name='myrmdesc']/Var/@MountPointNote that in the expression ROOT is only a placeholder which indicates the root element in your XML file, which you didn't post now. There are still something else to retrieve the data you want, but the XPath expression is the key step. More things will be left to you. Don't claim that you know nothing about XML:)
If you can give me the DTD or shema, it will be very helpful to solve the problem. Two approaches towards the data you need:1. Use DOM and hard code your qualification into Java code.
2. Use XPath to retrieve the qualified data.imo, the second may be the better. Just according to the XML snippet you posted, the XPath expression that matchs your demand is:/ROOT/List[Name='FSMount']/List[Name='myrmdesc']/Var/@MountPointNote that in the expression ROOT is only a placeholder which indicates the root element in your XML file, which you didn't post now. There are still something else to retrieve the data you want, but the XPath expression is the key step. More things will be left to you. Don't claim that you know nothing about XML:)
没有根节点,怎样用DOM来解析?