ディスカッション

NetSuiteの保存検索やレポートをマスターするための究極のガイドである分析センターを使用して、データの力を最大限に活用しましょう。複雑さを単純化し、組織の真の可能性を解き放ちます。今すぐ分析センターに参加して、新たな高みを目指しましょう!
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.

SuiteScript > XML > NetSuite XML APIでXPATHの使用する方法

編集済:Jul 24, 2024 8:01PM SuiteCloud / カスタマイズ

適用

製品:  NetSuite 2020.1

シナリオ

NetSuite XML APIでXPATHの使用する方法

解決策

XML APIを使用する前に、XPATHとは何か、およびその使用方法を理解しておく必要があります。

XPATHとは:

  • XMLドキュメントの情報を検索するための言語です。
  • XMLドキュメントの要素および属性のナビゲートに使用されます。
  • XMLドキュメントのノード選択またはノード設定するためにパス式を使用する。

XPATHで使用されるパス式は、従来のコンピュータファイルシステムを使用する場合に表示される式とよく似ています。ノードは、パスまたはステップに従って選択されます。最も有用なパス式は以下のリストに示す。


次の例では、以下のxmlを使用する:

/*** Create XML ***/
var stXMLRequest = '<?xml version="1.0" encoding="ISO-8859-1"?>';
stXMLRequest = stXMLRequest + '<bookstore>';
stXMLRequest = stXMLRequest + '<book category="cooking">';
stXMLRequest = stXMLRequest + '<title >Everyday Italian</title>';
stXMLRequest = stXMLRequest + '<author>Giada De Laurentiis</author>';
stXMLRequest = stXMLRequest + '<year>2005</year>';
stXMLRequest = stXMLRequest + '<price>30.00</price>';
stXMLRequest = stXMLRequest + '</book>';
stXMLRequest = stXMLRequest + '<book category="cooking">';
stXMLRequest = stXMLRequest + '<title >Chef At Home</title>';
stXMLRequest = stXMLRequest + '<author>Michael Smith</author>';
stXMLRequest = stXMLRequest + '<year>2010</year>';
stXMLRequest = stXMLRequest + '<price>29.95</price>';
stXMLRequest = stXMLRequest + '</book>';
stXMLRequest = stXMLRequest + '<book category="gardening">';
stXMLRequest = stXMLRequest + '<title >Orchids For Life</title>';
stXMLRequest = stXMLRequest + '<author>Gardener Sam</author>';
stXMLRequest = stXMLRequest + '<year>2008</year>';
stXMLRequest = stXMLRequest + '<price>9.95</price>';
stXMLRequest = stXMLRequest + '</book>';
stXMLRequest

ようこそ!

サインイン

完全な詳細を表示するには、サインインしてください。

登録

アカウントがありませんか?ここをクリックして始めましょう!

リーダーボード

コミュニティの達人

第2四半期 (4月~6月 2026)

今週のリーダー

今月のリーダー

歴代リーダー