如何从XML文件JavaScript中读取数据

时间:2017-03-07 12:28:37

标签: javascript xml

我搜索一个解决方案,在javascript中读取指定的xml文件。 以下是xml文件中的数据示例:

<ExternalArchive Name="Demo">
<DocumentItems>
    <DocumentItem CreatedDate="20161130" DocumentClassName="KD_AKTEN" 
                    DocumentId="L90NHFJ7" DocumentTypName="Demoinvoice" 
                    FilingCabinetName="Temp01" UserObjectNumber="9" 
                    UserObjectTypeName="PDF" File="Test.PDF" 
                    SignatureFile="" ReportFile="" PageCount="1">
        <DocIndexValue IndexfieldName=BELEG_DAT> 
            <Value>20161130</Value> 
        </DocIndexValue> 
        <DocIndexValue IndexfieldName=BELEG_NR> 
            <Value>123456</Value> 
        </DocIndexValue> 
        <DocIndexValue IndexfieldName=BRUTTO> 
            <Value>339,42</Value> 
        </DocIndexValue> 
        <DocIndexValue IndexfieldName=FIRMA> 
            <Value>700</Value> 
        </DocIndexValue> 
        <DocIndexValue IndexfieldName=NETTO> 
            <Value>339,42</Value> 
        </DocIndexValue> 
        <DocIndexValue IndexfieldName=PERSKONTO> 
            <Value>81914</Value> 
        </DocIndexValue> 
        <DocIndexValue IndexfieldName=USER> 
            <Value>Test User</Value> 
        </DocIndexValue>
    </DocumentItem> 
</DocumentItems> 

我需要读取“文件”值和“DocIndexValue”中的值。 我怎么能从文件中读到这个?

0 个答案:

没有答案
相关问题