Generating XML from Form Data A form element naming scheme for generating XML Copyright 2000 © FastNet Software Ltd Matt Sergeant Why Generate XML? Rapid Application Development Portability Standard API's Simplicity Plug and Play Generating Un-Structured XML

]]>

generates:


	fred
	dollar$
]]>
Simple solution, mostly useless
Moving to Fully Structured XML Hard Coded Structure Configuration File Encode Structure in form element names Browsers are not going to change soon Encoding Structure XPath basis Form element name => insertion point Small subset Ordering significance XPath Intro Like a directory path leading "/" => root of XML tree "element/element" steps define the tree structure XPath meant for finding and matching XML tree nodes We want something for creating nodes XPath Subset Element steps: /foo/bar Attribute predicates: /foo/[@key='value']/bar Attribute axis: /foo/bar/@myattr Relative paths: ../myelement Grammar in notes Rules Insertion Point Absolute paths vs Relative Paths Ignored Names .name xmlform:foo directives Examples (1) - Elements
]]>

generates:


	

  • My point is...

]]>
Examples (2) - Attributes
]]>

generates:


	

]]>
Examples (3) - Relative Paths



]]>

generates:


	value1
	value2

	value3
]]>
Examples (4) - More Relative Paths




]]>

generates:


	Matt
	Sergeant
	Mr	
IT
]]>
Implementations CGI::XMLForm - Perl Module XMLForm - Java Class Part of Cocoon Project Some aspects different Security Users can modify XML Structure Not a rootkit, but dangerous Use MD5 hash of element names + key