[
Lists Home |
Date Index |
Thread Index
]
- From: "rsanford" <rsanford@nolimitsystems.com>
- To: <xml-dev@lists.oasis-open.org>
- Date: Mon, 5 Jun 2000 11:22:57 -0500
newbie question. i wanted to search the archives but the
links on xml.org are not functioning.
i'm using ibm's xml4c java parser and i'm using the
DOM api and i have come to the conclusion that the
code i'm writing, while effective, is, very simply,
baboon-butt ugly.
i have a dtd and i am receiving a document that follows
that dtd. to retrieve all the data from the document i
am explicitly navigating through elements in the dtd
and their children and retrieving the values from them
by using DOM_Element::getElementsByTagName("ElementName")
and then iterating through each element in the list and,
if appropriate, asking each one for its text node and
then getting the element value from that text node.
i have line after line of code that looks at an element
with a hard-coded name and then gets the value and it
is ugly. there _has_ to be a better way. somebody please
tell me there is a better way.
the sample code that i have seen is not particularly
useful. there are lots of samples where a tree is printed
out as it is parsedbut i haven't found any code that
gives an example of knowing what the dtd is and actually
_using_ the data within the xml document to do something
(like store in columns in a database).
does anyone have any pointers to good texts on parsing
xml? useful sample code appreciated.
thanks,
rjsjr
***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@xml.org&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************
|