How to read xml to array using javascript

I'm new with XML. Please give me some advice.
I wonder there are any difference between XML that is automatically generated
from ADO and XML file that shows in many textbooks. I found that the formats
are a bit difference. At the begining of the one that is automatically
generated from ADO is usually like this

<xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:
C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:rs="urn:schemas-microsoft-com:
rowset" xmlns:z="#RowsetSchema">
- <s:Schema id="RowsetSchema">
- <s:ElementType name="row" content="eltOnly" rs:updatable="true">


On the other hand, the format that I found from many books and web like this 

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="test01.xsl"?>
<persons>
<person id="1">
<name>
	<prefix>Mr.</prefix>
	<fname>Tawan</fname>
	<lname>Lakthai</lname>
</name>
<gender>Male</gender>
<birth-date> 1 January 2551 </birth-date>
<person-id>2471235896341</person-id>
<address>138/42 nakbumrung bangkok 10230</address>
</person>

The later format is easy for me to understand, but the other one is harder.
My point is whether the way to read data from XML file in both types is
different. If yes, what class in java should I use to get data from file.I
understand how to use DOM to read data and write a script using DOM once with
the second format. But the XML file in this assignment is in the first fomat,
so I''m in the dark with it. I have little knowledge about XML and javascript.
I''ve start reseraching for 3 days. 
This is my XML file

<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
	xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
	xmlns:rs='urn:schemas-microsoft-com:rowset'
	xmlns:z='#RowsetSchema'>
<s:Schema id='RowsetSchema'>
<s:ElementType name='row' content='eltOnly' rs:updatable='true'>
     <s:AttributeType name='StratgID' rs:number='1' rs:nullable='true' rs:
maydefer='true' rs:writeunknown='true'
           rs:basetable='Strategy' rs:basecolumn='StratgID' rs:
keycolumn='true'>
           <s:datatype dt:type='int' dt:maxLength='4' rs:precision='10' rs:
fixedlength='true'/>
     </s:AttributeType>
     <s:AttributeType name='PerspID' rs:number='2' rs:nullable='true' rs:
maydefer='true' rs:writeunknown='true'
          rs:basetable='Strategy' rs:basecolumn='PerspID'>
         <s:datatype dt:type='int' dt:maxLength='4' rs:precision='10' rs:
fixedlength='true'/>
     </s:AttributeType>
     <s:AttributeType name='StratgName' rs:number='3' rs:nullable='true' rs:
maydefer='true'   
         rs:writeunknown='true' rs:basetable='Strategy' rs:
basecolumn='StratgName'>
         <s:datatype dt:type='string' dt:maxLength='50'/>
     </s:AttributeType>
     <s:AttributeType name='RightOrder' rs:number='4' rs:nullable='true' rs:
maydefer='true' 
           rs:writeunknown='true' rs:basetable='Strategy' rs:
basecolumn='RightOrder'>
           <s:datatype dt:type='string' dt:maxLength='50'/>
     </s:AttributeType>
     <s:AttributeType name='BottomOrder' rs:number='5' rs:nullable='true' rs:
maydefer='true' 
           rs:writeunknown='true' rs:basetable='Strategy' rs:
basecolumn='BottomOrder'>
           <s:datatype dt:type='string' dt:maxLength='50'/>
     </s:AttributeType>
     <s:AttributeType name='BubbleHeader' rs:number='6' rs:nullable='true' rs:
maydefer='true'  
           rs:writeunknown='true' rs:basetable='Strategy' rs:
basecolumn='BubbleHeader'>
           <s:datatype dt:type='string' dt:maxLength='50'/>
     </s:AttributeType>
     <s:AttributeType name='bgColor' rs:number='7' rs:nullable='true' rs:
maydefer='true' rs:writeunknown='true'
           rs:basetable='Strategy' rs:basecolumn='bgColor'>
           <s:datatype dt:type='string' dt:maxLength='50'/>
     </s:AttributeType>
     <s:AttributeType name='fgColor' rs:number='8' rs:nullable='true' rs:
maydefer='true' rs:writeunknown='true'
           rs:basetable='Strategy' rs:basecolumn='fgColor'>
     <s:datatype dt:type='string' dt:maxLength='50'/>
     </s:AttributeType>
     <s:AttributeType name='URL' rs:number='9' rs:nullable='true' rs:
maydefer='true' rs:writeunknown='true' 
           rs:basetable='Strategy' rs:basecolumn='URL'>
           <s:datatype dt:type='string' dt:maxLength='50'/>
     </s:AttributeType>
     <s:extends type='rs:rowbase'/>
