Solved

XML Data Binding

Posted on 2001-07-18
8
844 Views
Last Modified: 2008-03-04
Friends,

I am using a multi level XML, & using IE5 or above browser, please tell me how to bind text boxes (input boxes) with them, for example

my XML is :-
<XML id=objXML>
  <first>
    <second>
      <third1>value1</third1>
      <third2>value1</third2>
      <third3>value1</third3>
    </second>
  </first>
</XML>

my HTML is :-
<input type=text datasrc=#objXML datafld= ?????? >

please help me, my email id is vijayneema@hotmail.com

Thanks
Vijay
0
Comment
Question by:vijayneema
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 10

Expert Comment

by:Yury_Delendik
ID: 6297462
<input type=text datasrc=#objXML datafld=third1 >

0
 
LVL 1

Author Comment

by:vijayneema
ID: 6297470
Yury Delendik

It will not work if the xml is like this, as i said earlier
my xml is multi level


<XML id=objXML>
<root>
 <first>
   <second>
     <third1>value1</third1>
     <third2>value1</third2>
     <third3>value1</third3>
   </second>
 </first>
</root>
</XML>

0
 
LVL 1

Expert Comment

by:hariweb
ID: 6297945
Hi,

I think Yury is right.  Just save everything as a HTML file like given below.


<html>
<body>
<form>
<XML id=objXML>
 <first>
   <second>
     <third1>value1</third1>
     <third2>value2</third2>
     <third3>value3</third3>
   </second>
 </first>
</XML>


<input type=text datasrc=#objXML datafld= third1 >
</form>
</body>
</html>



Alternatively..u can do this.....give this alone in say xyz.xml

<first>
   <second>
     <third1>value1</third1>
     <third2>value2</third2>
     <third3>value3</third3>
   </second>
 </first>


then create a html file with the following code....
<html>
<body>
<form>
<xml id="objXML" src="xyz.xml"></xml>
<input type=text datasrc=#objXML datafld= third1 >
</form>
</body>
</html>

try it..-:)
Hari


0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:vijayneema
ID: 6298007
Dear Hari,

Problem is that my XML is multi level
<XML id="objXML">
<first>
    <second>
        <third>
             <fourth>
                 <fifth1>v1<fifth1>
                 <fifth2>v2<fifth2>
                 <fifth3>v3<fifth3>
             </fourth>
        </third>
    </second>
</first>
</XML>

<input type=text datasrc=#objXML datafld=fifth1 >

now my input box does not binds.

Please if you want in detail contact me as
vijayneema@hotmail.com

bye
Vijay
0
 
LVL 1

Expert Comment

by:sethu_m
ID: 6303069
Hello,

U can have a solution like this - If ur XML is of somewhat like this structure

<XML id="objXML">
<first>
   <second>
       <third>
            <fourth>
                <fifth1>sethu madhavan</fifth1>
            </fourth>
            <fourth>
                <fifth1>mahesh pudale</fifth1>
            </fourth>

       </third>
   </second>
</first>
</XML>

then put ur html like this

<table datasrc=#objXML datafld="third">
 <tr>
   <td>
     <table datasrc=#objXML datafld="fourth">
     <tr>
       <td>
          <input datafld="fifth1">    
       </td>
     </tr>
     </table>
   </td>
  </tr>
</table>

U will have to put all ur top elements in a table with datasrc same and datafld changing with each level of depth.

U can arrive at any depth with this kind of approach.

I hope this will work for u.

0
 
LVL 1

Author Comment

by:vijayneema
ID: 6307631
Thanks sethu_m

but it is working with Table only
not with Input box, if give me solution
for Input, Select Boxes

Vijay
0
 
LVL 1

Accepted Solution

by:
sethu_m earned 50 total points
ID: 6308581
Hello Vijay,

You can not populate the select boxes/list boxes, but ofcourse u can populate the input boxes.

But again for that u will have to create a hirearchy of some container like Tables or Div. - As I have mentioned earlier.

try div - if u don't want tables
0
 
LVL 1

Author Comment

by:vijayneema
ID: 6311206
Thanks sethu madhavan

It is working. thanks a lot once again
Please be in touch with me, if you have
any more ideas. my email id is
vijayneema@hotmail.com

Vijay
0

Featured Post

Guide to Performance: Optimization & Monitoring

Nowadays, monitoring is a mixture of tools, systems, and codes—making it a very complex process. And with this complexity, comes variables for failure. Get DZone’s new Guide to Performance to learn how to proactively find these variables and solve them before a disruption occurs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question