문제

I am modifying some old code that parses a DTD using the Wutka DTDParser (http://mvnrepository.com/artifact/com.wutka/dtdparser/1.21). I need to be able to retrieve the elements in the order they appeared in the DTD file. But the DTDParser stores the elements in a Hashtable, so I'm pretty sure I'm out of luck. Does anyone know if there's any trick to doing what I need here, or if there's another DTD parsing library for java that would support that functionality (preferably that would be easy to swap into code that currently uses Wutka)? Thanks!

도움이 되었습니까?

해결책

Looks like the best solution is to create a modified version of the Wutka library, since it's open source. I replaced the Hashtables with LinkedHashMaps and replaced calls to somehashtable.elements() with Collections.enumeration(somemap.values()) for minimum disruption. It seems to do what I need it to without anything else being broken.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top