View Single Post
Old 03-10-2013, 01:54 AM   PM User | #1
ElizaKaye
New Coder

 
Join Date: Nov 2012
Posts: 12
Thanks: 4
Thanked 0 Times in 0 Posts
ElizaKaye is an unknown quantity at this point
Working with xml and Javascript in HTML form

Hi

I have searched high and low to get some real examples of this, but no luck.
What I need to do is input a name into an input box and search the xml file (which has three different elements eg. customers root element, person/first and last. Address/street/city/state/postcode/country and Phone) to match that name. (I don't know what to do if there is more than one person with that same name).
When the match is correct then I need to bring through the rest of the relevant info belong to that person. At the moment the xml file is is working fine and coming up into a table. But now it needs the html file. I have tried many different examples of html files but cannot get it to bring through any data. Thanks in anticipation

[CODE]

<?xml version="1.0" standalone="no"?>
<?xml-stylesheet type="text/xsl" href="applyt.xsl" ?>
<customers
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="applydtd.dtd">

<person>
<name>
<first>John</first>
<last>Smith</last>
</name>
<address>
<street>123 Oak St</street>
<city>PERTH</city>
<state>WA</state>
<postcode>4372</postcode>
<country>Australia</country>
<email>js@info.com.au</email>
</address>
<phone>0754641323</phone>
</person>
<person>
<name>
<first>Zack</first>
<last>Zwyker</last>
</name>
<address>
<street>368 Elm St</street>
<city>SYDNEY</city>
<state>NSW</state>
<postcode>2000</postcode>
<country>Australia</country>
<email>zz@info.com.au</email>
</address>
<phone>0478964234</phone>
</person>
<person>
<name>
<first>Albert</first>
<last>Aikens</last>
</name>
<address>
<street>368 Cedar St</street>
<city>BRISBANE</city>
<state>QLD</state>
<postcode>7145</postcode>
<country>Australia</country>
<email>aa$info.com.au</email>

</address>
<phone>0256897426></phone>
</person>
<person>
<name>
<first>Michael</first>
<last>Jones</last>
</name>
<address>
<street>15 Cherry St</street>
<city>SYDNEY</city>
<state>NSW</state>
<postcode>2000</postcode>
<country>Australia</country>
<email>jj@info.com.au</email>
</address>
<phone>0297684321</phone>
</person>
</customers>







[CODE]

Last edited by ElizaKaye; 03-10-2013 at 01:57 AM..
ElizaKaye is offline   Reply With Quote