不是 xml 专家我试图从打印机导入日志文件,我需要一个 xlst 文件将其导入文件制作器,但出了点问题
- 我想要什么结果?
- _Version 下结果=3.05
- 在“autoDischargeComposition”下结果=1
- 在“高度”结果=500.12077
- 在“宽度”下结果=400.22566
- 在“scaleFixedRatio”下结果=真
- 在“高度”下结果=56.20050
- 在“宽度”下结果=56.10050
所以我只需要名称和结果 xlst 文件现在发生的情况是它只获取
- _版本 3.05
- 自动放电组合 1
- 并跳过其余的!!!!
这是打印机 log.xml 文件:
<?xml version="1.0" encoding="UTF-8"?>
<java version="1.6.0_27" class="java.beans.XMLDecoder">
<object class="rip.properties.XmlEdit">
<void property="_VERSION">
<string>3.05</string>
</void>
<void property="autoDischargeComposition">
<int>1</int>
</void>
<void property="scale">
<object class="cmn.math.DimDouble">
<void property="height">
<double>500.12077</double>
</void>
<void property="width">
<double>400.22566</double>
</void>
</object>
</void>
<void property="scaleFixedRatio">
<boolean>true</boolean>
</void>
<void property="scaleRatio">
<object class="cmn.math.DimDouble">
<void property="height">
<double>56.20050</double>
</void>
<void property="width">
<double>56.10050</double>
</void>
</object>
</void>
</object>
</java>
这是 xlst 文件
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>
<xsl:template match="/">
<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
<ERRORCODE>0</ERRORCODE>
<PRODUCT BUILD="" NAME="" VERSION=""/>
<DATABASE DATEFORMAT="" LAYOUT="" NAME="" RECORDS="" TIMEFORMAT=""/>
<METADATA>
<FIELD NAME="_VERSION" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="autoDischargeComposition" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="height" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="width" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="scaleRatio" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="height" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="width" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
</METADATA>
<RESULTSET FOUND="">
<xsl:for-each select="java/object">
<ROW MODID="" RECORDID="">
<COL><DATA><xsl:value-of select="void[@property='_VERSION']/string"/></DATA></COL>
<COL><DATA><xsl:value-of select="void[@property='autoDischargeComposition']/int"/></DATA></COL>
<COL><DATA><xsl:value-of select="void[@property='height']/string"/></DATA></COL>
<COL><DATA><xsl:value-of select="void[@property='width']/string"/></DATA></COL>
<COL><DATA><xsl:value-of select="void[@property='scaleRatio']/string"/></DATA></COL>
<COL><DATA><xsl:value-of select="void[@property='height']/string"/></DATA></COL>
<COL><DATA><xsl:value-of select="void[@property='width']/string"/></DATA></COL>
</ROW>
</xsl:for-each>
</RESULTSET>
</FMPXMLRESULT>
</xsl:template>
</xsl:stylesheet>
- 任何帮助将不胜感激谢谢
西宁