cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rong <>
Subject parse XML String in java code
Date Thu, 13 Apr 2000 18:49:03 GMT


If i want to parse a String(in a piece of java code), which is in form of
XML document, what should i do? The String can be in form of:

String s1 = " <POEM> <AUTHOR> Ogden Nash </AUTHOR> <TITLE> Fleas </TITLE>
<LINE> Adam had'em. </LINE></POEM> ";

In SAXParser, the function: 

 Parser parser = ParserFactory.makeParser(""); 
 parser.parse(new InputSource(args[0]));

can take an instance of File class(args[0]="*.xml") and parse it according
to an instance usr-defined class(titleFinder). This method basically parse
a xml file, not a String in the code.

Is there a way to parse a XML String in cocoon or another way?



View raw message