|
That is precisely what Collections are for -- to address the limitations imposed by fixed length arrays.
The limitation is not on arrays -- it appears to be on how willing programmers are to writing proper code, IMHO.
In C++, the standard library has some things for that, like vectors and maps, and in C# there are collections.
|
|
|
|
|
I think you do not understand the question.
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.
|
|
|
|
|
I have the following two xml files:
<questionnaire>
<questionnaireid>1</questionnaireid>
<questionnairename>sample questionnaire</questionnairename>
<questions>
<question qid="1" >
<qid>1</qid>
<questiondesc>Q1) Enter some free text</questiondesc>
<typeid>2</typeid>
<required>1</required>
<parentquestion></parentquestion>
</question>
<question qid="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>
<response qid="1">
<answers>
<answer>This is some text</answer>
</answers>
</response>
<response qid="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
|
|
|
|
|
Appreciate your suggestions to either a book, or an on-line site with tutorials, or whatever. I need to get up-to-speed (from a "cold start") quickly.
best, Bill
The glyphs you are reading now: are place-holders signifying the total absence of a signature.
|
|
|
|
|
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.
best, Bill
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.
|
|
|
|
|
trying to import xml into GPP. Converted .reg to xml but when I import I get the error:
<registry name="clsid=" "="">
An invalid or out of place input element was detected and will be ignored.
I've searched the xml file for that specific line and it doesn't appear. Any idea how to fix this?
|
|
|
|
|
Hi All,
I am trying to create Schema file for xml which looks like a General tree.
My xml will look like
<root>
<node name = "" >
<leaf name = "" value = "" />
</node>
</root>
A node can contain any number of node inside and it goes on.
like
<root>
<node name = "" >
<leaf name = "" value = "" />
</node>
<node name = "" >
<node name = "" >
<leaf name = "" value = "" />
<node name = "" >
<leaf name = "" value = "" />
</node>
</node>
</node>
</root>
Please advice how to create xsd file.
Thanks.
modified 14-Jun-12 13:47pm.
|
|
|
|
|
|
Thanks for your reply.
i was looking for generic xsd not for specific scenario.
i have general Tree having a node which contains some data.
|
|
|
|
|
Above example links were not shared for any specific example. They are for generic design. Reference to start up with.
Don't say, you are expecting an XSD design for your particular tree scenario from us directly!
|
|
|
|
|
Thanks that will be enough.
|
|
|
|
|
Hi All,
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.
|
|
|
|
|
praveen3g wrote: 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.
|
|
|
|
|
Hi,
Thanks for the reply.
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.
|
|
|
|
|
praveen3g wrote: you do not understand actually what the issue is.
Yes, I understand perfectly: your code runs slow and you want to know why.
praveen3g wrote: 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.
Given the information you have provided how can anyone guess what those parameters are?
|
|
|
|
|
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.
|
|
|
|
|
praveen3g wrote: you may require for your analysis.
Like most people on this forum, I do not have the time or resources to analyse an issue like this. As I said earlier this question cannot be answered in a forum such as this. You need to do the analysis and ask a more specific and detailed question before anyone can hope to offer any suggestions.
|
|
|
|
|
I have done my part of analysis and even know where it is taking time.
So I am left with 2 options
1) Splitting the large XML file to small chunk of files based on a condition.
2) Increasing the DTM threads in Java API so that compiled version of Xalan can be used.
Let me know if you have any ideas in one of the options above. I can ask questions to the point on the option you say
|
|
|
|
|
Have you tried using a profiler? A colleague of mine wrote an xml parser/validator in .Net for large files and the first file would complete in about 20-30 minutes. After the first though, it would get incredibly slow, taking around 18-30 hours to process 50mb files. When we checked the memory allocations there were about 10 times more than necessary. The app was running out of memory and continually hitting the page file on disk to make up the difference. All of that because he didn't understand the immutable nature of .Net Strings.
EDIT - I realize you are not using .Net, but I am thinking you could try a profiler for java.
That is the best advice I can give, good luck friend.
|
|
|
|
|
I feel for this poster....
The issue is most likely poor XML and XSLT design. Too many people refuse to take the time to understand their data and XML and in the rush to 'get something working' they create a schema that is bloated, incomplete and that requires a lot of resources to even attempt to use.
Six days for 100MB? Yes - I can say that the schema does not represent the data well and the XSL is probably even worse because it must translate this rickety XML into something that might be even more poorly designed and implemented and it is apparent that the XSL has been where all of the changes and fixes have been applied.
For starters -- do not avoid using attributes simply because elements seem 'easier' -- they are not. Things that describe a thing -- are attributes. Things that own things -- are usually elements.
I post here because -- when you try to engineer a system and write the entire application at the same time -- all the while saying -- just get it running, we'll fill in the details later -- and also you take alot of shortcuts ('it will be easier if we do ....')....all you are doing is moving the work further down the line and making it more difficult....
There is a definite amount of work that must be done -- never assume that you can avoid it and do as much up front as you can.
|
|
|
|
|
I have a program I have written that displays the contents of a xml file in a browser. I am trying to make it more user friendly for people to change the xml files without opening them in notepad or a canned xml editor. What I would like to do is be able to pull the information from the xml file into a webpage and allow the users to make changes and save it back to the xml file. I've done google searches for about a week and can't come up with a good way to do it. Any suggestions would be much appreciated.
|
|
|
|
|
I'm doing one currently where the xml is shown in the browser control (after xslt applied to it) and if the user needs to add data (we are not changing anything)I have a form come up to fill in the data. This was the most direct method for me but if that doesn't work you may have to look in the javascript direction.
|
|
|
|
|
Marc Clifton has a good article here where he parses the schema, and produces a dialog based form showing the message content. Well worth a look.
Ger
|
|
|
|