NutzCN Logo
问答 xml文件解析问题
发布于 3123天前 作者 Rekoe 1959 次浏览 复制 上一个帖子 下一个帖子
标签:

这种文件用

Document doc = Xmls.xml(new ByteArrayInputStream(xmlStr.getBytes()));
				Element root = doc.getDocumentElement();
				Map<String, Object> map = Xmls.asMap(root);
				System.out.println(map);

解析不到数据?

<GameProjectFile>
  <PropertyGroup Type="Layer" Name="recruit" ID="6831eed2-07a1-4c90-adf1-4d285067007a" Version="2.3.2.3" />
  <Content ctype="GameProjectContent">
    <Content>
      <Animation Duration="0" Speed="0.5000" />
      <ObjectData Name="Layer" Tag="38" ctype="GameLayerObjectData">
        <Size X="540.0000" Y="790.0000" />
        <Children>
          <AbstractNodeData Name="Img_Bg" ActionTag="-1500205789" Tag="48" IconVisible="False" LeftMargin="6.0000" RightMargin="6.0000" TopMargin="41.0000" BottomMargin="2.0000" Scale9Enable="True" LeftEage="39" RightEage="39" TopEage="56" BottomEage="56" Scale9OriginX="39" Scale9OriginY="56" Scale9Width="42" Scale9Height="59" ctype="ImageViewObjectData">
            <Size X="528.0000" Y="747.0000" />
            <AnchorPoint ScaleX="0.5000" ScaleY="1.0000" />
            <Position X="270.0000" Y="749.0000" />
            <Scale ScaleX="1.0000" ScaleY="1.0000" />
            <CColor A="255" R="255" G="255" B="255" />
            <PrePosition X="0.5000" Y="0.9481" />
            <PreSize X="0.9778" Y="0.9456" />
            <FileData Type="PlistSubImage" Path="base_general_1_4.png" Plist="images/ui/general/base_general_1.plist" />
          </AbstractNodeData>
          <AbstractNodeData Name="LstVw_btns" ActionTag="430780003" Tag="49" IconVisible="False" LeftMargin="30.0000" RightMargin="30.0000" TopMargin="83.6700" BottomMargin="35.3300" TouchEnable="True" ClipAble="True" BackColorAlpha="102" ColorAngle="90.0000" ScrollDirectionType="0" DirectionType="Vertical" HorizontalType="Align_HorizontalCenter" ctype="ListViewObjectData">
            <Size X="480.0000" Y="671.0000" />
            <AnchorPoint ScaleX="0.5000" ScaleY="1.0000" />
            <Position X="270.0000" Y="706.3300" />
            <Scale ScaleX="1.0000" ScaleY="1.0000" />
            <CColor A="255" R="255" G="255" B="255" />
            <PrePosition X="0.5000" Y="0.8941" />
            <PreSize X="0.8889" Y="0.8494" />
            <SingleColor A="255" R="150" G="150" B="255" />
            <FirstColor A="255" R="150" G="150" B="255" />
            <EndColor A="255" R="255" G="255" B="255" />
            <ColorVector ScaleY="1.0000" />
          </AbstractNodeData>
        </Children>
      </ObjectData>
    </Content>
  </Content>
</GameProjectFile>
3 回复

我晚上试试

想起来了,还不支持带attr的xml,读不出来

添加回复
请先登陆
回到顶部