Size bugün nasıl yardımcı olabiliriz?

Using XML Query Modules with an XML that has a namespace

Goals and Symptoms

Using the XML document below with an XML Query Module normally you could use this query to find the price of the first HOEP value
/IMODocument/IMODocBody/HOEPs/HOEP[1]/Price

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="http://reports.ieso.ca/docrefs/stylesheet/DispUnconsHOEP_HTML_t1-1.xsl" ?><IMODocument docID="DispUnconsHOEP" xmlns="http://www.theIMO.com/schema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.theIMO.com/schemahttp://reports.ieso.ca/docrefs/schema/DispUnconsHOEP_r1.xsd">
<IMODocHeader>
<DocTitle>Hourly Ontario Energy Price (HOEP) Report</DocTitle>
<DocRevision>1</DocRevision>
<DocConfidentiality>
<DocConfClass>PUB</DocConfClass>
</DocConfidentiality>
<CreatedAt>2010-06-08T08:01:15</CreatedAt>
</IMODocHeader>
<IMODocBody>
<Date>2010-06-08</Date>
<HOEPs>
<HOEP>
<Hour>1</Hour>
<Price>28.81</Price>
<DataSource>DSO-RD</DataSource>
</HOEP>
<HOEP>
<Hour>2</Hour>
<Price>25.52</Price>
<DataSource>DSO-RD</DataSource>
</HOEP>
<HOEP>
<Hour>3</Hour>
<Price>29.09</Price>
<DataSource>DSO-RD</DataSource>
</HOEP>
<HOEP>
<Hour>4</Hour>
<Price>24.92</Price>
<DataSource>DSO-RD</DataSource>
</HOEP>
</HOEPs>
</IMODocBody>
</IMODocument>

Below is a typical xml document
XML document
ION Setup

Causes and Fixes

However, some xml documents contain a namespace, that makes it difficult for the XML Import module to define the nodes underneath the namespace.

ieso Information

So a generalized query that ignores namespace can be built like this:

//*[local-name()='HOEPs']/*[local-name()='HOEP'][1]/*[local-name()='Price']

ION module setup

Here is a break down of the query:

//*[local-name()='HOEPs'] = Return all nodes in the document with the name 'HOEPs' regardless of position

/*[local-name()='HOEP'][1] = Return all children with name 'HOEP' that have the position 1

/*[local-name()='Price'] = Return all children named 'Price'

XML data

The XML Import uses the Microsoft XML tools.

Below is a useful website containing useful Xpath information in the form of a tutorial. Select the "Next Chapter" link to start the tutorial.

http://www.w3schools.com/xpath/xpath_intro.asp

Schneider Electric Turkey

Daha fazlasını keşfedin
Seri:
Daha fazlasını keşfedin
Seri:

Yardıma mı ihtiyacınız var?

Yardıma mı ihtiyacınız var?

Ürün seçici

Ürün seçici

Uygulamalarınız için doğru ürünleri ve aksesuarları hızlı ve kolay bir şekilde bulun.

Teklif Alın

Teklif Alın

Satışla ilgili sorularınızı çevrimiçi olarak başlatın, bir uzman sizinle bağlantı kuracaktır.

Satış noktaları

Satış noktaları

Konumunuza en yakın Schneider Electric distribütörünü kolayca bulun.

Yardım Merkezi

Yardım Merkezi

Tüm ihtiyaçlarınız için destek kaynaklarını tek bir yerde bulun.

  • Ürün Belgeleri
  • Yazılım İndirmeleri
  • Ürün Seçici
  • İkame Ürün ve Değiştirme
  • Yardım Merkezi
  • Ofislerimizi Bulun
  • Teklif Alın
  • Satış noktaları
  • Schneider Electric Topluluğu
  • Kariyer
  • Şirket Profili
  • Bir usulsüzlüğü bildirin
  • Erişilebilirlik
  • Haberler
  • Yatırımcılar
  • EcoStruxure
  • İş Araması
  • Blog
  • Gizlilik İlkesi
  • Çerez Bildirimi
  • Change your cookie settings