Transform xml in column

Hi,
I wrote a Clr who returns an SqlXml object that i need to transform,
here's the query and the result i have
Select top 1 id_RefPdr, RefCln, Ncl, IT.dbo.Clr_NclSplitByMask(MasqeTri, Ncl, AM_R2.dbo.FN_NCL_NCLUNQPOS(Ncl))
From dbo.REFS_PDR
Where LibRef = 'Amortisseur'
the result:
69 27A890
Hydraulique; Bitube; Automatique; Données PSE30/13X100A; Oeil/Tige; Vérin
<DocumentElement><dtaMask><_x0032_8>-</_x0032_8><_x0032_8.5>PREMIUM</_x0032_8.5><Hydraulique>Hydraulique</Hydraulique><GAZ>-</GAZ><Bitube>Bitube</Bitube><Monotube>-</Monotube><Inf._x002A__x002F_Sup_x002A_>-</Inf._x002A__x002F_Sup_x002A_><Inf._x002A_>-</Inf._x002A_><Sup._x002A_>-</Sup._x002A_><L._x0040_mm.>-</L._x0040_mm.><L._x0040__x002F__x0040_mm.>-</L._x0040__x002F__x0040_mm.><D._x0040_mm.>-</D._x0040_mm.><D1._x0040_mm.>-</D1._x0040_mm.><D2._x0040_mm.>-</D2._x0040_mm.><D.Tige_x0020__x0040_mm.>-</D.Tige_x0020__x0040_mm.><D.Oeil_x0020__x0040_mm.>-</D.Oeil_x0020__x0040_mm.><Larg.Oeil_x0020__x0040_mm.>-</Larg.Oeil_x0020__x0040_mm.><Larg1._x0040_mm.>-</Larg1._x0040_mm.><Larg2._x0040_mm.>-</Larg2._x0040_mm.><HorsMasque>Automatique;
Données PSE30/13X100A; Oeil/Tige; Vérin</HorsMasque></dtaMask></DocumentElement>
The xml is a one row datatable with multiple columns.
What I want to do is to get the result like this
69 1020
27A890 Hydraulique; Bitube; Automatique; Données PSE30/13X100A; Oeil/Tige; Vérin
Hydraulique -
Bitube -
Automatique; Données PSE30/13X100A; Oeil/Tige; Vérin
Is there a simple method to do that or do i need to reconsider my approach.
Any help would be appreciated

The format which you have posted is not readable.
Refer the below example,
declare @x xml
set @x='<propertyList date="2013-05-21-09:13:38">
<residential modTime="2013-05-21-09:13:39" status="sold">
<agentID>a1fa</agentID>
<uniqueID>2152459</uniqueID>
<buildingDetails>
- <listingAgent id="1">
<name>David </name>
<telephone type="BH">49666</telephone>
<telephone type="mobile">238394</telephone>
<email>[email protected]</email>
</listingAgent>
- <listingAgent id="2">
<name>Bryan</name>
<telephone type="BH"> 499 1666</telephone>
<telephone type="mobile">344 2630</telephone>
<email>[email protected]</email>
</listingAgent>
</buildingDetails>
</residential>
</propertyList>'
select t.u.value ('../name[1]','varchar(10)') as name,
t.u.value ('./@type','varchar(30)') as telephonetype,
t.u.value ('.','varchar(30)') as telephone,
t.u.value ('../email[1]','varchar(30)') as email
from @x.nodes('/propertyList/residential/buildingDetails/listingAgent/telephone') t(u)
Regards, RSingh

