|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now! |
|
#1
|
|||
|
|||
|
Help on ASP & XML
Hello All
I am facing a peculiar issue in my project. Let me first tell a bit about the project, to set the context. Well, it deals with translating the literals (HTML text and labels) of an existing ASP website from English to, say Swedish. Now, for this we are employing XML document to store the literals and their translations. The literals are passed as string parameters to a translation routine that picks up the translated value from the XML. The XML has a ID-VALUE structure i.e. the translating routine would match a particular literal against the ID in the XML document and pick up the translated equivalent from VALUE part of the node. We have built a tool that mines out the literals from the ASP Page and stores them in the XML document. The tool identifies the statement after each HTML ending tag (">") as literals and picks them up and puts them in the XML document. Once the XML document is created, the translator would put the equivalent translated literal in the value part of the node, which the ASP page would pick up to display. Here, the problem that we are facing is that if a sentence contains a function call or a variable, then, the sentence gets split up in to fragments and these fragments are stored as individual nodes in the XML document. Thus it would not be possible to translate it in the said language as the whole sentence is now fragmented. Further, after translation the position of the ASP variable or Function call might change. For instance, the verb may come before the noun or the noun before the verb. How do we treat the function call or variable such that it can handle the change in position issue and also be easy for the translator to do his job? The solution has to be built using ASP, VB and XML. Below is an example to make my point: ASP Page <tr> <td align="left" class="RegularText" colspan="2"> This screen should be used to set up new <%=SITENAME%> users only. Make sure you enter the user's correct E-Mail address. When you submit the page, a system-assigned password will be automatically e-mailed to the user. </td> </tr> In the code above, there is a variable SITENAME embedded in the sentence (that is causing all the problems). Now during translation, if we leave out the variable and just pick up the literals to the left and right of it. The XML nodes are as below: <KEY ID="This screen should be used to set up new" VALUE="This screen should be used to set up new"/> <KEY ID="users only. Make sure you enter the user's correct E-Mail address. When you submit the page, a system-assigned password will be automatically e-mailed to the user." VALUE="users only. Make sure you enter the user's correct E-Mail address. When you submit the page, a system-assigned password will be automatically e-mailed to the user."/> The complete sentence gets split up in two parts. Thus it would not be possible to translate it in the said language because after translation the position of the ASP variable might change. For instance, the verb may come before the noun or the noun before the verb. We cannot take the VBScript variable as a part of the string parameter and pass it to the translation routine, as then the variable would be treated as part of the string and would not get the value at runtime. Any help/ideas to tackle the above stated problem will be greatly appreciated. Thanks & Regards - Anuj Mathur |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Help on ASP & XML |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|