我正在使用 javax.xml.parsers 浏览 XML 文档,如下所示:
`
<ContextElement>
<DimensionNode>Role</DimensionNode>
<Value>Administration</Value>
<TailoringExpressions>
<TailoringExpression>
<Relation>Student</Relation>
<ProjAtt>
<Attribute>Matr</Attribute>
<Attribute>SName</Attribute>
<Attribute>SSurname</Attribute>
<Attribute>SDateOfBirth</Attribute>
<Attribute>SEmail</Attribute>
<Attribute>SAddress</Attribute>
</ProjAtt>
<Condition/>
<SemiJoinRel/>
<SemiJoinOn/>
<SemiJoinCond/>
</TailoringExpression>
</TailoringExpressions>
</ContextElement>
<ContextElement>
<DimensionNode>Deadline</DimensionNode>
<Value>Lost</Value>
<TailoringExpressions>
<TailoringExpression>
<Relation>Deadline</Relation>
<ProjAtt>
<Attribute>IdDeadline</Attribute>
<Attribute>Student</Attribute>
<Attribute>DeadlineDate</Attribute>
<Attribute>Description</Attribute>
<Attribute>IsMet</Attribute>
</ProjAtt>
<Condition>DeadlineDate LT CurrentDate AND IsMet=False</Condition>
<SemiJoinRel/>
<SemiJoinOn/>
<SemiJoinCond/>
</TailoringExpression>
</TailoringExpressions>
</ContextElement>
`
我有一个问题,因为我需要提取对象/节点 ContextElement,它作为 DimensionNode 的值为“Role”,作为 Value 的值为“Administration”,我无法编写工作代码!有人可以告诉我该怎么做吗?谢谢