Hi everyone,
This is more of a user question probably, but I have to use dev, since
there is not user list for commons ;)
I have a simple (in real life a little bit more complex btw) xml file,
which looks like this :
<PHYSICAL_SCHEMA autocreate="yes">
<DBMS kind="ODBC">
<DBID>
<DB_DATA_TYPE name="VARCHAR"/>
</DBID>
</DBMS>
</PHYSICAL_SCHEMA>
I removed a lot from the about 60 kb xml file, but this is the one I use
to test on, so I can limit debugging output.
Via the use of the NameMapper I tried to map the classnames to the
correct element names
I want PHYSICAL_SCHEMA mapped to PhysicalSchema, etc,etc, which my
custom NameMapper handles fine.
The problem is that it is not working (also played around with .betwixt
files, which made it more confusing).
Can someone give me some guideline in how I can use this xml file, the
way I had in mind (with readable "normal" classnames, my attributes also
set in the classes I mention (setAutocreate is eg never called during
the parse). Especially digester is complaining a lot that it cannot
find any rules for the PHYSICAL_SCHEMA/DBMS (and deeper), even though I
created the classes and added addXXXX and getXXX methods to the
PhysicalSchema class.
Am I using the wrong tool here, or just missing something ?
(if I am using the wrong tool, please let me know).
For completeness, I attached the dtd. Since this is needed for a (long
lasting) migration to complete javacode and real database independency,
I don't have "the power" yet, to make the xml and dtd better and have to
deal with these nasty things.
Another thing : isn't there a way to generate an object structure from
the xml in betwixt and is that something that is interesting enough to
be added as a tool ?
Hope someone can help ;)
Mvgr,
Martin
<!-- PHYSICAL_SCHEMA -->
<!ELEMENT PHYSICAL_SCHEMA (DBMS* , DATABASE_SERVER*)>
<!ATTLIST PHYSICAL_SCHEMA autocreate ( yes | no ) "yes">
<!-- DBMS (Database Management System)-->
<!ELEMENT DBMS (DBID)>
<!ATTLIST DBMS kind (SYBASE | ORACLE | ODBC | MyODBC | SQL_SERVER_ODBC | SQLserver | HIS_COM | ORACLE_ODBC ) #REQUIRED>
<!-- DBID (Database Interface Description) -->
<!ELEMENT DBID (DB_DATA_TYPE* , STRING_DATA_TYPES? , BOOLEAN_DATA_TYPES? , DATE_DATA_TYPES?, NUMERIC_DATA_TYPES? ,SQL_TEMPLATE*)>
<!-- DB_DATA_TYPE -->
<!ELEMENT DB_DATA_TYPE EMPTY>
<!ATTLIST DB_DATA_TYPE name NMTOKEN #REQUIRED
size_allowed ( yes | no ) "no"
decimal_size_allowed ( yes | no ) "no"
size_mandatory ( yes | no ) "no">
<!ELEMENT NUMERIC_DATA_TYPES EMPTY>
<!ATTLIST NUMERIC_DATA_TYPES names NMTOKENS #REQUIRED>
<!ELEMENT STRING_DATA_TYPES EMPTY>
<!ATTLIST STRING_DATA_TYPES names NMTOKENS #REQUIRED>
<!ELEMENT BOOLEAN_DATA_TYPES EMPTY>
<!ATTLIST BOOLEAN_DATA_TYPES names NMTOKENS #REQUIRED>
<!ELEMENT DATE_DATA_TYPES EMPTY>
<!ATTLIST DATE_DATA_TYPES names NMTOKENS #REQUIRED>
<!-- SQL_TEMPLATE -->
<!ELEMENT SQL_TEMPLATE (LITERAL | HOLE | REPEATING | SUB_TEMPLATE | REPEATING_SUB_TEMPLATE )*>
<!ATTLIST SQL_TEMPLATE statement NMTOKEN #REQUIRED>
<!-- LITERAL -->
<!ELEMENT LITERAL (#PCDATA)>
<!ATTLIST LITERAL optional ( yes | no ) "no"
default ( not_participating | participating ) "participating">
<!-- HOLE -->
<!ELEMENT HOLE EMPTY>
<!ATTLIST HOLE name NMTOKEN #REQUIRED
optional ( yes | no ) "no">
<!-- REPEATING -->
<!ELEMENT REPEATING (REPEATING | HOLE)>
<!ATTLIST REPEATING name NMTOKEN #REQUIRED
separator CDATA #REQUIRED
repeating ( plus | once | asterisk ) "asterisk">
<!-- SUB_TEMPLATE -->
<!ELEMENT SUB_TEMPLATE (LITERAL | HOLE | REPEATING)*>
<!ATTLIST SUB_TEMPLATE name NMTOKEN #REQUIRED
optional ( yes | no ) "no">
<!-- REPEATING_SUB_TEMPLATE -->
<!ELEMENT REPEATING_SUB_TEMPLATE (REPEATING_SUB_TEMPLATE | SUB_TEMPLATE)>
<!ATTLIST REPEATING_SUB_TEMPLATE name NMTOKEN #REQUIRED
separator CDATA #REQUIRED >
<!-- DATABASE_SERVER -->
<!ELEMENT DATABASE_SERVER (DB_LOCATOR, DATABASE*)>
<!ATTLIST DATABASE_SERVER name ID #REQUIRED
kind (SYBASE | ORACLE | ODBC | MyODBC | SQL_SERVER_ODBC | SQLserver | HIS_COM | ORACLE_ODBC ) #REQUIRED>
<!-- DB_LOCATOR -->
<!ELEMENT DB_LOCATOR EMPTY>
<!ATTLIST DB_LOCATOR host_name NMTOKEN #IMPLIED >
<!-- DATABASE -->
<!ELEMENT DATABASE (VALUE_SETTINGS? , (TABLE | VIEW)*)>
<!ATTLIST DATABASE name NMTOKEN #REQUIRED
user_name NMTOKEN #REQUIRED
password NMTOKEN #REQUIRED
use_escape_character ( yes | no ) "yes">
<!-- VALUE_SETTINGS -->
<!ELEMENT VALUE_SETTINGS EMPTY>
<!ATTLIST VALUE_SETTINGS opening_identifier_bracket NMTOKEN #IMPLIED
closing_identifier_bracket NMTOKEN #IMPLIED
true_value NMTOKEN #IMPLIED
false_value NMTOKEN #IMPLIED
string_delimiter NMTOKEN #IMPLIED
string_delimiter_escape_sequence NMTOKEN #IMPLIED>
<!-- TABLE -->
<!ELEMENT TABLE (COLUMN+,PRIMARY_KEY?,INDEX*)>
<!ATTLIST TABLE name NMTOKEN #REQUIRED
autocreate ( yes | no ) "yes"
read_only ( no | yes ) "no">
<!-- COLUMN -->
<!ELEMENT COLUMN EMPTY>
<!ATTLIST COLUMN name NMTOKEN #REQUIRED
type NMTOKEN #REQUIRED
size NMTOKEN #IMPLIED
decimal_size NMTOKEN #IMPLIED
nulls_allowed (no | yes) "no"
primary_key (no | yes) "no">
<!-- PRIMARY_KEY -->
<!ELEMENT PRIMARY_KEY EMPTY>
<!ATTLIST PRIMARY_KEY columns NMTOKENS #REQUIRED>
<!-- INDEX -->
<!ELEMENT INDEX EMPTY>
<!ATTLIST INDEX name NMTOKEN #REQUIRED
unique (no | yes) "no"
clustered ( no | yes ) "no"
columns NMTOKENS #REQUIRED
read_only ( no | yes ) "no">
<!-- VIEW -->
<!ELEMENT VIEW EMPTY>
<!ATTLIST VIEW name NMTOKEN #REQUIRED
statement NMTOKENS #REQUIRED>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>