Ciao! Ho bisogno di una mano. ho un file xml come questo che vedete sotto.
devo cercare una parola in italiano o tedesco, e se la trova stampare a video sia il segmento italiano che quello tedesco. Ora riesco solo a fare la ricerca e farmi stampare solo un segmento (quello in cui trova la parola)... posto sotto l'xml anche il codice asp che ho fatto.
Qualcuno può aiutarmi a stampare anche il segmento dell'altra lingua?
--------- codice xml -------------
<body id="segmenti">
<tu creationdate="20090826T144207Z" creationid="ULRICH SCHRAMM">
<tuv lang="IT-IT">
<seg>Viti a corredo serbatoi toroidali Stako (per piastra rettangolare)</seg>
</tuv>
<tuv lang="DE-DE">
<seg>Schrauben des Stako-Rundtanks (für Rechteckplatte)</seg>
</tuv>
</tu>
<tu creationdate="20090826T144259Z" creationid="ULRICH SCHRAMM">
<tuv lang="IT-IT">
<seg>Raccordi tubi alta pressione (multivalvola / elettrovalvola)</seg>
</tuv>
<tuv lang="DE-DE">
<seg>Anschlüsse für Hochdruckschläuche (Multiventil / Magnetventil)</seg>
</tuv>
</tu>
</body>
--------------- codice asp ------------
<%
'Inizializziamo il Parser MS XML...
Set objXML = Server.CreateObject("Microsoft.XMLDOM")
objXML.async = False
'Carica il file XML
strFile = Server.MapPath("test2.xml")
objXML.Load (strFile)
Set AllItems = objXML.selectNodes("//tu")
%>
<%
query = request.form ("cerca")
'For Each Item In AllItems
For I = 0 to (AllItems.Length - 1)
Response.Write("<font color="&chr(34)&"#ababab"&chr(34)&">" &_
AllItems(I).GetAttribute("creationdate") & "</font>
" & vbcrlf)
Set tuv = AllItems(I).selectNodes("tuv")
For J = 0 to (tuv.Length-1)
Set seg = tuv(J).selectNodes("seg")
segx=seg(0).text
langx=tuv(J).getAttribute("lang")
If instr(segx, query)>0 Then
Response.Write( chr(34) & langx & chr(34) & " ")
Response.Write(seg(0).text & "
")
end if
Set seg = nothing
Next
Set tuv = Nothing
Next
%>

Rispondi quotando