Can I use Xpath node set function position() in Delphi's function selectNodes() to select only a certain number of element from a node list? If I do like this:
selectNodes('Item[1]')
its all fine and I get the element with index 1, but when I try
selectNodes('Item[position()<10]')
I get exception 'unknown method', when I try
selectNodes('Item[<10]')
I get 'unexpected token <'.
Im using delphi7 and I also imported new type library into my project with newer versions of msxml.
This is not really a Delphi question I think, but an MSXML one. Check the MSXML docs or rather the MS XPath docs.
Hmm, according to the XPath examples posted on MSDN "Item[position() < 10]" should have worked, at least if "Item" is the name of the element you're after...
selectNodes requires a string, so you should try:
selectNodes('Item[position()<10]')
Or whatever xpath query.
Could it be a version-issue? I have imported typelibrary from MS XML 6, and gets no error.
Related
I'm trying to create a Sitelet with SiteletBuilder in C#:
return WebSharper.Sitelets.Content.Page(...)
However, the class Websharper.Sitelet contains Content both as Struct and Class.
So, this does not compile.
Versions of Zafir-Libraries are
Zafir 4.0.152.29-beta5
Zafir.CSharp 4.0.152.29-beta5
Zafir.Html 4.0.56.95-beta5
Zafir.UI.Next 4.0.102.33-beta5
How to reference WebSharper.Sitelets.Content proberly?
Or is this indeed a bug?
Thanks for the report, created ticket: https://github.com/intellifactory/websharper/issues/645
I have been testing with having using WebSharper.Sitelets; and then using with shorter form Content.Page(...). C# can resolve this for some reason, although the name conflict indeed exists in WebSharper.Sitelets.dll
I'm using this code to loop columns of a SharePoint 2013 List.
currentContext.Load(currentList.Fields);
currentContext.ExecuteQuery();
foreach (Field f in currentList.Fields) {
}
No problem with normal columns. But, when I arrive to a lookup column I have this error:
"Unable to cast object of type
'System.Collections.Generic.Dictionary`2[System.String,System.Object]'
to type 'Microsoft.SharePoint.Client.Field'."
I found for example this discussion
This issue came when we were working with TaxonomyFieldValue fields. For us changing references was not an option. This helped:
TaxonomyItem dummy = new TaxonomyItem(web.Context, null);
It will force program to load adequate libraries forcing correct type in runtime.
I had this same issue and updating the references fixed it for me. This question helped me figure it out.
I went from version 14 of "Microsoft.SharePoint.Client" and "Microsoft.SharePoint.Client.Runtime" to version 16 and no longer had the error.
Latest client download
I googled around and found a way to set the mouse cursor position in Delphi.
Here is my code example:
SetCursorPos(100,100);
It's simple, but not working. Delphi gives me the error
"statement expected,but expression of type 'longbool' found"
I am getting the same error with this command:
PostMessage(wb1.Handle,WM_KEYDOWN, VK_RIGHT,0);
where wb1 is my TWebBrowser component.
Any ideas?
You have probably disabled a feature called "Extended syntax", which (among other things) allows you to use function calls like procedure calls. You can re-enable this feature in the project's options dialog.
Good day! I'm working with Delphi 2009 and MSXML2_TLB library (IXMLDOM). I need to select the last Meeting node:
Doc := CreateOleObject('Microsoft.XMLDOM') as IXMLDomDocument;
Doc.loadXML(XmlStr);
tmpNode:= Doc.selectSingleNode('//Meeting[last()]');
But on the last line of the code above I get exception:
Project test.exe raised exception class EOleException with message: 'Unknown method
//Meeting[-->last()<--]'
Is there a way how to select the last node using xpath or do I really have to write code to get node list and then select the last element?
Yet a version info:
Type Lib: C:\WINDOWS\system32\msxml6.dll (1)
LIBID: {F5078F18-C551-11D3-89B9-0000F81FE221}
HelpString: Microsoft XML, v6.0
Thank you in advance! Vojtech
This is because you are using a version of msxml where the last function is not defined, as far I know this function was introduced in the v 4.0 of MSXML
try
Doc := CreateOleObject('Msxml2.DOMDocument.6.0') as IXMLDomDocument;
I've been working on a compiler for a while but after changing to PowerPack 1.9.9.9 and the release version of VS2010 I'm no unable to compile the following line:
let lexbuf = Lexing.from_string text
I get the following two error:
"The value, constructor, namespace or type 'from_string' is not defined" pretty obviopus what it's trying to tell me but what's the resolution?
My quick guess is that this function has been renamed to fromString (because, in general, functions with underscores such as of_seq are now written in camelCase).
Lexing.LexBuffer<_>.FromString ?