2
我試圖解析具有以下結構解析XML文件和其中的R
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://12345hc.com/xsd">
<xs:complexType name="Context">
<xs:sequence>
<xs:element minOccurs="0" name="aNum" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="aId" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="bURI" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="facility" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="fSessionId" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="ID" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="pwrd" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="profileID" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="sToken" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="sId" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="tId" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="uNum" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="webURI" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="xZRT" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
我試圖選擇具有name="Context"
標籤的節點的XML文件該標籤內的元件
選擇元素標記爲ID,
<xs:element minOccurs="0" name="ID" nillable="true" type="xs:string"/>
並將值「111111」添加到此元素ID
。
完成此任何指針/答案將非常有幫助。提前致謝。
的'xml2'包擁有所有你需要的解析,但寫你需要潛入'XML'包,這是一種巨大的。 – alistaire