Click to See Complete Forum and Search --> : xml and child nodes


pelegk1
06-30-2003, 03:28 AM
i have an asp page which recives and xml page!
how can where i recive and xml to know that <tag> name?
i know how to read it's length
xmldoc.childNodes(0).childNodes.length
so how do i read it's tag name?
thanks in advance
Peleg

Khalid Ali
06-30-2003, 11:28 AM
nodeName
will give you the name of the node/element

pelegk1
07-01-2003, 12:16 AM
#text
and that not my node name 9maybe nide type???)

Khalid Ali
07-01-2003, 12:49 AM
seems like you are doing something wrong..can you post the code that you are using this for like piece of XML code

pelegk1
07-01-2003, 03:22 AM
<ROOT>xsi:type="ns2:DRSpecDataCollection"<errorMesage xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xsi:type="xsd:string"></errorMesage><DRSpecDataCount xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xsi:type="xsd:string" xsi:null="true"/><DRSpecDataArray xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xsi:type="ns3:Array" ns3:arrayType="ns2:DRSpecData[14]" xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/">
<item xsi:type="ns2:DRSpecData">
<houseNo xsi:type="xsd:string"> 14</houseNo>
<parking xsi:type="xsd:string"></parking>
<cityName xsi:type="xsd:string"> ירושלים</cityName>
<DRType xsi:type="xsd:string"></DRType>
<disabledAccess xsi:type="xsd:string"></disabledAccess>
<fax xsi:type="xsd:string"> 02-5677688</fax>
<regionName xsi:type="xsd:string"> ירושלים</regionName>
<FName xsi:type="xsd:string"> עמוס</FName>
<plcType xsi:type="xsd:string">פ</plcType>
<licID xsi:type="xsd:string">13072</licID>
<specialization xsi:type="xsd:string"> אף אוזן גרון</specialization>
<plcName xsi:type="xsd:string"> סניף מסילת ישרים</plcName>
<streetName xsi:type="xsd:string"> מסילת ישרים</streetName>
<plcNo xsi:type="xsd:string">0017</plcNo>
<zip xsi:type="xsd:string"></zip>
<phone2 xsi:type="xsd:string"></phone2>
<phone1 xsi:type="xsd:string"> 02-5677677</phone1>
<LName xsi:type="xsd:string"> אילון</LName>
</item>

Khalid Ali
07-01-2003, 09:25 AM
I see allots of errors in the xml.
Here I have this generic node name node value reader script..

http://68.145.35.86/skills/javascripts/xmlstuff/XMLReadElementNamesAndValues.html

pelegk1
07-01-2003, 10:08 AM
beacuse if u open the xml in a browser u see that everything is ok
more then that if there was an error xsl won't work with it
i am attaaching here an xml example like the code i have opsted in my last message
thanks
peleg
(just rename the file from *.txt to *.xml)

pelegk1
07-01-2003, 10:11 AM
maybe i have the problem beacuse in asp its diffrent then in javascript?

Khalid Ali
07-01-2003, 02:04 PM
Hey I just noticed you are in israel..I hope this is correct way of greeting

Mashlam Kha..:D

Please correct me if the greeting is wrong..

And for your question.I am not sure how MS works,I am hopping it follows standard DOM

Khalid Ali
07-01-2003, 02:36 PM
I have fixed the IE crap and the link below works as it should..njoy..

http://68.145.35.86/temp/pelegk1/XMLReadElementNamesAndValues.html

pelegk1
07-02-2003, 12:43 AM
yes its correct to say ma shlomcha:)
and from where are u?
and what was the mistake in my xml(and if there was 1 why do isee it corect when i open te browser?)

Khalid Ali
07-02-2003, 10:19 AM
Compare code behind the both links I posted and you will see the difference,
basically,it wasn't much of IE I just had to redo the way I get the information out of XML..:D

pelegk1
07-03-2003, 01:07 AM
from your name i understand your family originlly not from canada

Khalid Ali
07-03-2003, 09:06 AM
:D
Thats true,

Originally from Pakistan...I had a brief friendship with some people from Israel several years ago....then they moved back to israel..I actually knew more words then only "ma shlomcha"
but I guess I only remember this now..

pelegk1
07-06-2003, 01:07 AM
here is a new word for u :
"ata totach"
(ata=you
totach=canon)
but it means your the man!:)