Discussion:
Xpath Tokenize function
(too old to reply)
Dave F.
2005-09-07 12:29:28 UTC
Permalink
Hi

I'm trying to use the Xpath function Tokenize in a VBA subroutine.

I've no idea what the syntax is.
Is it part of the selectNodes command like similar functions such as
contain?
Or is it on it's own similar to what I've done below, but is incorrect?

Thanks for any help

Dave F.

Set MsDom = CreateObject("MSXML.DOMDocument")
MsDom.Load ("c:\dwgs\fx2005\steelx.xml")
MsDom.async = False
MsDom.setProperty "SelectionLanguage", "XPath"
Set zxc = MsDom.selectNodes("//uc[1]")
Str = zxc(0).Text
Str = [tokenize(Str, ", ")]
Martin Honnen
2005-09-07 12:42:37 UTC
Permalink
Post by Dave F.
I'm trying to use the Xpath function Tokenize in a VBA subroutine.
XPath 1.0 does not define a function named "Tokenize" or "tokenize".
And MSXML 3/4 do not implement any extension function of that name either.

So it is not clear at all what function you want to use respectively why
you think such a function exists in XPath 1.0.

The docs to the XPath functions in MSXML are here:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/b5c850f1-077d-4200-81eb-f723436d65ae.asp>
Tokenize sounds as if you want to manipulate strings so you need to have
a look at the string functions:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/ad13c6b4-52d9-4d6c-b3d0-55665c383240.asp>
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Dave F.
2005-09-07 13:39:19 UTC
Permalink
Thanks for replying so promptly.

Excuse my confusion. I'm new to this

I'm references MSXML 4. Doesn't that implement Xpath 2.0?

Looking Again I notice the Xpath 2 is Working Draft.

http://www.w3.org/TR/xpath-functions/#func-tokenize

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

Is Xpath 2 implemented by anyone?
Post by Martin Honnen
Post by Dave F.
I'm trying to use the Xpath function Tokenize in a VBA subroutine.
XPath 1.0 does not define a function named "Tokenize" or "tokenize".
And MSXML 3/4 do not implement any extension function of that name either.
So it is not clear at all what function you want to use respectively why
you think such a function exists in XPath 1.0.
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/htm
l/b5c850f1-077d-4200-81eb-f723436d65ae.asp>
Post by Martin Honnen
Tokenize sounds as if you want to manipulate strings so you need to have
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/htm
l/ad13c6b4-52d9-4d6c-b3d0-55665c383240.asp>
Post by Martin Honnen
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Martin Honnen
2005-09-07 15:44:04 UTC
Permalink
Post by Dave F.
I'm references MSXML 4. Doesn't that implement Xpath 2.0?
No, not at all. MSXML 3, 4, 5 all implement XPath 1.0 and some extension
functions Microsoft has added.
Post by Dave F.
Looking Again I notice the Xpath 2 is Working Draft.
http://www.w3.org/TR/xpath-functions/#func-tokenize
Is Xpath 2 implemented by anyone?
There is no Microsoft product that implements XPath 2.0.

Others are however trying to implement XSLT 2.0 and XPath 2.0 while
those specs are being developed, one such product is Saxon:
<http://www.saxonica.com/>
That is a Java implementation however. There is also an attempt to port
that to the Microsoft .NET framework:
<http://sourceforge.net/projects/saxondotnet/>

Some of the XML editor products around also claim XPath 2.0 support:
<http://www.altova.com/dev_portal_xpath.html>
<http://www.stylusstudio.com/xpath.html>
Google for more if needed.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Loading...