I used XSD.EXE to convert my schema to a C# class. The tool creates arrays to represent elements whose maxOccurs attribute is unbounded. Arrays are very limiting: you cannot add or delete items without a lot of shuffling.
Has anyone found a way around this limitation of arrays? For simple cases, I have converted the array to a List and back to an array, but that is only useful in the simplest of cases. Perhaps there is another tool that can convert my schema and use a list or some other suitable container (?).
There is no need for converting the list back to an array, you can replace it. I did that e.g. with GPX files (see also Bernie’s Trackviewer[^] where I use some more tricks for getting "nice" classes from an "ugly" XML schema).
The problem is that the tool (XSD.EXE) generates code that uses arrays. Arrays are limiting since it is difficult to add to or remove items from them. I was looking for another tool (that used a more appropriate collection) or an easy workaround.
Perhaps I could have phrased my question better. The limitation I mentioned was intended to mean that the tool generated arrays, not that of arrays themselves.
Even at this late stage, I appreciate your answer. However, I believe you misread the question.
<questionnaire><questionnaireid>1</questionnaireid><questionnairename>sample questionnaire</questionnairename><questions><questionqid="1"><qid>1</qid><questiondesc>Q1) Enter some free text</questiondesc><typeid>2</typeid><required>1</required><parentquestion></parentquestion></question><questionqid="2"><qid>2</qid><questiondesc>Q2) Select any of the choices</questiondesc><typeid>6</typeid><required>1</required><parentquestion></parentquestion><choices><choice>Choice1</choice><choice>Choice2</choice><choice>Choice3</choice></choices></question></questions></questionnaire><questionnaireresponse><questionnaireid>1</questionnaireid><userid>1234</userid><responses><responseqid="1"><answers><answer>This is some text</answer></answers></response><responseqid="2"><answers><answer>Choice 2</answer></answers></response></responses></questionnaireresponse>
How do you use xslt to add the response for this user to questionnare file and display as HTML form so in the above example the textbox will be populated with 'This is some text' and the dropdown will have 'Choice 2' selected?
Some example xslt implementing the above would be very helpful to get started. ideally I would like to do this in asp.net
Many thanks ! I don't know how I missed noticing that one, since Apress books have generally been very useful to me, and I thought I had searched their site.
It keeps me humble to think there's more bacteria in my gut than neurons in my brain, and that twenty trillion neutrinos pass through one hand a second, and that the average mattress contains 20 million bedbugs each of whom sh*ts once per hour.
Feels good to be a part of this forum of technical stalwarts and Gurus. I feel I will get a solution for my long time problem here .
The problem we are facing here is the performance issues when processing the large XML files. Using Java API transformer factory in interpretive mode takes unbelievable 6 days for processing huge files which is a point of very serious concern in a production system.
Please help me out and do let me know what are the different things required to be attached which will be helpful for the analysis.
takes unbelievable 6 days for processing huge files
Most people would have figured there was something wrong before this. Take a look at the data you are processing and how you are dealing with it. The chances of anyone being able to guess what is wrong is not very high.
Answer is no , to the people whom I have checked with was not able to diagnose where the problem is and what is the way around it. Everyone definitely understand that the volume of data in the file is huge , say 100MB xml document but no one till data have given a way to work around it efficiently. Let me know if you wish to have a glance and will look forward to your suggestions
This is not the sort of issue that can be resolved in a forum like this. You need to do some analysis of your code and measuring of your processing time and code paths. Try running against some small data files and see how long it takes and try to work out whether that is an acceptable length of time.
I have done my analysis and I guess you do not understand actually what the issue is.Do understand am not a kinder garden student to just post a question and expect a ready made answer as I have done quite a lot of research in it more than you . I will look for someone who can just help me out on what are the different parameters that can be looked for rather than just replying generic. Please do not bother to reply further. Thanks again.
I have asked specifically what sort of information I should update here which is required for your analysis as I don't know what logs, JVM settings , XSL snippets which is taking more memory and time you may require for your analysis.If you have asked me any one of the above details or whatever you think is required, I can definitely provide them at first place.
Last Visit: 31-Dec-99 18:00 Last Update: 20-Apr-21 7:52