Similar Messages

  • (updating xml value)adding an element in an xml type column

    Hi all,
    i hava a table that contains an xml-Type column (non schema based)
    i have inserted some data in it
    table:(id,xmlcolumn)
    ex:
    insert into t1 values(1,'<Chapters>
    <Chapter>ch1<Chapter>
    <Chapter>ch2<Chapter>
    </Chapters>')
    i need to add a new Chapter: <Chapter>ch3</Chapter>
    for the result of xml instance in the table to be:
    <Chapters>
    <Chapter>ch1<Chapter>
    <Chapter>ch2<Chapter>
    <Chapter>ch3<Chapter>
    </Chapters>
    plz if any one colud help

    SQL> DECLARE
      2      l_xml      XMLTYPE := XMLTYPE('<Chapters>
      3  <Chapter>ch1</Chapter>
      4  <Chapter>ch2</Chapter>
      5  </Chapters>');
      6      l_xsl      XMLTYPE;
      7      l_new_node VARCHAR2(100) := '<Chapter>ch3</Chapter>';
      8  BEGIN
      9      dbms_output.put_line('Before adding node:');
    10      dbms_output.put_line('----------------------------------------------------------------');
    11      dbms_output.put_line(l_xml.getStringVal());
    12      dbms_output.put_line('----------------------------------------------------------------');
    13      l_xsl := XMLTYPE('<?xml version="1.0"?>' ||
    14                       '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"' ||
    15                       ' version="1.0"' || ' result-ns=""' || ' indent="no">' ||
    16                       '<xsl:output method="xml" media-type="text/xml" indent="no"/>' ||
    17                       '<xsl:template match="/">' ||
    18                           '<' ||l_xml.getRootElement() || '>' ||
    19                               ' <xsl:for-each select="/' || l_xml.getRootElement() ||'/Chapter">' ||
    20                                   '<xsl:copy-of select="." />' ||
    21                               '</xsl:for-each>' ||
    22                               l_new_node ||
    23                           '</' || l_xml.getRootElement() || '>' ||
    24                       '</xsl:template>' ||
    25                       '</xsl:stylesheet>');
    26      l_xml := l_xml.Transform(l_xsl);
    27      dbms_output.put_line('After adding node:');
    28      dbms_output.put_line('----------------------------------------------------------------');
    29      dbms_output.put_line(l_xml.getStringVal());
    30      dbms_output.put_line('----------------------------------------------------------------');
    31  END;
    32  /
    Before adding node:
    <Chapters>
    <Chapter>ch1</Chapter>
    <Chapter>ch2</Chapter>
    </Chapters>
    After adding node:
    <Chapters>
      <Chapter>ch1</Chapter>
      <Chapter>ch2</Chapter>
      <Chapter>ch3</Chapter>
    </Chapters>
    PL/SQL procedure successfully completed.
    SQL>

  • Inserting a row in a schema-based xml type column

    i have problems while inserting a row in a schema-based xml type column
    it reports an error(schema and elemnt do not match)
    although they are matching if anyone can try it
    and if it worked plz send me the example

    SQL> DESC XML_TAB;
    Name Null? Type
    XML XMLTYPE
    SQL> INSERT INTO XML_TAB
    2 VALUES
    3 (xmltype('<request>
    4 <filter>(extshortname=bhagat)</filter>
    5 <attributes>dn</attributes>
    6 <context/>
    7 <scope>subtree</scope>
    8 </request>'));
    1 row created.
    If your problem persists,post ur lines of code..
    Good luck!!!
    Bhagat

  • 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.

  • 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

  • Transform data into columns

    hello
    i would like to transform rows into columns and need your help
    i have
    table orders
    where we have two columns
    orderid,orderdate
    orderid     order_date
    1234     9/10/2009
    4555     10/1/2009i have order_codes
    have 3 columns
    orderid
    desc
    value
    data for order _codes
    orderid     desc     value
    1234     ch_code1     5789
    1234     ch_date     10/20/2009
    1234     ch_miscval     678.9
    1234     ch_charge     765
    4555     ch_code1     9999
    4555     ch_date     10/0/2009
    4555     ch_miscval     78.9now
    i need to transform data like this
    orderid ==     ch_code1      ==ch_date ==     ch_miscval ==     ch_charge ==     order_date
    1234 ==     5789 ==     10/20/200  ==    678.9 ==     765      == 9/10/2009
    4555 ==     9999 ==     10/1/2009      == 78.9 ==     ---      == 10/1/2009any help is appreciated
    thank you
    Edited by: vg on Nov 2, 2010 9:47 AM

    try this. Hope this helps
    /* Formatted on 2010/11/02 13:29 (Formatter Plus v4.8.8) */
    WITH order_desc AS
         (SELECT 1234 orderid, 'ch_code1' descp, '5789' VALUE
            FROM DUAL
          UNION ALL
          SELECT 1234, 'ch_date', '10/20/2009'
            FROM DUAL
          UNION ALL
          SELECT 1234, 'ch_miscval', '678.9'
            FROM DUAL
          UNION ALL
          SELECT 1234, 'ch_charge', '765'
            FROM DUAL
          UNION ALL
          SELECT 4555, 'ch_code1', '9999'
            FROM DUAL
          UNION ALL
          SELECT 4555, 'ch_date', '10/0/2009'
            FROM DUAL
          UNION ALL
          SELECT 4555, 'ch_miscval', '78.9'
            FROM DUAL),
         order_t AS
         (SELECT 1234 orderid, SYSDATE order_date
            FROM DUAL
          UNION ALL
          SELECT 4555, SYSDATE
            FROM DUAL)
    SELECT   a.orderid, MAX (DECODE (descp, 'ch_code1', VALUE, NULL)) ch_code1,
             MAX (DECODE (descp, 'ch_date', VALUE, NULL)) ch_date,
             MAX (DECODE (descp, 'ch_miscval', VALUE, NULL)) ch_miscval,
             MAX (DECODE (descp, 'ch_charge', VALUE, NULL)) ch_charge,
             MAX (DECODE (descp, 'order_date', VALUE, NULL)) order_date
        FROM order_desc a, order_t b
       WHERE a.orderid = b.orderid
    GROUP BY a.orderid
    Output
       ORDERID CH_CODE1   CH_DATE    CH_MISCVAL CH_CHARGE  ORDER_DATE
          1234 5789       10/20/2009 678.9      765                 
          4555 9999       10/0/2009  78.9                            Edited by: new learner on Nov 2, 2010 10:30 AM

  • 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.

  • 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>

  • 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;

  • 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

Maybe you are looking for

  • How many devices can I log my itunes account

    I was just wondering how many devices I can login into my itunes account for. Purpose is to install apps that I purchased onto family members Ipod touches and an Ipad. I do not need to plug into computer just want to login to app store and install.

  • Real simple xslt problem/question

    Hi, i have a real simple xslt problem but i just cant figure out how to do it by looking at various examples on the net. i have a xml document and in it are some elements with a "result" tag name. i want to use xslt to reproduce exactly the same xml

  • Fetch query data in ABAP

    Hi We are trying to execute a BW query using the RRW3_GET_QUERY_VIEW_DATA function module but when I test the function module I'm getting the data expected. My query is a simple query returning the cost center hierarchy that my authorizations give me

  • Using OpenGL ES in an AIR native extension on iPad

    Hi, I am trying to find out whether I can render images using iPad GPU from a native extension loaded by an AIR application on iPad. The main reason for this is that I need every bit of GPU power in my AIR application and I cannot use Stage3D (see ht

  • Can IPhoto Library Version 9.2.3 work on snow leopard

    Can Iphoto Library Version 9.2.3 work on snow leopard?