Parse xPath like string and create xml document using jdom
문제
I am trying to build some utility to create document model from a string like xpath:
setName(document,"college/class/student[14]@name","Rob"),
so, this function should create nodes and attributes in the document if it doesn't exist and move on if the node already exists.
I am failing to validate and implement the '[14]' part, ie creating 13 blank followed with adding attribute name with value of "Rob". As, there can also be cases of
setName(document,"university/college[2]/class[12]/student[14]@name","Rob")\
Thanks in Advance Tirthankar
해결책
You need a recursive parser that is able to handle the indexes.
제휴하지 않습니다 StackOverflow