Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

HTML to XML Conversion ?

56059Apr 23 2002
Developed a content presentation java servlet implmenting xmlparser2.jar classes, works well. We're storing content (in XML) format as blob, then using parser we are able to do the transformation of the xml file to HTML for presentation.

stream = null;
String result = null;
URL URLStream = new URL(xmlIn);
ByteArrayOutputStream xbaos = new ByteArrayOutputStream();
if(mStylesheet.startsWith("http"))
stream = getURLInputStream(mStylesheet);
else
stream = new FileInputStream(mStylesheet);
XSLProcessor processor = new XSLProcessor();
DOMParser parser = new DOMParser();
parser.setValidationMode(false);
parser.setPreserveWhitespace(true);
parser.parse(in);
xdoc = parser.getDocument();
XSLStylesheet xss = new XSLStylesheet(stream, URLStream);
processor.processXSL(xss, xdoc, xbaos);
result = xbaos.toString();
parser.reset();

return result; -- HTML conversion

We are evaluating using xslt to convert the XML to a form based medium for content maintenance. Wondering if once a XML document is parsed to HTML (DOM) can it be parsed back to XML for subsequent update to stored value in blob column. Specifically interested in conversion (parser) from HTML to XML

Simply can HTML (in DOM format validated against a xsd) be transformed back to XML ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 23 2002
Added on Apr 23 2002
2 comments
596 views