Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making use of the id tag

Status
Not open for further replies.

KMarshall

Technical User
May 25, 2001
12
GB
I have following xml doc:
<?xml version=&quot;1.0&quot;?>
<Jobs>
<Job id=&quot;1&quot;>
<CustomerRef>123456</CustomerRef>
<CollectionDate>18/09/01</CollectionDate>
<CollectionTime>18:00</CollectionTime>
<DeliveryDate>19/09/01</DeliveryDate>
<DeliveryTime>17:00</DeliveryTime>
<FromAddress1>Manufacturer</FromAddress1>
<FromAddress2>Unit2</FromAddress2>
<FromAddress3>Newcastle</FromAddress3>
<ToAddress1>Shop</ToAddress1>
<ToAddress2>HighStreet</ToAddress2>
<ToAddress3>London</ToAddress3>
<Goods>Goods</Goods>
<Quantity>3</Quantity>
<ExchangeID>1</ExchangeID>
</Job>
<Job id=&quot;2&quot;>
<CustomerRef>654321</CustomerRef>
<CollectionDate>12/09/01</CollectionDate>
<CollectionTime>15:00</CollectionTime>
<DeliveryDate>19/09/01</DeliveryDate>
<DeliveryTime>19:00</DeliveryTime>
<FromAddress1>Somewhere</FromAddress1>
<FromAddress2>Unit10</FromAddress2>
<FromAddress3>Sunderland</FromAddress3>
<ToAddress1>SomewhereElse</ToAddress1>
<ToAddress2>Low Street</ToAddress2>
<ToAddress3>Southampton</ToAddress3>
<Goods>SomeGoods</Goods>
<Quantity>10</Quantity>
<ExchangeID>2</ExchangeID>
</Job>
</Jobs>

And the following dtd:

<!ELEMENT Jobs (Job+)>
<!ELEMENT Job (CustomerRef,CollectionDate,CollectionTime,DeliveryDate,DeliveryTime,FromAddress1,FromAddress2,FromAddress3,ToAddress1,ToAddress2,ToAddress3,Goods,Quantity,ExchangeID)>
<!ATTLIST Job id CDATA #REQUIRED>
<!ELEMENT CustomerRef (#PCDATA)>
<!ELEMENT CollectionDate (#PCDATA)>
<!ELEMENT CollectionTime (#PCDATA)>
<!ELEMENT DeliveryDate (#PCDATA)>
<!ELEMENT DeliveryTime (#PCDATA)>
<!ELEMENT FromAddress1 (#PCDATA)>
<!ELEMENT FromAddress2 (#PCDATA)>
<!ELEMENT FromAddress3 (#PCDATA)>
<!ELEMENT ToAddress1 (#PCDATA)>
<!ELEMENT ToAddress2 (#PCDATA)>
<!ELEMENT ToAddress3 (#PCDATA)>
<!ELEMENT Goods (#PCDATA)>
<!ELEMENT Quantity (#PCDATA)>
<!ELEMENT ExchangeID (#PCDATA)>

And the followng xsl sheet:

<xsl:stylesheet xmlns:xsl=&quot; version=&quot;1.0&quot;>
<xsl:eek:utput method=&quot;html&quot; />
<xsl:template match=&quot;/&quot;>
<html>
<body>
<table border=&quot;2&quot; bgcolor=&quot;white&quot;>
<tr>
<th>CustomerRef</th>
<th>CollectionDate</th>
<th>CollectionTime</th>
<th>DeliveryDate</th>
<th>DeliveryTime</th>
<th>FromAddress1</th>
<th>FromAddress2</th>
<th>FromAddress3</th>
<th>ToAddress1</th>
<th>ToAddress2</th>
<th>ToAddress3</th>
<th>Goods</th>
<th>Quantity</th>
<th>ExchangeID</th>
</tr>
<xsl:for-each select=&quot;Jobs/Job&quot;>
<xsl:value-of select=&quot;@id&quot;/>
<tr>
<td><input id=&quot;CustomerRef&quot; type=&quot;text&quot; value=&quot;{CustomerRef}&quot; /></td>
<td><input id=&quot;CollectionDate&quot; type=&quot;text&quot; value=&quot;{CollectionDate}&quot; /></td>
<td><input id=&quot;CollectionTime&quot; type=&quot;text&quot; value=&quot;{CollectionTime}&quot; /></td>
<td><input id=&quot;DeliveryDate&quot; type=&quot;text&quot; value=&quot;{DeliveryDate}&quot; /></td>
<td><input id=&quot;DeliveryTime&quot; type=&quot;text&quot; value=&quot;{DeliveryTime}&quot; /></td>
<td><input id=&quot;FromAddress1&quot; type=&quot;text&quot; value=&quot;{FromAddress1}&quot; /></td>
<td><input id=&quot;FromAddress2&quot; type=&quot;text&quot; value=&quot;{FromAddress2}&quot; /></td>
<td><input id=&quot;FromAddress3&quot; type=&quot;text&quot; value=&quot;{FromAddress3}&quot; /></td>
<td><input id=&quot;ToAddress1&quot; type=&quot;text&quot; value=&quot;{ToAddress1}&quot; /></td>
<td><input id=&quot;ToAddress2&quot; type=&quot;text&quot; value=&quot;{ToAddress2}&quot; /></td>
<td><input id=&quot;ToAddress3&quot; type=&quot;text&quot; value=&quot;{ToAddress3}&quot; /></td>
<td><input id=&quot;Goods&quot; type=&quot;text&quot; value=&quot;{Goods}&quot; /></td>
<td><input id=&quot;Quantity&quot; type=&quot;text&quot; value=&quot;{Quantity}&quot; /></td>
<td><input id=&quot;ExchangeID&quot; type=&quot;text&quot; value=&quot;{ExchangeID}&quot; /></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Basically I'm transforming the xml document into an html form on an asp page so that I can post it to a database.

I need to call each field in the database something unique so I was trying to make use of the id tag in the xml doc, with the idea of appending the form field with the job id.

Can anyone help me try to do this?

I'd be grateful for your time.

Regards,
Kevin Marshall
 
so you have xml coming in, then you produce a form in html. then you submit the form to a server which puts it all in a db?

is the html supposed to have lots of different forms, and you click on each one to upload one by one or is it one big form?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top