</s:ElementType>
</s:Schema>
<rs:data>
	<z:row StratgID='0' PerspID='0' StratgName='Organization Change Management'
RightOrder='0' BottomOrder='0' BubbleHeader='Organization Capital'/>
	<z:row StratgID='1' PerspID='0' StratgName='Corporate Restructuring'
RightOrder='1' BottomOrder='0'/>
	<z:row StratgID='2' PerspID='0' StratgName='HR Development' RightOrder='2'
BottomOrder='0' BubbleHeader='Human Capital'/>
	<z:row StratgID='3' PerspID='0' StratgName='Business Intelligent System'
RightOrder='3' BottomOrder='0' BubbleHeader='nation Cappital'/>
	<z:row StratgID='4' PerspID='0' StratgName='IT System' RightOrder='4'
BottomOrder='0'/>
	<z:row StratgID='5' PerspID='1' StratgName='Service &#x26; Quality
Management' RightOrder='0' BottomOrder='0' BubbleHeader='Operation
Manament'/>
</rs:data>
</xml>

0
rascal_mon
8/1/2006 7:07:09 AM
dotnet.xml 7266 articles. 0 followers. Follow

0 Replies
392 Views

Similar Articles

[PageSpeed] 55

Reply:

Similar Artilces:

WMP 11 uses 700+MB of memory (vista)
WMP 11 uses over 700MB of memory when I try to start it (memory usage from the task manager). I either have to end the task or restart my computer because it locks everything up. Not sure how I can uninstall/reinstall WMP11 since Microsoft isn't making it easy for me. Anyone know how I can fix this problem, thanks. How many songs are there in your library? If you rebuild the library, by following the instructions at http://zachd.com/pss/pss.html#medialibrary for WMP 11 on Vista, does that help? Note that rebuilding the library will make you lose all play counts, and possibl...

help on adding a commandbar using VB com addin
Adding Commandbar to the New Mail message Inspector Window I was trying to add a new tool bar and also customize my new toolbar t automatically contain some commands programmatically. I wanna write COM add-in to OutLook that adds a new toolbar to the OutLook' Toolbar. This tool bar should apear only in new mail window. There are two commands(buttons) by name "Digitally sign Message" an "Encrypt Message Contents and Attachments". These are present in the Tools -> Customize -> Commands -> I categories select Standard -> on the Right side, if you scroll do...

Using two types of numbering systems in one document
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel Hello, <br> I'm writing a dissertation and must follow very strict guidelines. First, I need to be able to start the numbering (roman numeral) on page iv, not showing any page numbers before that. Second - after about 15 pages I need to switch to arabic numerals. This is all in one document and I have no idea how to do this. Any help would be appreciated! <br> Thanks, <br> Michal Hi Michal, See: http://word.mvps.org/faqs/Formatting/NumberingFrontMatter.htm -- Cheers macropod [Micr...

Prefer how Outlook 2000 looked-now using 2003-Can I switch views?
I don't like the way Outlook 2003 displays and would prefer to go back to the 2000 display. Is this possible. Kinda, http://www.slipstick.com/emo/2003/up031029.htm#classicview might be helpful. "Manhart" <Manhart@discussions.microsoft.com> wrote in message news:A4549A3C-4B06-4AEC-8ADA-DD154CC7795B@microsoft.com... >I don't like the way Outlook 2003 displays and would prefer to go back to >the > 2000 display. Is this possible. Outlook 2003 is highly customizeable - tell us what you want to change, and we'll tell you how to achieve it. There is ...

Adding variables to a static text control (displaying contents of array)
Hello, I was wondering if the following was possible ? I have a static text control in a dialog application. I also have an array which contains about 5 items. I would like the text control to display the contents of this array and then have a button which would move to next position into the array and thus the static text control would display something different ? How could achieve this? I'm using Visual Studio 6.0 and I'm quite new to MFC Many Thanks. >I have a static text control in a dialog application. I also have an >array which contains about 5 items. I would lik...

