I'm having an unknown method error, please advise.
Main Topics
Browse All TopicsBy using xpath, i can retrieve first MarkTemplate's ObjectText with MarkObjectType='TEXT' using this syntax :
var MatchingNodes=theRoot.sele
What is the syntax if I want to select all nodes of first MarkTemplate with node name begin with "Image" which select "ImageId1","ImageId2","Ima
This is my xml :
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfMarkTemplate>
<MarkTemplate>
<MarkType>MARKTYPE001</Mar
<ImageId1>854</ImageId1>
<ImageId2>999</ImageId2>
<ImageId3>394</ImageId3>
<MarkingObjects>
<MarkObject>
<MarkObjectType>TEXT</Mark
<ObjectText>TEXT001</Objec
<MarkMethod></MarkMethod>
<MarkInfo>Info</MarkInfo>
</MarkObject>
<MarkObject>
<MarkObjectType>TEXT</Mark
<ObjectText>TEXT002</Objec
<MarkInfo>Info</MarkInfo>
</MarkObject>
<MarkObject>
<MarkObjectType>TEXT</Mark
<ObjectText>TEXT003</Objec
<MarkInfo>Info001</MarkInf
</MarkObject>
<MarkObject>
<MarkObjectType>GRAPHIC</M
<ObjectText>GRAPHIC001</Ob
<MarkInfo>Info004</MarkInf
</MarkObject>
</MarkingObjects>
</MarkTemplate>
<MarkTemplate>
......
</MarkTemplate>
</ArrayOfMarkTemplate>
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
sherly,
you have to use a more modern version of the msxml parser
you are likely using msxml3, but in version1 mode, not in version2 mode
you should definitely use the parser in version 2 mode
but it is even better to upgrade to msxml4 (download from microsoft web, it leaves the msxml3 in place, so nothing breaks)
microsoft was too late supporting some of the XPath functions in their parser
Can you show me the line where you create theRoot
(the thing with MSXML.DOM or whatever)
I will then send you an alternative
In the mean time you can test this
var MatchingNodes=theRoot.sele
cheers
Geert
Hi, I'm very new in XML. These are the only 2 lines which I declared theRoot. My xml data is on the html itself, the <xml id="xmldata"></xml> of the portion. I'm using IE6 and I don't know which version of MSXML I'm using. Please guide me in the proper way to declare the DOM. I'm increasing question point to 300. Thanks for your help.
// initialize objects
this.xmldoc = document.getElementById("x
//Get the root
var theRoot = this.xmldoc.documentElemen
sherly,
mmh, I am not sure this kind of IE internal processing allows for the proper selection of the parser
IE6 comes with msxml3
I found two little bugs in the XPath
the 0 should be 1 ofcourse
and Image has only 5 characters instead of 6 :-)
This one works perfectly for me
var MatchingNodes=theRoot.sele
sherly,
well, it seems you also don't have access to the substring() function
I see two options for you here
1. fully express all the names
var MatchingNodes=theRoot.sele
2. make the XML external to the HTML
and call it in, with the proper document object creator,
if that is acceptable for you
var oXML = new ActiveXObject("Msxml2.DOMD
oXML.async = false;
oXML.resolveExternals = false;
oXML.load("yourFile.xml");
var MatchingNodes=oXML.selectN
If you don't install msxml4,
this could work as well
var oXML = new ActiveXObject("Msxml2.DOMD
you would then use msxml3 in version2 mode
cheers
Geert
Business Accounts
Answer for Membership
by: GertonePosted on 2006-11-11 at 05:06:39ID: 17921065
Hi sherly,
ctNodes("/ /MarkTempl ate[0]/*[s tarts-with (name(), 'Image')]")
you can use starts-with() on the name()
var MatchingNodes=theRoot.sele
Cheers!