You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Matthew Cordes <mc...@maine.edu> on 2000/04/07 18:29:26 UTC
DTD and relational database
Hello all,
I want to make a generic class that will create an xml document based
upon rules passed to it and a ResultSet ( data from database ). For
instance, perhaps I have the following row in Oracle:
CATEGORY SUBJECT NAME ALIAS
Art Painting Mr. Smith smith
and I want to create this xml
<CATEGORY value="Art">
<SUBJECT value="Painting">
<PERSON>
<NAME>
Mr. Smith
</NAME>
<ALIAS>
smith
</ALIAS>
</PERSON>
</SUBJECT>
</CATEGORY>
I realize that it is pretty easy to go from my row to xml, but I want
to make something generic enough I can just pass it a ResultSet object
and some rules and it will spit out the correct xml Document.
Is there a way I can use the DTD to do this? Or atleast to specify the
rules? Also, anyone familiar with Xerces ( Apache's parser ), could you
tell me how to create a new DTD from within my java code. This part
is a litle confusing to me.
Does anyone know of a package that will do this? (Probably not) In that
case I'm going to try, any suggestions?
-matt
Re: DTD and relational database
Posted by guillermo <gu...@teleco.upv.es>.
Hi
I am not sure if this will help you, but have you visit
http://technet.oracle.com/tech/xml/info/index2.htm?Info&htdocs/otnwp/about_oracle_xml_products.htm
Hope it helps
Matthew Cordes schrieb:
> Hello all,
>
> I want to make a generic class that will create an xml document based
> upon rules passed to it and a ResultSet ( data from database ). For
> instance, perhaps I have the following row in Oracle:
>
> CATEGORY SUBJECT NAME ALIAS
> Art Painting Mr. Smith smith
>
> and I want to create this xml
>
> <CATEGORY value="Art">
> <SUBJECT value="Painting">
> <PERSON>
> <NAME>
> Mr. Smith
> </NAME>
> <ALIAS>
> smith
> </ALIAS>
> </PERSON>
> </SUBJECT>
> </CATEGORY>
>
> I realize that it is pretty easy to go from my row to xml, but I want
> to make something generic enough I can just pass it a ResultSet object
> and some rules and it will spit out the correct xml Document.
>
> Is there a way I can use the DTD to do this? Or atleast to specify the
> rules? Also, anyone familiar with Xerces ( Apache's parser ), could you
> tell me how to create a new DTD from within my java code. This part
> is a litle confusing to me.
>
> Does anyone know of a package that will do this? (Probably not) In that
> case I'm going to try, any suggestions?
>
> -matt
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org