将 php 脚本移植到 golang 时遇到问题。
golang中有没有类似于php的方法:
$processRefList = $faceContainer->getElementsByTagName('processRef');
有一个 xml 文件,其中包含大量名为processRef.
所以我需要在不处理嵌套结构树的情况下收集所有这些元素。
这是xml的示例部分:
<face>
<processes>
<process group="1" type="regular"/>
<process group="2" type="spotUV" state="off"/>
</processes>
<assets>...</assets>
<groups>
<group id="1">
<assetRefs>
<imageRef ref="1" x="0" y="0" id="8">
<processRefs>
<!-- This applies spotUV to this asset and removes the regular process. -->
<processRef ref="1" state="off"/>
<processRef ref="2" state="on"/>
</processRefs>
</imageRef>
<textRef ref="1" x="161" y="41" id="7"/>
<textRef ref="2" x="160" y="55" id="6">
<processRefs>
<!-- This applies spotUV to this asset and also leaves regular process applied. -->
<processRef ref="2" state="on"/>
</processRefs>
</textRef>
</assetRefs>
</group>
<group id="2">...</group>
</groups>
梦里花落0921
相关分类