Community forum

Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
View
Go to last post Go to first unread
Offline ErikC  
#1 Posted : Wednesday, August 15, 2012 11:14:10 AM(UTC)
ErikC

Rank: Paid support

Joined: 2/26/2008(UTC)
Posts: 1,437
Netherlands
Location: Amsterdam

Thanks: 95 times
Was thanked: 187 time(s) in 163 post(s)
If you have an XML file which includes a namespace you have to use a prefix in your XPath expression.

Here you have a sample XML file with a namespace: http://someurl.org/2012

Code:
<?xml version="1.0" encoding="utf-8"?>
<test attribute1="nothing here" xmlns="http://someurl.org/2012">
<book>
<name>title1</name>
</book>
<book>
<name>title2</name>
</book>
</test>


Normally you should use /test[1]/book[2]/name[1] to get the title2 as result.
Now with the namespace in the XML file, add the namespace in the Namespaces list and add a prefix, e.g. x.

You should change the XPath expession to: /x:test[1]/x:book[2]/x:name[1]
Now you get the title2 as result.
ErikC attached the following image(s):
15-08-2012 12-12-37.jpg
Uses Visualcron since 2006.
thanks 3 users thanked ErikC for this useful post.
Support on 8/15/2012(UTC), osirisja on 8/15/2012(UTC), Lasse Lehtinen on 4/10/2014(UTC)
Users browsing this topic
Guest
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2016, Yet Another Forum.NET
This page was generated in 0.156 seconds.
Scroll to Top