Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SelectSingleNode and Case insensitive
Message
From
28/04/2006 09:19:45
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Title:
SelectSingleNode and Case insensitive
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01117475
Message ID:
01117475
Views:
260
Hi,
The little problem.. may I make Case insensitive call to return XML node....
example:
loXMLNodeList = loXMLDocument.selectNodes("ArrayOfMaterial/Material")
loXMLLineNode = loXMLNode.selectSingleNode("MaterialNumber") && retunrns correct object
loXMLLineNode = loXMLNode.selectSingleNode("MATERIALNUMBER") && returns .NULL.


My problem source is :
I have cursor. and fieldname of cursor has same name as XML node name.. well.. I try to write simple code like here
	Afields(laFlds,lcCursorName)
	lcXML = Filetostr(tcFilename)
	loXMLDocument  = Createobject("MSXML2.DomDocument")
	Try
		loXMLDocument.LoadXML(lcXML)

		loXMLNodeList = loXMLDocument.selectNodes("ArrayOfMaterial/Material")
		lnLength = loXMLNodeList.Length

		For Lni=0 To lnLength-1
			loXMLNode = loXMLNodeList.Item(Lni)
			Select(lcCursorName)
			Append Blank
			For lnj=1 To Alen(laFlds,1)
				lcFieldName = laFlds[lnj,1]
				lcFieldType	= laFlds[lnj,2]
				loXMLLineNode = loXMLNode.selectSingleNode(lcFieldName)
				If Type("loXMLLineNode")="O" And !Isnull(loXMLLineNode)
					leValue = .Null.
					Do Case
					Case Inlist(lcFieldType,"C","M")
						leValue = Alltrim(loXMLLineNode.Text)
					Case lcFieldType="N"
						leValue = Val(loXMLLineNode.Text)
					Case lcFieldType="T"
						leValue = Ctot(Strtran(loXMLLineNode.Text,"+","-"))
					Endcase
					If !Isnull(leValue)
						Replace &lcCursorName..&lcFieldName With leValue
					Endif
				Endif
			Endfor
Ok. the AFIELDS returns fieldname as upper character set... and of course selectSingleNode returns .null.
Any ideas?

Thanks
Denis
Next
Reply
Map
View

Click here to load this message in the networking platform