JDOM은 ID 및 IDREF에 대한 지원이 있습니까?
문제
<!DOCTYPE inventory [
<!ELEMENT book (title,author)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT author (#PCDATA)>
<!ATTLIST book year CDATA #IMPLIED>
<!ATTLIST book myId ID #REQUIRED>
<!ATTLIST book myIdRef IDREF #IMPLIED>
]>
<inventory>
<book year="2000" myId="1">
<title>Snow Crash</title>
<author>Neal Stephenson</author>
</book>
<book myId="3" myIdRef="1"/>
</inventory>
JDOM은 다음과 같은 일을 할 수있는 능력이 있습니까?
Element root = doc.getRootElement();
List children = root.getChildren();
for(Object node:children){
Element book = (Element) node;
System.out.println(book.getAttributeValue("year"));
}
/*
So print:
2000
2000
*/
또는 ID 및 IDREF와 관련된 다른 시설 ??
제휴하지 않습니다 StackOverflow