2
는 내가 마지막 sequence_number, 즉 싶어 xslt에서 마지막 자식 노드 특정 요소 값을 얻는 방법?
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<InsertConcurSAE_batch_req xmlns="http://ws.wso2.org/dataservice">
<InsertConcurSAE>
<constant>DETAIL</constant>
<batch_id>6</batch_id>
<batch_date>2012-08-13</batch_date>
<sequence_number>1</sequence_number>
<emp_id>8535</emp_id>
<last_name>Burson</last_name>
<first_name>Sherrie</first_name>
<group_id>US</group_id>
<employee_org_unit_1>30</employee_org_unit_1>
<employee_org_unit_2>80</employee_org_unit_2>
<employee_org_unit_3>500</employee_org_unit_3>
<employee_org_unit_4>G&A Function</employee_org_unit_4>
<report_id>4CDF6336F5C947E2A0F8</report_id>
<report_key>1</report_key>
<ledger>SEMTECH</ledger>
<reimburse_currency_alpha_ise>USD</reimburse_currency_alpha_ise>
<home_country>UNITED STATES</home_country>
<report_submit_date>2012-08-08</report_submit_date>
<report_user_defined_date>2012-08-01</report_user_defined_date>
<report_payment_processing_date>2012-08-10</report_payment_processing_date>
<report_name>August</report_name>
<report_image_required>Y</report_image_required>
<report_has_vat_entry>N</report_has_vat_entry>
<report_has_ta_entry>N</report_has_ta_entry>
<report_total_post_amount>314.4200</report_total_post_amount>
<report_total_approved_amount>314.4200</report_total_approved_amount>
<report_policy_name>Non VAT Expense Policy</report_policy_name>
<report_org_unit_1>30</report_org_unit_1>
<report_org_unit_2>99</report_org_unit_2>
<report_org_unit_3>500</report_org_unit_3>
<report_org_unit_4>G&A Function</report_org_unit_4>
<report_custom_1>G&A Function</report_custom_1>
<report_custom_15>US</report_custom_15>
<report_custom_16>8535</report_custom_16>
<report_custom_17>N02574</report_custom_17>
<report_custom_18>46</report_custom_18>
<report_custom_19>1402</report_custom_19>
<report_custom_20>BE1</report_custom_20>
<entry_id>1</entry_id>
<entry_transaction_type>REG</entry_transaction_type>
<expense_type>D-Business Meal with attendees</expense_type>
<entry_transaction_date>2012-07-31</entry_transaction_date>
<spend_currency_alpha_iso>USD</spend_currency_alpha_iso>
<currency_exchange_rate>1.0000</currency_exchange_rate>
<exchange_rate_direction>M</exchange_rate_direction>
<is_personal>N</is_personal>
<receipt_received>N</receipt_received>
<receipt_type>N</receipt_type>
<total_employee_attendee>7</total_employee_attendee>
<report_entry_custom_1>No</report_entry_custom_1>
<report_entry_custom_35>US</report_entry_custom_35>
<report_entry_custom_39>0.0000</report_entry_custom_39>
<report_entry_custom_40>90.9900</report_entry_custom_40>
<entry_transaction_amount>90.9900</entry_transaction_amount>
<entry_posted_amount>90.9900</entry_posted_amount>
<entry_approved_amount>90.9900</entry_approved_amount>
<entry_payment_code>CASH</entry_payment_code>
<entry_payment_code_name>Cash</entry_payment_code_name>
<entry_country>US</entry_country>
<entry_country_sub>US-CA</entry_country_sub>
<domestic_foreign>HOME</domestic_foreign>
<payer_pay_type>Company</payer_pay_type>
<payer_pay_code>Company/Employee Pseudo Payment Code</payer_pay_code>
<payee_pay_type>Employee</payee_pay_type>
<payee_pay_code>Company/Employee Pseudo Payment Code</payee_pay_code>
<account_code>70210</account_code>
<drcr>DR</drcr>
<journal_amount>+90.9900</journal_amount>
<journal_key>34</journal_key>
<allocation_alloc_key>1</allocation_alloc_key>
<allocation_percentage>100.0000</allocation_percentage>
<report_entry_total_tax_posted_amount>0.0000</report_entry_total_tax_posted_amount>
<net_tax_amount>90.9900</net_tax_amount>
<report_entry_total_reclaim_adjusted_amount>0.0000</report_entry_total_reclaim_adjusted_amount>
<net_adjusted_reclaim_amount>90.9900</net_adjusted_reclaim_amount>
<payment_type>Out of Pocket</payment_type>
</InsertConcurSAE>
<InsertConcurSAE>
<constant>DETAIL</constant>
<batch_id>6</batch_id>
<batch_date>2012-08-13</batch_date>
<sequence_number>2</sequence_number>
<emp_id>8535</emp_id>
<last_name>Burson</last_name>
<first_name>Sherrie</first_name>
<group_id>US</group_id>
<employee_org_unit_1>30</employee_org_unit_1>
<employee_org_unit_2>80</employee_org_unit_2>
<employee_org_unit_3>500</employee_org_unit_3>
<employee_org_unit_4>G&A Function</employee_org_unit_4>
<report_id>4CDF6336F5C947E2A0F8</report_id>
<report_key>1</report_key>
<ledger>SEMTECH</ledger>
<reimburse_currency_alpha_ise>USD</reimburse_currency_alpha_ise>
<home_country>UNITED STATES</home_country>
<report_submit_date>2012-08-08</report_submit_date>
<report_user_defined_date>2012-08-01</report_user_defined_date>
<report_payment_processing_date>2012-08-10</report_payment_processing_date>
<report_name>August</report_name>
<report_image_required>Y</report_image_required>
<report_has_vat_entry>N</report_has_vat_entry>
<report_has_ta_entry>N</report_has_ta_entry>
<report_total_post_amount>314.4200</report_total_post_amount>
<report_total_approved_amount>314.4200</report_total_approved_amount>
<report_policy_name>Non VAT Expense Policy</report_policy_name>
<report_org_unit_1>30</report_org_unit_1>
<report_org_unit_2>99</report_org_unit_2>
<report_org_unit_3>500</report_org_unit_3>
<report_org_unit_4>G&A Function</report_org_unit_4>
<report_custom_1>G&A Function</report_custom_1>
<report_custom_15>US</report_custom_15>
<report_custom_16>8535</report_custom_16>
<report_custom_17>N02574</report_custom_17>
<report_custom_18>46</report_custom_18>
<report_custom_19>1402</report_custom_19>
<report_custom_20>BE1</report_custom_20>
<entry_id>5</entry_id>
<entry_transaction_type>REG</entry_transaction_type>
<expense_type>D-Business Meal with attendees</expense_type>
<entry_transaction_date>2012-08-02</entry_transaction_date>
<spend_currency_alpha_iso>USD</spend_currency_alpha_iso>
<currency_exchange_rate>1.0000</currency_exchange_rate>
<exchange_rate_direction>M</exchange_rate_direction>
<is_personal>N</is_personal>
<receipt_received>N</receipt_received>
<receipt_type>N</receipt_type>
<total_employee_attendee>9</total_employee_attendee>
<report_entry_custom_1>No</report_entry_custom_1>
<report_entry_custom_35>US</report_entry_custom_35>
<report_entry_custom_39>0.0000</report_entry_custom_39>
<report_entry_custom_40>138.6700</report_entry_custom_40>
<entry_transaction_amount>138.6700</entry_transaction_amount>
<entry_posted_amount>138.6700</entry_posted_amount>
<entry_approved_amount>138.6700</entry_approved_amount>
<entry_payment_code>CASH</entry_payment_code>
<entry_payment_code_name>Cash</entry_payment_code_name>
<entry_country>US</entry_country>
<entry_country_sub>US-CA</entry_country_sub>
<domestic_foreign>HOME</domestic_foreign>
<payer_pay_type>Company</payer_pay_type>
<payer_pay_code>Company/Employee Pseudo Payment Code</payer_pay_code>
<payee_pay_type>Employee</payee_pay_type>
<payee_pay_code>Company/Employee Pseudo Payment Code</payee_pay_code>
<account_code>70210</account_code>
<drcr>DR</drcr>
<journal_amount>+138.6700</journal_amount>
<journal_key>35</journal_key>
<allocation_alloc_key>5</allocation_alloc_key>
<allocation_percentage>100.0000</allocation_percentage>
<report_entry_total_tax_posted_amount>0.0000</report_entry_total_tax_posted_amount>
<net_tax_amount>138.6700</net_tax_amount>
<report_entry_total_reclaim_adjusted_amount>0.0000</report_entry_total_reclaim_adjusted_amount>
<net_adjusted_reclaim_amount>138.6700</net_adjusted_reclaim_amount>
<payment_type>Out of Pocket</payment_type>
</InsertConcurSAE>
<InsertConcurSAE>
<constant>DETAIL</constant>
<batch_id>6</batch_id>
<batch_date>2012-08-13</batch_date>
<sequence_number>3</sequence_number>
<emp_id>8535</emp_id>
<last_name>Burson</last_name>
<first_name>Sherrie</first_name>
<group_id>US</group_id>
<employee_org_unit_1>30</employee_org_unit_1>
<employee_org_unit_2>80</employee_org_unit_2>
<employee_org_unit_3>500</employee_org_unit_3>
<employee_org_unit_4>G&A Function</employee_org_unit_4>
<report_id>4CDF6336F5C947E2A0F8</report_id>
<report_key>1</report_key>
<ledger>SEMTECH</ledger>
<reimburse_currency_alpha_ise>USD</reimburse_currency_alpha_ise>
<home_country>UNITED STATES</home_country>
<report_submit_date>2012-08-08</report_submit_date>
<report_user_defined_date>2012-08-01</report_user_defined_date>
<report_payment_processing_date>2012-08-10</report_payment_processing_date>
<report_name>August</report_name>
<report_image_required>Y</report_image_required>
<report_has_vat_entry>N</report_has_vat_entry>
<report_has_ta_entry>N</report_has_ta_entry>
<report_total_post_amount>314.4200</report_total_post_amount>
<report_total_approved_amount>314.4200</report_total_approved_amount>
<report_policy_name>Non VAT Expense Policy</report_policy_name>
<report_org_unit_1>30</report_org_unit_1>
<report_org_unit_2>99</report_org_unit_2>
<report_org_unit_3>500</report_org_unit_3>
<report_org_unit_4>G&A Function</report_org_unit_4>
<report_custom_1>G&A Function</report_custom_1>
<report_custom_15>US</report_custom_15>
<report_custom_16>8535</report_custom_16>
<report_custom_17>N02574</report_custom_17>
<report_custom_18>46</report_custom_18>
<report_custom_19>1402</report_custom_19>
<report_custom_20>BE1</report_custom_20>
<entry_id>6</entry_id>
<entry_transaction_type>REG</entry_transaction_type>
<expense_type>D-Business Meal with attendees</expense_type>
<entry_transaction_date>2012-08-03</entry_transaction_date>
<spend_currency_alpha_iso>USD</spend_currency_alpha_iso>
<currency_exchange_rate>1.0000</currency_exchange_rate>
<exchange_rate_direction>M</exchange_rate_direction>
<is_personal>N</is_personal>
<receipt_received>N</receipt_received>
<receipt_type>N</receipt_type>
<total_employee_attendee>4</total_employee_attendee>
<report_entry_custom_1>No</report_entry_custom_1>
<report_entry_custom_35>US</report_entry_custom_35>
<report_entry_custom_39>0.0000</report_entry_custom_39>
<report_entry_custom_40>26.9500</report_entry_custom_40>
<entry_transaction_amount>26.9500</entry_transaction_amount>
<entry_posted_amount>26.9500</entry_posted_amount>
<entry_approved_amount>26.9500</entry_approved_amount>
<entry_payment_code>CASH</entry_payment_code>
<entry_payment_code_name>Cash</entry_payment_code_name>
<entry_country>US</entry_country>
<entry_country_sub>US-CA</entry_country_sub>
<domestic_foreign>HOME</domestic_foreign>
<payer_pay_type>Company</payer_pay_type>
<payer_pay_code>Company/Employee Pseudo Payment Code</payer_pay_code>
<payee_pay_type>Employee</payee_pay_type>
<payee_pay_code>Company/Employee Pseudo Payment Code</payee_pay_code>
<account_code>70210</account_code>
<drcr>DR</drcr>
<journal_amount>+26.9500</journal_amount>
<journal_key>36</journal_key>
<allocation_alloc_key>6</allocation_alloc_key>
<allocation_percentage>100.0000</allocation_percentage>
<report_entry_total_tax_posted_amount>0.0000</report_entry_total_tax_posted_amount>
<net_tax_amount>26.9500</net_tax_amount>
<report_entry_total_reclaim_adjusted_amount>0.0000</report_entry_total_reclaim_adjusted_amount>
<net_adjusted_reclaim_amount>26.9500</net_adjusted_reclaim_amount>
<payment_type>Out of Pocket</payment_type>
</InsertConcurSAE>
<InsertConcurSAE>
<constant>DETAIL</constant>
<batch_id>6</batch_id>
<batch_date>2012-08-13</batch_date>
<sequence_number>4</sequence_number>
<emp_id>8535</emp_id>
<last_name>Burson</last_name>
<first_name>Sherrie</first_name>
<group_id>US</group_id>
<employee_org_unit_1>30</employee_org_unit_1>
<employee_org_unit_2>80</employee_org_unit_2>
<employee_org_unit_3>500</employee_org_unit_3>
<employee_org_unit_4>G&A Function</employee_org_unit_4>
<report_id>4CDF6336F5C947E2A0F8</report_id>
<report_key>1</report_key>
<ledger>SEMTECH</ledger>
<reimburse_currency_alpha_ise>USD</reimburse_currency_alpha_ise>
<home_country>UNITED STATES</home_country>
<report_submit_date>2012-08-08</report_submit_date>
<report_user_defined_date>2012-08-01</report_user_defined_date>
<report_payment_processing_date>2012-08-10</report_payment_processing_date>
<report_name>August</report_name>
<report_image_required>Y</report_image_required>
<report_has_vat_entry>N</report_has_vat_entry>
<report_has_ta_entry>N</report_has_ta_entry>
<report_total_post_amount>314.4200</report_total_post_amount>
<report_total_approved_amount>314.4200</report_total_approved_amount>
<report_policy_name>Non VAT Expense Policy</report_policy_name>
<report_org_unit_1>30</report_org_unit_1>
<report_org_unit_2>99</report_org_unit_2>
<report_org_unit_3>500</report_org_unit_3>
<report_org_unit_4>G&A Function</report_org_unit_4>
<report_custom_1>G&A Function</report_custom_1>
<report_custom_15>US</report_custom_15>
<report_custom_16>8535</report_custom_16>
<report_custom_17>N02574</report_custom_17>
<report_custom_18>46</report_custom_18>
<report_custom_19>1402</report_custom_19>
<report_custom_20>BE1</report_custom_20>
<entry_id>7</entry_id>
<entry_transaction_type>REG</entry_transaction_type>
<expense_type>D-Business Meal with attendees</expense_type>
<entry_transaction_date>2012-08-07</entry_transaction_date>
<spend_currency_alpha_iso>USD</spend_currency_alpha_iso>
<currency_exchange_rate>1.0000</currency_exchange_rate>
<exchange_rate_direction>M</exchange_rate_direction>
<is_personal>N</is_personal>
<receipt_received>N</receipt_received>
<receipt_type>N</receipt_type>
<total_employee_attendee>6</total_employee_attendee>
<report_entry_custom_1>No</report_entry_custom_1>
<report_entry_custom_35>US</report_entry_custom_35>
<report_entry_custom_39>0.0000</report_entry_custom_39>
<report_entry_custom_40>57.8100</report_entry_custom_40>
<entry_transaction_amount>57.8100</entry_transaction_amount>
<entry_posted_amount>57.8100</entry_posted_amount>
<entry_approved_amount>57.8100</entry_approved_amount>
<entry_payment_code>CASH</entry_payment_code>
<entry_payment_code_name>Cash</entry_payment_code_name>
<entry_country>US</entry_country>
<entry_country_sub>US-CA</entry_country_sub>
<domestic_foreign>HOME</domestic_foreign>
<payer_pay_type>Company</payer_pay_type>
<payer_pay_code>Company/Employee Pseudo Payment Code</payer_pay_code>
<payee_pay_type>Employee</payee_pay_type>
<payee_pay_code>Company/Employee Pseudo Payment Code</payee_pay_code>
<account_code>70210</account_code>
<drcr>DR</drcr>
<journal_amount>+57.8100</journal_amount>
<journal_key>37</journal_key>
<allocation_alloc_key>7</allocation_alloc_key>
<allocation_percentage>100.0000</allocation_percentage>
<report_entry_total_tax_posted_amount>0.0000</report_entry_total_tax_posted_amount>
<net_tax_amount>57.8100</net_tax_amount>
<report_entry_total_reclaim_adjusted_amount>0.0000</report_entry_total_reclaim_adjusted_amount>
<net_adjusted_reclaim_amount>57.8100</net_adjusted_reclaim_amount>
<payment_type>Out of Pocket</payment_type>
</InsertConcurSAE>
</InsertConcurSAE_batch_req>
</soapenv:Body>
</soapenv:Envelope>
아래로 XML, 4
이 내가 검색하려면 다음 XSLT를 가지고 있지만 모든 값을 보여 나던.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dat="http://ws.wso2.org/dataservice" version="1.0">
<xsl:template match="/">
<ns:text xmlns:ns="http://ws.apache.org/commons/ns/payload"><xsl:text>
</xsl:text>
<xsl:for-each select="//InsertConcurSAE[last()]">
<xsl:variable name="sequence_number" select="//dat:sequence_number" />
<xsl:value-of select="$sequence_number" />
</xsl:for-each>
</ns:text>
</xsl:template>
</xsl:stylesheet>
이 문제를 해결하려면 도와주세요. 그때
<xsl:for-each select="//InsertConcurSAE[last()]">
<xsl:for-each select="*">
대신
을 배치하면 그것은 단지 1.I과 결과는 지난 sequence_number를 검색 할 필요가있다.
I이 인 WSO2 서열을 실행할 때 상기 변환 좋으 작동 오류가 발생 XPath 표현식 "/*/*/*"을 평가할 수 있습니다. 따라서 XPath를 정의해야합니다. – user1662039
안녕하세요. 도움이 되서 고맙습니다. 저는 ////*/*/dat 대신에 아래의 줄을 삽입했습니다 : InsertConcurSAE [last() ]/dat : sequence_number/text()'그리고 그것이 작동했습니다. 다시 한번 감사합니다 – user1662039
@ user1662039, 당신은 환영합니다. 우연히 만난 표현은 우연히 만 이루어졌습니다. 올바른 표현식은 ('someExpr) [last()]'이다. 자세한 설명은이 답변을 참조하십시오 : http://stackoverflow.com/a/5818966/36305. 또한, XML 문서의 구조가 미리 알려질 때마다'//'를 사용하지 마십시오. '//'는 매우 느릴 수 있습니다 *. –