You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by "Kevin Y. Kim (Lists)" <ky...@mac.com> on 2005/11/07 17:16:49 UTC

Generic mapping method?

Hi,

I'm not sure if XMLBeans is the correct tool for this, but I'll ask 
anyway.

I will have a situation where I will not know the schema until runtime.
So I think I need three things:
	1) Ability to create a schema "structure" at runtime.
	2) Use this information to parse the XML file
	3) Store it in a generic hash-table structure.

I believe that my data will end up looking like this:
<Data>
	<metadata>
		<field name="foo" type="xsd:string"/>
		<field name="bar" type="xsd:integer"/>
	</metadata>
	<datum id="1">
		<foo>one</foo>
		<bar>1</bar>
	</datum>
	<datum id="2">
		<foo>two</foo>
		<bar>2</bar>
	</datum>
	...
</Data>

The metadata may exist in another file that has a well defined schema,
if necessary.

What I'd end up with is a list of a hash-table of appropriate XmlObject
subclass (XmlString and XmlInteger in this example).

I know this is not really what XMLBeans was designed to do, but can I 
leverage
the framework to do this for me?

Thanks,
-kevin

		


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org