I am a total rookie so forgive my ignorance in advance.
I am (trying) to use XSLT to transform XML output from my Filemaker database so that I can re-import it (to synchronize the data after it has been copy-edited externally).
The whole business works fine with one exception. In the xml file, some text has visual tags such as <hirend="italic"></hi>.
The xslt does not bring this tagging into the transformed file. I have tried using
either one of these brings the text perfectly, but not the <hi> tags.
I'm using oXygen 12.2 and FMProAdvanced 11.
<!-- Another template code here -->
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.
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.
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.
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.
Hello. Im trying to create an xml schema that can capture the following behavior:
1. <info> element should be the first inside <root>
2. <ParamA>, <ParamB>, <ParamC>, <ParamD>, and <ParamE> are optional, should appear after the <info> element and can appear in any order.
The following xml are valid:
<root><info></info><ParamB></ParamB><!--Interchangeable with other Param-->
<ParamD></ParamD><!--Interchangeable with other Param-->
<ParamC></ParamC><!--Interchangeable with other Param-->
<ParamA></ParamA><!--Interchangeable with other Param-->
<ParamE></ParamE><!--Interchangeable with other Param-->
The following xml is NOT valid:
<root><ParamB></ParamB><ParamD></ParamD><ParamC></ParamC><ParamA></ParamA><info></info> <!--This should appear as the first element inside root-->
I have an integer attribute declared in the xsd file. In the xml file, I need to use hex for the value. I can’t find info about the syntax about hex value.
I tried something but neither
<MyDataMyValue="0x52590"/> nor <MyDataMyValue="#52590"/> works. Any clues are appreciated.
Make toll free long distance calls from your smart phone with ACN Mobile World. When connected via wifi, calls will not use any of your minutes or data, nor will there be any roaming charges. Certain conditions apply. See my website for details. Within you lies the power for good - Use it!