selecting rows using a variable
I am using excel 2003 and I need to select rows using a variable. Here is what I have now: Dim name As String name = Range("e800") ActiveWorkbook.Sheets("individual stats").Range("a1:a1540").Select Selection.EntireRow.Hidden = True Dim Start As Integer Dim finish As Integer Start = Application.WorksheetFunction.Lookup(name, Range("Q800:Q881"), Range("t800:t881")) finish = Application.WorksheetFunction.Lookup(name, Range("Q800:Q881"), Range("u800:u881")) ActiveWorkbook.Sheets("individual stats&q...

Find the depth of XML
I have following XML: How can I find the depth of XML? in other word max level of the XML <Root> ----- level 0 <Name>----- level 1 <FirstName>name</FirstName> ---- level 2 <LasName>lname</LastName> <MiddleName>mName<MiddleName> </Name> <Information> <Info1> <Info2> --- level 3 <Info3>asdasd</Info> -- level 4 </Info2> </Info1> </Information> </Root> Raed Sawalha wrote: > I have following XML:...

Receiving XML Documents
Hi, I'm setting up a service that receives a XML document, validates the document using a schema and then returns a simple result. I wanted to ask what the best way is of doing this, that is sending the xml document. So far I've come across 2 way's: 1. Create a webservice that accepts a XMLNode. 2. Use HttpWebRequest to send the document as a stream. The service would be written in .NET but the clients can be written in any programing language. Thanks, EG elguapo, Since interoperability is important in your case (your #2 requirement), it is not suggested that you send any d...

i am using trial version of outlook but it wont allow me to reply
i am using atrial version of outlook but when i try to reply to the email it wont let me, the reply word is not lit in the tool bar? Has your trial expired? Did you activate it? -- Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. ALWAYS post your Outlook version. How to ask a question: http://support.microsoft.com/KB/555375 After furious head scratching, terry mansfield asked: | i am using atrial version of outlook but when i try to reply to the | email it wont let me, the reply word is not lit in the tool bar? terry mans...

Using mixed Resource Types
With the company we have implemented EPM and infrequently the large complex plans fail to 'publish' into PWA. One of the causes thought is that these plans have both cost and work type resources within the same task. Is it good practice to separate these resource types into different tasks? -- joooles Hello joooles, It seems it's a bad pratice. Please see the posts I noticed several month ago: G�rard Ducouret ------------------------------------ If we assign a Cost resource to a task (as the only one resource on that task) and then we enter some % Complete,...

Linking using ranges?
I have a chart of data on one excel worksheet (and this chart has a constant number of columns, but the number of rows vary). I need to take all of the data on this chart (not all of the data on that worksheet) and put it in to the middle of another worksheet. I was wondering if there was a way to do this without using a macro. My thought was to try to create a range on each sheet and set one range equal to another, but apparently excel doesn't allow this (at least in version 2000, which I am using). Does anyone have any thoughts or ideas? If this isn't possible how woul...

How do you use the Livescribe smartpen with MS Office products?
I just received a Pulse Smartpen as a gift and I love it. I am curious about how other users of Office products utilize their smartpen features with Office ...

new excell will not read old excell file
I have just installed office home and student into a new computer but when try to run one of my existing file it tells me it is corrupt. It runs fine in the old computer. please help What versions of Excel are involved? XL2007 can read and write both the new formats (xlsm, xlsx, xlsb) and the old format (xls). Unless you have the Office Compatibility Pack (http://support.microsoft.com/kb/924074/en-us) installed, XL2003 can read only xls files -- it cannot read the new file versions. Since 2003 has no knowlege of the new formats, it assume the file is corrupted. Of course, a file...

Compacting
Windows XP Media Centre edition fully updated Compacting Outlook Express Before Compacting click on Local Folders Then Menu > File > Folder > Compact All Folders. Runs fine to Folders File then Warning/Error ?? Folders Fuile in use by Outlook Express or another application. Tried reboot then compact again before any other app sused problem persists. Any offers of help please -- Jim Bunton Is Fuile a user created folder or a typo? What is its size? Create a new folder. Move all the contents of the Fuile folder to it and delete the old one. If it is more ...

exchange 2003 mailbox can't read new mail
Hi all I have a problame - My Exchange 2003 sp2 hase started to get mail but i can't see the mail , Ihave chacked the mailbox DB' IT IS OK, I did disasterrecovery, but the problam is the same, i can see old mail but not the new mails ? What can it be ? ???? <@discussions.microsoft.com> wrote: > Hi all > I have a problame - My Exchange 2003 sp2 hase started to get mail but > i can't see the mail , Ihave chacked the mailbox DB' IT IS OK, I did > disasterrecovery, but the problam is the same, i can see old mail but > not the new mails ? > What can it be...

I open 2007 file, it opens as .ppt (2003) read only
When I open up my 2007 files .pptx by double-clicking on it, it opens as a ..ppt (Read Only) (Compatibility Mode). I then have to do a "save as" 2007 file. However, when I open it by doing file-open - it opens as a 2007 file. Does anyone know why yhis happens and if there is a preference I can set to have them open as 2007 files when I double-click on it? Thanks in advance! -- Marc One solution would be right clicking the file and selecting properties and going to the " General" tab and changing the program it uses to open as a default(i am not aware...

how can i format a date that uses "1st" or "2nd" or "3rd" or 4th".
how can i format a date that uses "1st" or "2nd" or "3rd" or 4th"... i am working on a program that generates certificates. i want to use dates such as "3rd of April 2010". when i run my program the words that appears onthe screen was 3-Apr-10. can you help me solve this problem? On Mon, 5 Apr 2010 20:47:01 -0700, cristin wrote: > how can i format a date that uses "1st" or "2nd" or "3rd" or 4th"... i am > working on a program that generates certificates. i want to use dates such > as &q...

Ho do you used Shared Calendar in Outlook with Roadrunner ISP
Hi all, I understand from my ISP that roadrunner is a POP3 server which should allow me to use my Outlook shared calendar with others in the office. However I am unable to use this Outlook feature. Does anyone know how to get around this problem? Many thanks. Kat "Kat" <designme21@yahoo.com> wrote in message news:epq238I0IHA.4004@TK2MSFTNGP03.phx.gbl... > Hi all, > > I understand from my ISP that roadrunner is a POP3 server which should > allow me to use my Outlook shared calendar with others in the office. > However I am unable to use this Outlook feat...

Write-Output of XML value has type format like "System.Xml.X..."
Hi, I want to output some value using Write-Output or Write-Host along with some comments. After reading the xml file and while executing the write-output command, its not printing the value, its printing the variable type along with xml structure not the value :( Please let me know how to print the correct output. See below the example for details. --------------------------------------------------------------------------------------------------------------------------- Variable.xml ------------------------------------------------------------------------------------...

VB to XML?
I have an Access db app that I made, I want to put in a webpage, how do I go about this, do I use XML .NET ASP? The more detailed information the better. I am clueless. thanks. ...

Using Min to Calculate across a table
I am attempting to massage data so I can see what the maximum number of pieces I can produce based off of various components. My query to figure out how many of each component is available per unit is complete and the output is: Part_Number, MaxComponent1, MaxComponent2,MaxComponent3, MaxComponent4 Does anyone have any suggestions as to how I could find the MIN of the components and group by part number? Cheers See the MinOfList() function here: http://allenbrowne.com/func-09.html A better solution would be to create a related table with many records for the combinations that are va...

Attn Jim Gordon: Requesting assistance with exporting OE 4.5 contacts for use in Entourage
Hi Jim, Paul Berkowitz suggested you might be willing to assist me with a dilemma. I have some old mail and contacts in an OE User(s) folder from OE 4.5 that I need to import into Entourage X. I am on a machine that is not OS9-bootable and I cannot get OE 4.5 to launch under Classic mode in Panther. OE 5 loads fine in Classic, but 4.5 gives a shared library error. I don't have an OE 4.5 installer anywhere I can find, so I can't try a reinstall under Classic. I finally found a way to get the mail into Entourage, after much trial and error with every email program I could find, since ...

XML with chinese character problem
In my .net ,i need to generate an xml file , however, user may input a chinese character, Then , the xml will got something unknow characters. the following is my code, Does anyone know how to solve it ?? Private Sub Init() With AMSXML ..Formatting = Formatting.Indented ..Indentation = 4 ..IndentChar = " " ..WriteStartDocument() ..WriteDocType("SOGenericInterchange", Nothing, "SOGenericInterchange.dtd", Nothing) ..WriteStartElement("SOGenericInterchange") End With End Sub Private Sub InterchangeHeaderIdentification() Try With AMSXML ..WriteStartElemen...

XML samples for replace a child element
Hi, Does anybody know where I can find samples to search an element in a subtree of an xml file and replace some new value for this element? I can only find some samples to use 'replace last child or replade first child' but couldn't find sample for replace a child neither first nor last child. Thanks for any help, CT See http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemXmlXmlNodeClassReplaceChildTopic.asp Rather than specifying root.FirstChild or root.LastChild, you only need to select a particular node. Supposing you have the root node of the dom document (r...

Signed-signed xml-doc and xsd
Hi, I�m a bit of a newbie when it comes to xml but here goes: I am using the SignedXml-class to construct a signed xmldoc which in turn contains 1 or more signed xml-doc which creates the following structure (edited of course): <Signature xmlns:xd="Whatever"> <Object Id="A uri"> <Signature> <Object Id="Another uri">My data</Object> </Signature> </Object> </Signature> My problem occurrs when try to use xsd.exe to create a schema for this. I get the fol...