Transform XML in TEXT

Hello,
can anyone help me?
I want to transform an XML-Document to Text-Document.
I would store the data of this text-document in a MySql-Database.
Can you tell me if the is a possibility to do all this with java. It's possible only with XSLT and how???
Thanks,
Jonathan

there is also a possibility using xsl, but it's difficult to find tutorials about xsl (for transformation XML->text). Do anyone knows best links where i can find XSL-tutorial (XML--test)?
Regards,
Jonathan

Similar Messages

  • Transforming XML/XSLT : CDATA problem

    Hi!
    I have a problem transforming xml with XSLT using the API javax.xml.
    The result is correct until I have a CDATA section in my xml document.
    The transforming process encodes all the & < > (special characters) it finds in.
    This occurs problem for the follow of my treatement because the content of my CDATA is already encoded.
    For example, this xml code :
    <?xml version='1.0' encoding="ISO-8859-1" ?>
    <article>
    <article-contenu><![CDATA[Accent : &eacute; Signe : &lt;]]></article-contenu>
    </article>
    produces in my output :
    Accent : &amp;eacute; Signe : &amp;lt;
    This is my java code :
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Source xmlSource = new StreamSource(readerXml);
    Source xslSource = new StreamSource( fileXsl );
    // Generate the transformer.
    Transformer transformer = tFactory.newTransformer(xslSource);
    // Perform the transformation, sending the output to the response.
    transformer.transform(xmlSource, new javax.xml.transform.stream.StreamResult(sw));
    How can I tell the transformer not to do that?
    Thanks for your answers!

    I am having a similar problem. I have enclosed my text data in my xml file like this:
    <![CDATA[<b>Hello World!</b>]]>
    My select statement in my XSLT sheet is as follows:
    <xsl:value-of select="." disable-output-escaping="yes"/>
    I have tried setting xsl:output to text, to html, and to xml. The <, >, and & get converted to xhtml entities.
    Where should I begin to troubleshoot? If the Xalan xslt jars? My stylesheet. My xml doc? Java code?
    Any feedback welcome.

  • Problems in XML to text

    I'm using Xalan to perform XSLT from XML to text file.
    As I need to format the text file with carriage return at the end of every string pattern produced, I declare a variable in my XSL as a new-line character.
    It works fine if I use a XSLT GUI tool (based on MS Parser SDK) but not using Xalan parser in my Java program. Somehow the newline charache
    Here is a portion of my sample Java program:
    TransformerFactory tFactory = TransformerFactory.newInstance();
    Transformer oTransformer = tFactory.newTransformer(new StreamSource(new File("C:\\actions\\transform\\", sXSLFilename)));
    StreamSource oXMLSource = new StreamSource(
    new StringReader(new String(aData)), "C:\\xslt\\OFT_COMP.dtd");
    StreamResult oResult = new StreamResult(oStrWriter);
    oTransformer.setOutputProperty(OutputKeys.METHOD, "text");
    oTransformer.setOutputProperty(OutputKeys.ENCODING, "ISO-8859-1");
    oTransformer.setOutputProperty(OutputKeys.INDENT, "no");
    oTransformer.transform(oXMLSource, oResult);
    aOutputXMLData = oStrWriter.toString().getBytes();
    Does anybody know what's the problem? Or any other suggestions on performing this kind of "newline" separator?
    Thanks in advance.

    easiest just use a stylesheet to transform the xml to text... and use:
    <xsl:text>&#10;</xsl:text>
    for carriage return

  • How to display transformed XML in flex? xslt processor w/o javascript?

    I have a tree view with a list of links. upon clicking the links it will display its contents in an iFrame.
    some of the links in my tree are, google.com, yahoo.com, and 2 xml files, 1 of which i have transfromed into html using xsl.
    google, yahoo and the xml file which i have not transformed display successfully in the iFrame. however the xml which i have transformed does not display anything. is there another way to display html in flex? or is there a way to display a transformed xml to html in flex.
    also is there another way to to use an xslt processor in flex without having to use javascript?

    In jsp page set content type to text/xml
    <%@ page contentType="text/xml" %>

  • Transforming XML source to (X)HTML StreamResult outputs long comment

    Hi,
    I'm using javax.xml.transform.* to transform XML data into an XHTML page. The XML data represents a document (contains information about headers, paragraphs, related pages, etc.) and an XSL file is used to properly transform that data into an XHTML compatible file. All transformations go just as they should, however, the XHTML output contains a very lenthy comment about elements and attributes concerning HTML. Obviously, I do not want this comment in my final output. As a side note: I'm using a StreamSource(File) for the XML data source, a StreamSource(File) for the XSL file and a StreamResult(HttpServletResponse.getOutputStream()) for the HTML output. I'm not sure wether the problem is with using a StreamResult directly (rather than a SAXResult), or because I'm outputting directly to the servlet output stream. All input and output is in UTF-8, and the HttpServletResponse has been configured using setCharacterEncoding("UTF-8") and setContentType("text/html").
    Everything works fine, except I get this stinkin' long comment, which I want gone.
    Thanks,
    Yuthura

    I get the following result.html file (properly transformed and displayed in my browser, except for the comment):
    <!--================== Imported Names ====================================-->
    <!-- media type, as per [RFC2045] -->
    <!-- comma-separated list of media types, as per [RFC2045] -->
    <!-- a character encoding, as per [RFC2045] -->
    <!-- a space separated list of character encodings, as per [RFC2045] -->
    <!-- a language code, as per [RFC3066] -->
    <!-- a single character, as per section 2.2 of [XML] -->
    <!-- one or more digits -->
    <!-- space-separated list of link types -->
    <!-- single or comma-separated list of media descriptors -->
    <!-- a Uniform Resource Identifier, see [RFC2396] -->
    <!-- a space separated list of Uniform Resource Identifiers -->
    <!-- date and time information. ISO date format -->
    <!-- script expression -->
    <!-- style sheet data -->
    <!-- used for titles etc. -->
    <!-- nn for pixels or nn% for percentage length -->
    <!-- pixel, percentage, or relative -->
    <!-- integer representing length in pixels -->
    <!-- these are used for image maps -->
    <!-- comma separated list of lengths -->
    <!--=================== Generic Attributes ===============================-->
    <!-- core attributes common to most elements
    id document-wide unique id
    class space separated list of classes
    style associated style info
    title advisory title/amplification
    -->
    <!-- internationalization attributes
    lang language code (backwards compatible)
    xml:lang language code (as per XML 1.0 spec)
    dir direction for weak/neutral text
    -->
    <!-- attributes for common UI events
    onclick a pointer button was clicked
    ondblclick a pointer button was double clicked
    onmousedown a pointer button was pressed down
    onmouseup a pointer button was released
    onmousemove a pointer was moved onto the element
    onmouseout a pointer was moved away from the element
    onkeypress a key was pressed and released
    onkeydown a key was pressed down
    onkeyup a key was released
    -->
    <!-- attributes for elements that can get the focus
    accesskey accessibility key character
    tabindex position in tabbing order
    onfocus the element got the focus
    onblur the element lost the focus
    -->
    <!--=================== Text Elements ====================================-->
    <!-- these can occur at block or inline level -->
    <!-- these can only occur at block level -->
    <!-- %Inline; covers inline or "text-level" elements -->
    <!--================== Block level elements ==============================-->
    <!-- %Flow; mixes block and inline and is used for list items etc. -->
    <!--================== Content models for exclusions =====================-->
    <!-- a elements use %Inline; excluding a -->
    <!-- pre uses %Inline excluding big, small, sup or sup -->
    <!-- form uses %Block; excluding form -->
    <!-- button uses %Flow; but excludes a, form and form controls -->
    <!--================ Document Structure ==================================-->
    <!-- the namespace URI designates the document profile -->
    <!--================ Document Head =======================================-->
    <!-- content model is %head.misc; combined with a single
    title and an optional base element in any order -->
    <!-- The title element is not considered part of the flow of text.
    It should be displayed, for example as the page header or
    window title. Exactly one title is required per document.
    -->
    <!-- document base URI -->
    <!-- generic metainformation -->
    <!--
    Relationship values can be used in principle:
    a) for document specific toolbars/menus when used
    with the link element in document head e.g.
    start, contents, previous, next, index, end, help
    b) to link to a separate style sheet (rel="stylesheet")
    c) to make a link to a script (rel="script")
    d) by stylesheets to control how collections of
    html nodes are rendered into printed documents
    e) to make a link to a printable version of this document
    e.g. a PostScript or PDF version (rel="alternate" media="print")
    -->
    <!-- style info, which may include CDATA sections -->
    <!-- script statements, which may include CDATA sections -->
    <!-- alternate content container for non script-based rendering -->
    <!--=================== Document Body ====================================-->
    <!-- generic language/style container -->
    <!--=================== Paragraphs =======================================-->
    <!--=================== Headings =========================================-->
    <!--
    There are six levels of headings from h1 (the most important)
    to h6 (the least important).
    --> ... (more to come)

  • Problem Transforming XML to JSF tags

    I have a fealing there is something I don't know here,
    I am transforming XML into a JSP that include tags from taglib http://java.sun.com/jsf/html (prefix="h")
    This is an section from my stylesheet
    <xsl:template name="forename">
    <h:inputText>
    <xsl:attribute name="value">#{abyss.myCustomer.forename}</xsl:attribute>
    </h:inputText>
    </xsl:template>
    which transforms my XML to exactly what I expect if a was writting it directly as a jsp
    <h:inputText value="#{abyss.myCustomer.forename}"></h:inputText>
    but it still looks like this after it is rendered in the browser, and not like
    <input type="text" name="dataCapture:j_id_id199" value="Customer Name" />
    which is how it looks if I cut and paste the result of the transformation into a jsp, and run that by itself
    Does anyone have any idea was the <h:inputText does not evaluate the tag in the browser after the transformation ?
    Edited by: OB1 on Nov 23, 2007 1:46 PM
    Edited by: OB1 on Nov 23, 2007 2:43 PM

    Unfortunatly I do, my jsp is
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
    <%@ taglib prefix="x" uri="http://java.sun.com/jstl/xml_rt" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <html>
    <c:set value="${abyss.myBusinessServicePath}" var="xmldocpath"></c:set>
    <c:import url="${xmldocpath}" var="xmldoc"/>
    <c:import url="/xsl/transform.xsl" var="xslt"/>
    <x:transform xml="${xmldoc}" xslt="${xslt}"/>
    </html>

  • Problem transforming XML/XSL Using Xalan

    Hi, I am using the xalan apis to transform XML/XSL in a servlet..My servlet code is like...
    response.setContentType("text/html; charset=UTF-8");
    // Output goes in the response stream.
    PrintWriter out = response.getWriter();
    boolean environmentOK = (new org.apache.xalan.xslt.EnvironmentCheck()).checkEnvironment (out);
    try
    TransformerFactory tFactory = TransformerFactory.newInstance();
    // Get the XML input document and the stylesheet.
    Source xmlSource = new StreamSource("D:\\DATA\\jrun\\test\\test.xml");
    Source xslSource = new StreamSource("D:\\DATA\\jrun\\test\\test.xsl");
    // Generate the transformer.
    Transformer transformer = tFactory.newTransformer(xslSource);
    // Perform the transformation, sending the output to the response.
    transformer.transform(xmlSource, new StreamResult(out));
    I am getting the error ..
    javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: org.xml.sax.SAXException: Namespace not supported by SAXParserjavax.xml.transform.TransformerConfigurationException
    That's why I have added the line..
    boolean environmentOK = (new org.apache.xalan.xslt.EnvironmentCheck()).checkEnvironment (out);
    But that gives me the following error diagnostic information...
    ERROR.version.DOM=ERROR attempting to load DOM level 2 class: java.lang.NoSuchMethodException
    I have put all the 3 required classes, xml-apis.jar, xercesImpl.jar and xalan.jar in my application servers classpath..
    Please let me know what I am doing wrong..and how this can be fixed.
    Thanks
    Surajit

    hey Surajit
    Your code is unable to create a transformer from a factory instance.
    I would check why it is not creating the Transformer.On my win32 system i usee two forward slashes..to identify the file path
    D://xyz//abc....instead of D:\\...i wonder if thats one reason why your code is not able to create a transformer based on the StreamSource u create for the file paths.
    Code i use..that works
    javax.xml.transform.TransformerFactory tFactory =
                                                                javax.xml.transform.TransformerFactory.newInstance();
                                                      javax.xml.transform.Source xmlSource = new javax.xml.transform.stream.StreamSource                              (xmlInputSource);
                                                 javax.xml.transform.Source xslSource = new javax.xml.transform.stream.StreamSource
                                       (xslInputSource);
                                                                                                        // Generate the transformer.
                                                                javax.xml.transform.Transformer transformer = tFactory.newTransformer(xslSource);
                                                                                                   // Perform the transformation, sending the output to the response.
                                                                transformer.transform(xmlSource,new javax.xml.transform.stream.StreamResult(out));
                                                                                                        I used jaxp-1.2 with tomcat 4.1.12
    Hope that helps.

  • How to transform XML to access table?

    is there a example programme?
    thx

    You can transform XML to any of XML or HTML or text.
    If you want to convert the output of that transformation to rows in a database table then you could write a Java program to do that. That's nothing to do with XML though. Look for JDBC examples.

  • Transform XML and display xsl:message

    Hi,
    I have a simple method to transform XML. My XSLT has <xsl:message> to help debugging while transforming. How do I access the messages to System.out.printLn?
    public static Document transformXML(Document xmlDoc, Document xslDoc) throws XMLHelperException {
              try {
                   TransformerFactory factory = TransformerFactory.newInstance();
                   Transformer transformer = factory.newTransformer(new DOMSource(xslDoc));
                   DOMResult result = new DOMResult();
                   transformer.transform(new DOMSource(xmlDoc), result);
                   org.w3c.dom.Node resultNode = result.getNode();
                   if (resultNode instanceof Document) return (Document)resultNode;
                   else return result.getNode().getOwnerDocument();
              } catch (TransformerConfigurationException ex) {
                   throw new XMLHelperException("Unable to perform transform " + ex.getLocationAsString(), ex);
              } catch (TransformerException ex) {
                   throw new XMLHelperException("Unable to perform transform " + ex.getLocationAsString(), ex);
         }thanks for the help.
    Edited by: bonekrusher on Mar 8, 2008 2:27 PM
    Edited by: bonekrusher on Mar 8, 2008 2:27 PM

    public class XForm {
         public static void main(String[] args) throws Exception {
              InputStream xslStream = null;
              InputStream xmlStream = null;
              try {
                   TransformerFactory tf = TransformerFactory.newInstance();
                   xslStream = new BufferedInputStream(new FileInputStream(args[1]));
                   Transformer t = tf.newTransformer(new StreamSource(xslStream));
                   tf.setErrorListener(new ErrorListener() {
                        public void error(TransformerException ex) throws TransformerException {
                             ex.printStackTrace();
                        public void fatalError(TransformerException ex) throws TransformerException {
                             ex.printStackTrace();
                        public void warning(TransformerException ex) throws TransformerException {
                             ex.printStackTrace();
                   xmlStream = new BufferedInputStream(new FileInputStream(args[0]));
                   t.transform(new StreamSource(xmlStream), new StreamResult(System.out));
              } catch (Exception e) {
                   e.printStackTrace();
              } finally {
                   if (xslStream != null)
                        xslStream.close();
                   if (xmlStream != null)
                        xmlStream.close();
    <test>
         <sample try="yes">
              a
         </sample>
    </test>
    <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan">
         <xsl:template match="/">
              <xsl:message terminate="no">got here</xsl:message>
              <xsl:apply-templates/>
         </xsl:template>
         <xsl:template match="*|@*">
              <xsl:copy>
                   <xsl:apply-templates/>
              </xsl:copy>
         </xsl:template>
    </xsl:transform>          

  • How to include the first row of detail in every xquery transformed xml?

    I am dealing with a XML file,where i need to publish to different BS.
    First node will be a common node node which contains vital info,second node goes to one BS and third goes to another BS.
    *<header></header>*
    *<details></details> (they are unbounded, but the first detail tag which comes in the input file is a mandatory tag in such a way that it needs to be included in every transformed message)*
    *<trailer></trailer>*
    We need to apply x query transformation on it in such a way:
    *</header></header>*
    *<1st detail></1st detail>*
    *<detail></detail> (2nd row of detail in input file)* -------------------------> Goes to BS1
    *<trailer></trailer>..*
    *<header></header>*
    *<1st detail></1st detail>*
    *<detail></detail> (3rd row of detail in input file)* ----------------------------->Goes to BS2
    *<trailer></trailer>*..
    And so on.
    Now, the problem is how to include the first row( *1st detail* ) of detail in every xquery transformed xml?

    are you looping of this input with a for each?
    /yourdata/details[1] should return always the first detail element.
    or before the for each do an assing of this first detail element to "generic_details_var"
    and use this var in every looping iteration (in an assign or as input for xquery)

  • Help Please ! -- transform XML to HTML using xslt tag in JSP

    Hello,
    I have problem to do XSL transform in JSP.
    I have an XSL : test.xsl
    I have an XML : test.xml
    In JSP I have:
    <x:xslt media="html" xml="test.xml">
    <x:stylesheet media="html" uri="test.xsl" />
    </x:xslt>
    But It doesn't work the way it suppose to. What is wrong in my code ? I followed the URL http://e-docs.bea.com/wls/docs81/xml/xml_apps.html
    Thanks in advance,
    Christina

    Basically:
        try{
          //Setting up parameters.
          xml=new StreamSource(new File(xmlInput));
          xsl=new StreamSource(new File(xslInput));
          baos=new ByteArrayOutputStream();
          htmlResult=new StreamResult(baos);
          //Transform input(xml, xsl) onto html output.
          TransformerFactory tfactory=TransformerFactory.newInstance();
          Transformer transformer=tfactory.newTransformer(xsl);
          transformer.transform(xml, htmlResult);
          baos.writeTo(out);
          //System.err.println(htmlResult.getOutputStream().toString());
        catch(...){
        }I havent tested and I havent use this for a while, but I hope this can serve as a staring point.
    Regards,
    OO

  • How to merge multiple XML or Text documents into 1 Word Document?

    Hi all,
    We're looking for a way to merge multiple XML or Text documents into 1 Word document.
    All the XML or Text documents are oriented as a 'Paragraph', meaning smaller pieces of text.
    By selecting some of these XML documents, the system should be able to create a new Word document with all the selected text paragraphs included.
    The Word document can then be edited for applying a correct lay-out and the document is ready.
    Actually, we are trying to do some kind of 'mail merge' but with multiple XML or Text documents!
    Has anybody an idea whether something exist already or give us a direction how to proceed?
    Thanks in advance,
    Pascal Decock

    You use Assembler for this purpose.
    1) Assembler can be accessed through LC Java API. See http://help.adobe.com/en_US/enterpriseplatform/10.0/programLC/help/index.html
    API Quick Starts (Code Examples) > Assembler Service API Quick Starts
    2) Last week I posted on generating and merging PDF's from PostScript. Take a look at the assembly service instance in the .lca. Assembler uses DDX (Document Description XML) to describe document construction. NOTE the .lca was developed with ES 3 (aka ADEP). The .lca It contains the most basic DDX.
    <?xml version="1.0" encoding="UTF-8"?>
    <DDX xmlns="http://ns.adobe.com/DDX/1.0/">
    <PDF result="out.pdf">
      <PDF source="inDoc1"/>
      <PDF source="inDoc2"/>
    </PDF>
    </DDX>
    http://forums.adobe.com/message/4019760#4019760
    DDX Reference at http://help.adobe.com/en_US/livecycle/9.0/ddxRef.pdf
    Steve

  • Transforming XML Data with XSLT in a servlet

    Trying to transform XML data using XSLT. The following code works fine outside of a servlet. But in a servlet it gives the following error :
    * Transformer Factory error
    javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: org.xml.sax.SAXException: Namespace not supported by SAXParser
    javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: org.xml.sax.SAXException: Namespace not supported by SAXParser
         at org.apache.xml.utils.DefaultErrorHandler.fatalError(DefaultErrorHandler.java:257)
         at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:813)
         at TransformationApp.XSLTTransformServlet.MyTransform(XSLTTransformServlet.java:79)
         at TransformationApp.XSLTTransformServlet.doGet(XSLTTransformServlet.java:39)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
         at org.apache.tomcat.core.Handler.service(Handler.java:287)
         at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
         at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
         at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
         at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
         at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
         at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
         at java.lang.Thread.run(Thread.java:484)
    Several articles hinted at setting the factory namespace attribute to TRUE. I have tried that but same results. Here is the code :
    static Document document;
    DocumentBuilderFactory factory =
    DocumentBuilderFactory.newInstance();
    //factory.setNamespaceAware(true);
    //factory.setValidating(true);
    try {
    File stylesheet = new File(argv[0]);
    File datafile = new File(argv[1]);
    DocumentBuilder builder = factory.newDocumentBuilder();
    document = builder.parse(datafile);
    // Use a Transformer for output
    TransformerFactory tFactory =
    TransformerFactory.newInstance();
    StreamSource stylesource = new StreamSource(stylesheet);
    Transformer transformer = tFactory.newTransformer(stylesource);
    DOMSource source = new DOMSource(document);
    StreamResult result = new StreamResult(System.out);
    transformer.transform(source, result);
    } catch (TransformerConfigurationException tce) {
    // Error generated by the parser
    System.out.println ("\n** Transformer Factory error");
    System.out.println(" " + tce.getMessage() );
    // Use the contained exception, if any
    Throwable x = tce;
    if (tce.getException() != null)
    x = tce.getException();
    x.printStackTrace();
    } catch (TransformerException te) {
    // Error generated by the parser
    System.out.println ("\n** Transformation error");
    System.out.println(" " + te.getMessage() );
    // Use the contained exception, if any
    Throwable x = te;
    if (te.getException() != null)
    x = te.getException();
    x.printStackTrace();
    } catch (SAXException sxe) {
    // Error generated by this application
    // (or a parser-initialization error)
    Exception x = sxe;
    if (sxe.getException() != null)
    x = sxe.getException();
    x.printStackTrace();
    } catch (ParserConfigurationException pce) {
    // Parser with specified options can't be built
    pce.printStackTrace();
    } catch (IOException ioe) {
    // I/O error
    ioe.printStackTrace();
    Any help would be greatly appreciated.

    I don't know that this is true, but i think the problem is the classpath.
    The runtime has his own parser. This parser is befor your xalan.lib in the classpath and the
    parser from the runntime don't support namespace.
    Try Tomcat 4.
    Regard Dietmar

  • Failed transformation xml-rfc to rfc

    Hi,
    I have to scenario rfc to jdbc sync, SAP MI <-> XI, but when I executed the rfc, i don´t have problem in SXMB-MONI,  but returned the dump in MI " Failed transformation xml-rfc to rfc". What happen?
    Tks.

    The error isnt logged in SMXB_MONI because it happens in Adapter Engine, which is in java stack (and SXMB_MONI is in abap stack). Therefore you won't be able to see the error there.
    Go to Runtime WorkBench, Message Monitoring and check the errored message there. Open the details screen and check the Audit Log for futher information about the error you got.
    Regards,
    Henrique.

  • Transform XML Docs

    I have two XMLType tables and would like to transform the data from both of these tables and end up with one xmldocument and returned by a query.
    It appears that there are several ways to accomplish this.
    1. Write a query that uses xmlelement, xmlforest, etc. functions.
    2. Use XMLQuery to accomplish this
    3. Use XSLT.
    I would like to use XSLT but I can't seem to figure out how to access the conents of one XMLTable from within a stylesheet. I know the document function is for opening files but I need the data to come from a XMLTable.
    I am currently using 10.2.0.3
    Thanks

    Hi,
    I was looking for something similar a few days ago and found 'CardPaymentGatewayApplication' in the sample code page for XMLDB.
    I pasted a few lines of the SQL code from CPGA below. If it looks useful and need more details then you might want to download the code from http://www.oracle.com/technology/sample_code/tech/xml/xmldb/cpga/index.html
    -Uma
    1) register the XML schema
    declare
    doc varchar2(2000) := '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb
    ">
    <xs:element name="ACCOUNT">
    </xs:element>
    </xs:schema>';
    begin
    dbms_xmlschema.registerSchema('http://otn.oracle.com/account.xsd', doc);
    end;
    2) create XMLType table
    CREATE TABLE CPG_ACCOUNTS of XMLType
    XMLSCHEMA "http://otn.oracle.com/account.xsd"
    ELEMENT "ACCOUNT";
    3) Insert some values into the table
    accxmldoc := XMLType.CREATEXML('
    <ACCOUNT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://otn.oracle.com/account.xsd">
    </ACCOUNT>');
    INSERT INTO cpg_accounts VALUES(accxmldoc);
    4) create table to store the XSL files
    CREATE TABLE CPG_XSL_TABLE(
    FILENAME VARCHAR2(30) Unique ,
    XSLDOC XMLTYPE
    5) load the XSL stylesheet
    DECLARE
    xslsheet CLOB;
    xmldoc XMLType;
    BEGIN
    xslsheet := '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www
    .w3.org/1999/XSL/Format">
    <xsl:template match="EMPTY">
    xmldoc:= XMLType.createXML(xslsheet);
    INSERT INTO cpg_xsl_table VALUES ('updateAccountCard.xsl',xmldoc);
    END;
    6) sample transformation
    FUNCTION getAccountDetailsHTML(accNo IN NUMBER) RETURN CLOB IS
    -- Define the local variables
    xslFile XMLTYPE;
    acctXML XMLTYPE;
    html XMLTYPE;
    BEGIN
    -- Retreive the XMLType account details into the 'acctXML' variable.
    SELECT value(t) INTO acctXML
    FROM cpg_accounts t
    WHERE extractValue(value(t),'/ACCOUNT/ACC_NO') = accNo;
    -- Retreive the XSLT stylesheet from the database that needs to be applied
    -- to the 'acctXML' value retreived above.
    SELECT xsldoc INTO xslFile FROM cpg_xsl_table
    WHERE filename='account.xsl';
    -- Apply the XMLtype.transform() function to get the transformed XML instance.
    -- This function takes in an XMLType instance and an XSLT stylesheet.
    -- It applies the stylesheet to the XML document and returns a transformed
    -- XML instance.
    html := acctXML.transform(xslFile);
    -- Return the transformed XML instance as a CLOB value.
    RETURN html.getCLOBVal();
    END getAccountDetailsHTML;

Maybe you are looking for