0
json 또는 avro와 같은 XML 이외의 데이터 유형에 대해 org.w3c.dom.Node
구현을 찾고 있습니다. 이렇게하면 xpath와 같이 org.w3c.dom.Node
에 대해 작성된 기능을 다시 사용할 수 있습니다.json 용 org.w3c.dom.Node 구현
org.w3c.dom.Node document = new JsonDocument(myJsonMessage);
XPathFactory xpathFactory = XPathFactory.newInstance();
XPath xpath = xpathFactory.newXPath();
String msg = xpath.evaluate("/document/element", document);
msg
내가 JSON에 대한 Node
/Document
의 구현을 제공하는 JSON 문서에 대한 XPath에 대한 평가입니다.
, 감사합니다. 나는 그것이 효과가 있다는 것을 알 수 있지만, json을 xml로 변환 할 여력이 없습니다. –
원하는대로 Node를 구현할 수 있다고 생각하지 않습니다. 그러나 인터페이스이므로 JSONPath와 같은 것으로 위임 한 자체 구현을 구현할 수 있습니다. https://stackoverflow.com/questions/8481380/is-there-a-json-equivalent-of-query-xpath – PillHead