[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: convert string to xml record
Hi, First, thank all who helped me on this topic. After reading your suggestions and search the archive and the web, I finally find the solution although may not be the best one. Just to share with everyone. The original codes I found is on this site: http://download-west.oracle.com/otndoc/oracle9i/901_doc/appdev.901/a88894/adx04xsl.htm This is what I did. I downloaded the xml parser package from oracle site and use their DOMParser package and here is my java method used to parse the string: import java.util.*; import org.w3c.dom.*; import org.xml.sax.SAXException; import java.io.StringReader; import oracle.xml.parser.v2.*; public static NodeList parseXml (String s) { DOMParser d = new DOMParser(); try { d.parse( new StringReader(s) ); return ((XMLDocument)d.getDocument()).selectNodes("/"); } catch (Exception e) { return (new XMLDocument()).getChildNodes(); } } Hope this will help someone. Ming Stuart Celarier wrote: > The only XSLT 1.0 way that I know how to do that is with the document() > function, assuming that the string can be addressed with a URI. That > means that string can be served up as a URL from a web server, or the > string can be in a file on the file system, or even a fragment within a > file. > > Individual XSLT vendors may implement extension functions if you can tie > your application to a specific XSLT processor. I can't make specific > recommendations but look for such parsing functions in Saxon, Xalan, > etc. I am not aware of any such extension functions for MSXML or MS > .NET. > > Cheers, > Stuart > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|