Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

ExpertQ: Access element definition from DOM (JAVA)

Hi there,

tricky problem: I have to parse different XML files which are validated by
DTD or XML Schema an need to have access to element definition.

Example: <!ELEMENT customer (NAME, ADDR, ACCOUNTMGR?, CONTACT*)>

Several variants are valid, most have account mgr asigned, some not yet.
Most have 1..n contacts, new customers not.

I need to know, that there should be an ACCOUNTMGR element, even if there
is no element in the instance:
<CUSTOMER>
<NAME> ACME Corp</NAME>
<ADDR>
...
</ADDR>
<CONTACT>
...
</CONTACT>
</CUSTOMER>

Any ideas? I guess, there is no standard solution for this. But I'm curios
for your replies.

TIA,

Thomas
[805 byte] By [Thomask] at [2007-11-9 15:26:57]