[]XML improvement
Posted: Fri Feb 19, 2010 4:53 pm
Recently I did some work with []XML and have to admit that it mad my life easier while working on xml creation and reading. Significantly improving development time compared to my previous attempt of dealing with xml in APL.
I have a couple of notes in regards of the tool:
- In general:
[]XML is good but may be we need something more general, what will cover more formats. For example next may be []JSON and so on. In this regard to have []PARSer may be a universal tool. Give it left argument bnf (Backus–Naur Form) text and receive translation of say SQL statement in the form of current []XML translation.
- In detail related to []XML work:
1. I want to compose xml but final document is collected from multiple functions which already return xml document. So currently I would need to do double work by decoding xml to 5 column matrix and then composing back to xml.
Say we have a simple task: we have a function, which produces xml, but requirements are to enclose result in one more tag. (I do not want to change base function as it is perfectly good for other tasks). So if I would be able to specify in column 5 that the value of the node should not have conversion of escape characters. I may simply create new []XML structure, assign result of sub function to 3rd column and set column 5 to be 1 so value of node will not have conversion of escape characters.
2. If we allow partial xml to be value for node in []XML matrix. we may add one more parameter to []XML when it parses xml document. And this parameter may be parse up to level 2 or 3 or 4 ... keeping all other levels as unchanged xml nodes.
3. Looks like a bug/luck of knowledge. I did not find a way of removing tabular formatting/leading white spaces from resulting xml document. It is always structured, with white spaces and CR LF characters.
/Alex
I have a couple of notes in regards of the tool:
- In general:
[]XML is good but may be we need something more general, what will cover more formats. For example next may be []JSON and so on. In this regard to have []PARSer may be a universal tool. Give it left argument bnf (Backus–Naur Form) text and receive translation of say SQL statement in the form of current []XML translation.
- In detail related to []XML work:
1. I want to compose xml but final document is collected from multiple functions which already return xml document. So currently I would need to do double work by decoding xml to 5 column matrix and then composing back to xml.
Say we have a simple task: we have a function, which produces xml, but requirements are to enclose result in one more tag. (I do not want to change base function as it is perfectly good for other tasks). So if I would be able to specify in column 5 that the value of the node should not have conversion of escape characters. I may simply create new []XML structure, assign result of sub function to 3rd column and set column 5 to be 1 so value of node will not have conversion of escape characters.
2. If we allow partial xml to be value for node in []XML matrix. we may add one more parameter to []XML when it parses xml document. And this parameter may be parse up to level 2 or 3 or 4 ... keeping all other levels as unchanged xml nodes.
3. Looks like a bug/luck of knowledge. I did not find a way of removing tabular formatting/leading white spaces from resulting xml document. It is always structured, with white spaces and CR LF characters.
/Alex