From: William F. D. <wil...@Th...> - 2007-10-11 16:49:18
|
Hi Martin, This looks like something useful to have, but if I am understanding correctly, it does not belong in flexml. The reason is that flexml makes no interpretation of any tag or attribute name. But you are proposing that 1) the 'foreach' tag now has a specific meaning; 2) the 'variable' and 'values' attribute of the 'foreach' tag has a specific meaning. These thing will be surprising to someone expecting flexml to be an XML parser-generator, as we currently say. Some questions: What if my DTD does not have <!ELEMENT foreach ...> Or are you saying that *if* my DTD has <!ELEMENT foreach (plop)*> <!ATTLIST foreach variable CDATA #REQUIRED values CDATA #REQUIRED> *then* flexml will interpret a document as you indicated? Or, suppose my DTD has <!ELEMENT foreach (plop)*> <!ATTLIST foreach variable CDATA #IMPLIED values CDATA #IMPLIED> what should flexml do? Or, suppose my DTD has <!ELEMENT foreach (plop)*> <!ATTLIST foreach variable NMTOKEN #REQUIRED values CDATA #IMPLIED> what should flexml do? Even if you specify the requirement on the DTD quite tightly, the result will be very surprising to somebody who just wants an XML parser. I think your proposal would move flexml from being a parser to being an interpretter or parser+interpretter, which would make it harder to document (describe), debug, and understand. Maybe some of the flexml codebase could be used to create an xml interpretter (I actually like your idea in the specific case of 'foerach', but other constructs could also be easily imagined). Then we would might want to refactor out some common parts between the parser and the interpretter. Will On Thu, 2007-10-11 at 17:11 +0200, Martin Quinson wrote: > Hello, > > I was thinking about implementing a foreach tag able to multiplicate > the xml. > > For example, having the following in the file: > <foreach variable="i" values="1 2 3 4"> > <plop key="$i" /> > </foreach> > would be equivalent to having the following: > <plop key="1" /> > <plop key="2" /> > <plop key="3" /> > <plop key="4" /> > > It's somehow close to xsl transformation, but it would be embeeded > directly in the XML, not in a separate file. Also, the syntax would be > a bit different. > > I have ideas about how to implement the beast, I was just wondering > whether having this in flexml (maybe enabled by a command-line option) > was ok for you guys, or if it was too specific to my own needs to be > placed in the main tree. > > Bye, Mt. > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ FleXML-Users mailing list Fle...@li... https://lists.sourceforge.net/lists/listinfo/flexml-users -- William F Dowling wil...@th... www.scientific.thomson.com |