Getting HTML string out of DOM tree

after i apply XSL transformation to an XML document, i get a
DOM tree as a result.
how do i extract the HTML from that tree as a string? lotus xsl
lets you pass a PrintWriter to XSLProcessor -- how can I use the
DocumentFragment for that same thing?
thank you very much,
zak.
null

zak may (guest) wrote:
: : At this point we do not support xsl:output so you the only
way
: : to get printed output at this point is to use the DOM print
: : method. xsl:output will be supported in a future release.
: that's great -- but which "DOM print method" are you reffering
: to?
: neither DocumentFragment, nor Document, nor Node have a print
: method.
: my question remains -- how do I get at the HTML result of an
XSL
: transformation? XSLProcessor.processXSL returns a
: DocumentFragment -- how do I print that DocumentFragment,
markup
: tags and all?
: thank you very much,
: zak.
Both XMLDocument and XMLNode have a variety of print methods.
None of them will transform XML into HTML however.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
null

Similar Messages

  • How to get html code out of psd file????

    Hi, I have PS CS6, and just try to work with brackets. Because I can`t extract psd files in my ps version, did it with project parfait. Then I`ve sended that file or better copied the public link into brackets and found my psd file extracted in layers in there. What I miss is the html code, which I`m desperately looking for. So how do I get an html code out of that psd file to create a webpage with brackets, without buying a new ps version...  thanks a lot in advance !

    If you not too familiar with html, you can use the save as web command. When you open the dialog box, towards the bottom you will find preview in Brower. First it will show you the image, but if you scroll down you will see the sample html that was used to create that image in the browser.
    If you need to break it up some you can use slices. Each slice will be its own image.
    The html needs to point to that image on the server.
    This means you need to upload the html and all images to a server. It also means that you will need to manually edit the html so that it has the correct folder location on the server so it can find the images.
    It is one thing to make it work on your computer, it is another story to make sure it works from a server. Usually a typo is what keeps it from working correctly. So pay attention to the url, folders and file names. Keep in mind that folders and files are case sensitive.
    Good luck.

  • How to get complete String out of ResultSet

    I have the following problem. I have some texts which are stored in a database (VARCHAR). These strings can be quite long, but it seems that I can only get 255 characters out of the database. I've tried using the getString(), getAsciiStream() or getCharacterStream() method, but none of them returns more than 255 characters of the string actually stored in the database. It seems that the ResultSet only contains 255 characters.
    I've checked this forum but I can't really find a solution. Thanks very much.
    Message was edited by:
    harmen

    I use jConnect to connect to a Sybase database. The texts are read from a file and stored in the database. There's no problem there (no limit on 255 characters). Only while retreiving them with 'select' statements there seems to be some kind of limit on the amount of bytes/characters returned.

  • How do i get a String out of an ArrayList?

    I was trying to make a list I could grow and I was informed that arrays couldn't grow, an ArrayList was suggested.
    This seems like it will work perfectly except for the fact that I can't retrieve a String from the ArrayList.
    I'm getting errors like incompatible type String:Object or expected:[] found ArrayList.
    I tried .toString but that just gives me a bunch of giberish.
    Any advice would be most welcome.
    Thanks in advance,
    Hans.

    Ok, so, i guess here is some code you can run, it should run.
    I guess I want to know how to get each individual string out of the list one at a time.
    package arraylistone;
    import javax.swing.JFrame;
    import java.util.ArrayList;
    import javax.swing.JLabel;
    public class Main extends JFrame
                JLabel label = new JLabel();
                ArrayList list = new ArrayList();
        public Main()
            String str = "test";
            String str2 = "test2";
            list.add(str);
            list.add(str2);
            label.setText("Not Working");
            label.setText(list.toArray().toString());
                    getContentPane().add( label);
        public static void main(String[] args)
            Main frame = new Main();
            frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
            frame.pack();
            frame.setLocationRelativeTo( null );
            frame.setVisible(true);
    }

  • XML : Transform DOM Tree to XML String in an applet since the JRE 1.4.2_05

    Hello,
    I build a DOM tree in my applet.
    Then I transform it to XML String.
    But since the JRE 1.4.2_05 it doesn't work.
    These lines failed because these variables became final:
    org.apache.xalan.serialize.CharInfo.XML_ENTITIES_RESOURCE = getClass().getResource("XMLEntities.res").toString();
    org.apache.xalan.processor.TransformerFactoryImpl.XSLT_PROPERTIES = getClass().getResource("XSLTInfo.properties").toString();The rest of the code :
    DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder = domFactory.newDocumentBuilder();
    Document domXML = builder.newDocument();
    // I build my DOM Tree
    StringWriter xmlResult = new StringWriter();
    Source source = new DOMSource(domXML);
    Result result = new StreamResult(xmlResult);
    Transformer xformer = TransformerFactory.newInstance().newTransformer();
    xformer.setOutputProperty(javax.xml.transform.OutputKeys.INDENT,"yes");
    xformer.transform(source,result);Is there any other way to get an XML String from a DOM tree in an applet ?
    I'm so disappointed to note this big problem.

    Does anyone have an idea why I get this error message when try to use transform in an applet?
    Thanks...
    java.lang.ExceptionInInitializerError
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at org.apache.xalan.serialize.SerializerFactory.getSerializer(Unknown Source)
         at org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(Unknown Source)
         at org.apache.xalan.transformer.TransformerIdentityImpl.transform(Unknown Source)
         at matrix.CreateMtrx.SaveDoc(CreateMtrx.java:434)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at thinlet.Thinlet.invokeImpl(Unknown Source)
         at thinlet.Thinlet.invoke(Unknown Source)
         at thinlet.Thinlet.handleMouseEvent(Unknown Source)
         at thinlet.Thinlet.processEvent(Unknown Source)
         at java.awt.Component.dispatchEventImpl(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
         at java.awt.Container.dispatchEventImpl(Unknown Source)
         at java.awt.Component.dispatchEvent(Unknown Source)
         at java.awt.EventQueue.dispatchEvent(Unknown Source)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
         at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.RuntimeException: The resource [ XMLEntities.res ] could not load: java.net.MalformedURLException: no protocol: XMLEntities.res
    XMLEntities.res      java.net.MalformedURLException: no protocol: XMLEntities.res
         at org.apache.xalan.serialize.CharInfo.<init>(Unknown Source)
         at org.apache.xalan.serialize.SerializerToXML.<clinit>(Unknown Source)
         ... 28 more

  • Generating XML from DOM tree

    Hello,
    I am trying to generate a XML file from a DOM tree. This facility is there in IBM parser.
    But anyone can help me out in generating a XML file or string from a DOM tree using the Crimson parser provided by default in JDK 1.4.0
    Thank you

    The only way I know is to use JDOM (which provides a output package).
    You can build a JDOM tree starting from your DOM tree, and then output this JDOM tree in an XML file.
    Hope it will help.

  • Trying to get the string from javax.xml.transform.Source

    I have a SOAP client that will submit a string of data to a url and return an xml string back. It works ok besides that last part.
    I found on another site someone took the returned XML and printed it to the system print box. I want to just get the string out to a variable to pass back..
    This chunk works:
    TransformerFactory tff = TransformerFactory.newInstance();
    Transformer tf = tff.newTransformer();
    Source sc = rp.getSOAPPart().getContent();
    StreamResult result = new StreamResult(System.out);
    tf.transform(sc, result);
    System.out.println();Instead of this I just want to catch the XML string in a String variable. Thanks for the help.

    Instead of giving your StreamResult System.out, give it a StringWriter. You can then call toString on the StringWriter, and get what you're after
    StringWriter output = new StringWriter();
    TransformerFactory.newInstance().newTransformer().transform(source, new StreamResult(output));
    String xmlResult = output.toString();

  • How to get a string of an HTML element

    Imagine a normal web page with its tags. I have to get the
    value of a precise element and convert it to a String in order to
    show it in a TextField. Specifically, I have to take a precise cell
    of a table and insert it in a string.
    Does AIR help me with some method that catches specific
    elements of a HTML code or have I to parse the string of the entire
    HTML and try to reach the wanted value?
    In this last case, how do I convert the entire HTML of a page
    into a string?
    Any other ideas are welcome.
    Thanks.

    quote:
    Originally posted by:
    Marco Sgna
    Does AIR help me...
    No, but I don't see that it has to. I presume
    you're writing an AIR app with HTML and JavaScript. If so, you can
    query and modify the HTML's DOM tree with JavaScript. Then, still
    using JavaScript, you pass it off to the AIR side, using the "AIR
    aliases" APIs. So:
    <table><tr><td
    id="foo">bar</td></tr></table>
    <script>var mycontent =
    document.getElementById('foo').innerHTML; // variable equals "bar"
    now</script>
    quote:
    how do I convert the entire HTML of a page into a string?
    document.toString(), perhaps.

  • Out of Memory error while builng HTML String from a Large HashMap.

    Hi,
    I am building an HTML string from a large map oject that consits of about 32000 objects using the Transformer class in java. As this HTML string needs to be displayed in the JSP page, the reponse time was too high and also some times it is throwing out of memory error.
    Please let me know how i can implement the concept of building the library tree(folder structure) HTML string for the first set of say 1000 entries and then display in the web page and then detect an onScroll event and handle it in java Script functions and come back and build the tree for the next set of entries in the map and append this string to the previous one and accordingly display it.
    please let me know whether
    1. the suggested solution was the advisable one.
    2. how to build tree(HTML String) for a set of entries in the map while iterating over the map.
    3. How to detect a onScroll event and handle it.
    Note : Handling the events in the JavaScript functions and displaying the tree is now being done using AJAX.
    Thanks for help in Advance,
    Kartheek

    Hi
    Sorry,
    I haven't seen any error in the browser as this may be Out of memory error which was not handled. I got the the following error from the web logic console
    org.apache.struts.actions.DispatchAction">Dispatch[serviceCenterHome] to method 'getUserLibraryTree' returned an exceptionjava.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276)
         at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:196)
         at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
         at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
         at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
         at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:996)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)
         at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:315)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6452)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
         at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3661)
         at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2630)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
    Caused by: java.lang.OutOfMemoryError
    </L_MSG>
    <L_MSG MN="ILHD-1109" PID="adminserver" TID="ExecuteThread: '14' for queue: 'weblogic.kernel.Default'" DT="2012/04/18 7:56:17:146" PT="WARN" AP="" DN="" SN="" SR="org.apache.struts.action.RequestProcessor">Unhandled Exception thrown: class javax.servlet.ServletException</L_MSG>
    <Apr 18, 2012 7:56:17 AM CDT> <Error> <HTTP> <BEA-101017> <[ServletContext(id=26367546,name=fcsi,context-path=/fcsi)] Root cause of ServletException.
    *java.lang.OutOfMemoryError*
    Please Advise.
    Thanks for your help in advance,
    Kartheek

  • How do I get the selected value only out of a tree control?

    If I use the value property and create an indicator, it gives me another tree, not an array of selected values...I can use an event structure to get it with a CV Event using the new value terminal but I know that there must be a simpler, better way.  Can anyone answer this one quickly?

    Check out the "Family Tree.vi" example that ships with LV.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Cannot get questionnaire HTML string SAP CRM 7.0  EHP3

    Hello,
    We are trying to use questionnaires in Activities and it doesn't work.
    This error : Cannot get questionnaire HTML string is shown.
    I checked  Note 1600561 - Changes done in values template XSLT not taken into account, but it isn't valid for our release ( EHP3 )
    Thanks in advance for your help.
    Belén

    Hi,
    We used the questionnaires (questionnaires was displayed and worked) but we faced issues with the display in web UI (only when the questionnaires are linked to an activity/opportunity). The Admin screen for questionnaire works well).
    We have implemented the following notes in order to correct this displaying issues :
    - 1858059 : Upload the CRM_SVY_GENERATE_BSP_TEMPLATE.ZIP, refresh cash and generate all surveys
    And then notes mentioned above
    - 1914885 & 1944288 in the relevant order.
    But we cannot display anymore the existing surveys (They are active, all scenarios are flagged).
    Error message : Cannot get questionnaire HTML string
    Any Ideas how to proceed to solve ? (we work on EHP2)

  • How to get String out of  void method

    I have a problem to get String out of void method. I override method actionPerformed(), and I need to use String from this method in other methods. I get nothing in smth. Can anyone help me with this.
    class
    StringBuffer smth = new StringBuffer();
    StringBuffer s;
          public void actionPerformed(ActionEvent event){
              String vnos;
              if(event.getSource() == btn_vnos){
                   input = field.getText();
                   s = new StringBuffer(input);
                    smth = s;
                }             Thanks

    You have needs to use a static variable or somehow pass an instance reference, through a list or array or some such thing, perhaps through the constructor. Or think up some other jazz, like adding a method "public String getMyStinkin'String" ;~)
    ~Cheers

  • Getting the absolute text position from a DOM tree

    Does anybody knows how to get the absolute text position of a node inside the DOM tree? Is there any DOM implementation that keep track of the absolute text position of each Node element or I need to overload somo methods by hand?
    Regards,
    Daniel Oliveira

    The position() function in XSLT returns the order of the element.
    For an xml document with elements:
    <a>
    <b></b>
    <b></b>
    </a>
    <xsl:apply-templates select="b"/>
    <xsl:template match="b">
    Element b:
    <xsl:value-of select="position()"/>
    </xsl:template>

  • DOM tree for HTML

    Hello,
    How can I create DOM tree for HTML pages with java.
    Can anybody tell me about good examples or relevant material for this.
    Thanks
    Tabbasum

    JTidy. Rhino.

  • Get HTML page content as string in BPEL

    Hi!
    I would like to get HTML page content as string in BPEL via partnerLink.
    So, I define WSDL file for this partnerLink:
    <definitions targetNamespace="urn:GetSummaryContent"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="urn:GetSummaryContent"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/">
    <message name="MarkMessageAsReadHttpGetIn">
    <part name="webid" type="xsd:string"/>
    </message>
    <message name="MarkMessageAsReadHttpGetOut">
    <part name="Body" type="xsd:anyType"/>
    </message>
    <portType name="getHtmlPageGet">
    <operation name="getHtmlPage">
    <input message="tns:MarkMessageAsReadHttpGetIn"/>
    <output message="tns:MarkMessageAsReadHttpGetOut"/>
    </operation>
    </portType>
    <binding name="MessagingHttpGet" type="tns:getHtmlPageGet">
    <http:binding verb="GET"/>
    <operation name="getHtmlPage">
    <http:operation location=""/>
    <input>
    <http:urlEncoded/>
    </input>
    <output>
    <mime:content type="text/html" part="Body"/>
    </output>
    </operation>
    </binding>
    <service name="Messaging">
    <port name="MessagingHttpGet" binding="tns:MessagingHttpGet">
    <http:address location="http://server:port/app-context-root/sss.xsql"/>
    </port>
    </service>
    </definitions>
    As a result I got bindingFault: [email protected]9b : Could not find binding output for operation getHtmlPage
    Could You help me to solve this trouble?
    Have You any solution?
    Thank You.

    What are you trying to accomplish?

Maybe you are looking for

  • Apple iPhone 3G Dock + Apple Composite AV Cable

    Trying to use an Apple Composite AV Cable (MB129LL/B) on a Apple iPhone 3G Dock (MB484G/A) connected to a LCD: No go (regarding video out) so far - is it only me? Has someone got this working together?

  • Can I import a PDF from a URL?

    If I have a URL to a PDF, how can I import that into my Acrobat.com files?

  • Startprobleme bei CC

    Beim Start von CC aus der Menuleiste heraus erscheint fast immer die Meldung :"Der Prozedureinsprungpunkt... wurde nicht gefunden." Ähnliches auch manchmal aus Lightroom. Die Verbindung zwischen NIK software und CC ist nicht möglich. Auch der vor kur

  • Call forwarding conditional

    when i try to ring on my phone this message appears on my phone, i cant hear no ring tone and cant hear when im connected,it comes up as call forwarding conditional,,,, how do i get this off and be able to call people on my phone ..... thanks

  • Merge two partitions OS X Yosemite?

    I have two partitions on my Mac Mini (late 2012) fusion drive 1.12 TB. I deleted all the files on Macintosh HD. Now I would like to merge Macintosh HD with Macintosh HD2. How can I do this? Thanks