I have a problem with a Read XML value to variable action.
What I am doing is querying the database for a list of projects to be built. I iterate over each node in the record set (each node represents a project).
In the node iterator I set a variable META_XPATH to what the absolute XPath of each node is.
I use the META_XPATH as the parameter for the Read XML Value to Variable action.
When I have only 1 record (project to build) this works fine. THe META_XPATH gets set to: /xml/rs:data/z:row … and everything works great.
When I have multiple records I run into an error: XPath returned no node: /xml/rs:data/z:row[ 0 ]
So it seems like the XPath that Final builder is defining for me isn’t correct. Is there some additional tweaking I need to do for the XPath (I am brand new to XML)
It looks like FinalBuilder thinks you are using MS XML 3 (which indexes xpath statements from 0 by default) and not MSXML 4, although it looks like you are getting MSXML 4 behaviour (as the indexing-from-0 is not working.)
Is it possible that you have MSXML 3 set on the Iterator action but 4 set on “Read from Variable”?
If you go to the “MSXML Parser” tab and explicitly choose “MSXML 4”, how does it work? If the action fails outright, you may need to download and install MSXML 4 or newer.
Thanks for the quick response. Both of my actions were set to "Highest available."
I tried setting them both to v4 and, as you said, the package failed outright. I set them both to v3 and got the same result as using highest available.
Turns out it seems we weren’t setting the SelectionLanguage property properly in all cases. I’ve checked in a fix that should restore normal behaviour on MSXML 3. It will be available in the next test build. Working with 4 is probably the best option, though.
I don’t know which builds are you guys talking about but since I upgraded from build 234 to 283, I encouter some weird problems with Read XML Node actions. Some of them stopped working with ‘Highest available’ and I need to change to XML 3 and some of them still work. This is weird because in all of them it’s the same path pattern.
The bug which Owen reported isn’t to do with the Read XML Node actions (only to do with generating “absolute” XPaths inside the XPath Iterator.) If you’re having problems with the other XML actions, can you please give us some more details (possibly in a new thread)?
I have a similar problem with the XML Node iterator and “Read XML value to variable” actions. It will only work with XML Parser 3. I installed the XML 4 parser SP2 and it didn’t help. I tried installing FB420_285.exe and it didn’t help either…in fact XML Parser 3 stopped working as well. I reverted back to FB 276 and it works again with XML 3, but no other XML parser option.
Like Owen, I am also using the XML iterator to parse an XML document that is the result of an ADO database recordset.
In windows if you have a window selected and hit Alt+Print Screen, it will just take a snapshot of the selected window and put it in the clipboard. I did that, and then just pasted the image into MS Paint, did a little cropping, and then saved it as a jpg file.
You could either just upload the document that contains the xml text, or copy and paste it into a new text document and upload that. Taking a snapshot and putting it into a jpg would work too.
I too am new to XML/XPath, and I too am having similar problems.
The XML I’m playing with is shown in the first screenshot below; I’m trying to get the value “bin\Release” from the OutputPath item in the 3rd PropertyGroup section.
I first tried the parameters shown in the second screenshot below; with the Highest Available (i.e. MS XML 4) option this gave the error XPath returned no node : /Project/PropertyGroup/OutputPath but with the MS XML 3 option returned the value bin\Debug</b>, which is what I would expect.
I then modified the XPath to Node parameter to read:
I’m having the same problem using XPath as the guy above. It seems that none of the functions work. I tried using “contains”, “starts-with”, “ends-with”, etc. Is this a bug?
Here’s an example: /Project/ItemGroup/Reference[contains(@Include, ‘nGoCtrls’)]
I just tried this with FinalBuilder (with both MSXML3 and MSXML4) and it worked fine.
This is the xml file:
< xml>< test attrib=“zaz”>a< /test>< test attrib=“i bz”>b< /test>< test attrib=“c kk”>c< /test>< /xml>
[extra spaces only so that the tags don’t get ignored by the html rendering]
And in a XML Read XML Value to Variable action: /xml/test[contains(@attrib, ‘b’)]
FinalBuilder simply passes the xpath query through to the MSXML parser, so any error you’re seeing is probably due to the parser. Try downloading the latest MSXML parser and see if that solves the problem. Also, what version of FinalBuilder are you using and which Operating System?
> 4.2.0.276; I gather your latest test build is 293 - shall I try it with that?
I’m pretty sure no changes where made for the xml actions between those versions, but I spose it doesn’t hurt to try.
> In passing, I have also tried using the same XPath independently of FinalBuilder, using a simple standalone VBScript. It also fails.
Ok, this is a big clue… which means it’s probably something to do with msxml instead of FinalBuilder. I’m running out of ideas as to what could be the problem. Have you got any other PC’s that you could test with? Could you send me your xml file and FB project and I’ll see if your test case works here.