XML -- XSLT -- XML -- Text: Java

Why is the following not working for me? I want to get rid of the "<root>" text in the output. Also I use <xsl:text>&#xA;</xsl:text> in the stylesheet to produce a new line but that cannot be found in the output? Thank you in advance.
Zaid
<pre>
// Process XSL
DocumentFragment result = processor.processXSL(xsl, xml);
// create an output document to hold the result
out = new XMLDocument();
// append the transformed tree to the dummy document element
out.appendChild(result);
// print the transformed document
out.print(System.out);
</pre>
null

PLEASE IGNORE: SEE MY SUBSEQUENT THREAD FOR A PARTIAL SOLUTION.

Similar Messages

  • XML-XSLT XML within XML

    Hi,
    I am in the process of building an application in which the data tier serves XML and the presentation layer uses XSLT to render the desired format. I need to produce an html table with data that is stored in a database(easy). The issue is that in cell 3 for example, I need to select data from my data objects (that return xml)for an html select list. What would be an effective way to merge the two seperate xml docs? Any help would be greatly appreciated.
    Thanks...

    Lets say you want to "include" the file foo.xml in a file called bar.xml. One way way to go about it is to use something similar to:
    <!ENTITY Foo SYSTEM "foo.xml">
    before the top level element your bar.xml and
    &Foo;
    somewhere inside the bar.xml.
    Also sometimes it's easier to just use the document() XSLT function to include whatever node you wish from an external resourse. This function should be used somewhere inside the XSL file which provides you with the desired formarting.
    null

  • XSLT-transformation in Java-Mapping with javax.xml

    Hi,
    we wanna use javax.xml for transformations in Java-Mapping.
    Inside the Java-mapping we read in XSL-files to transform a XML-stream. With XSLT 1.0 everything works fine - but with XSLT 2.0 we are getting runtime errors.
    Is it possible that javax.xml only supports XSLT 1.0?
    Regards
    Wolfgang

    Hi ,
    Jaxp 1.3 is available in this link -
    http://java.sun.com/webservices/jaxp/
    Use these jar files to process XSLT 2.0.
    Nanda

  • Java Translets XML/XSLT Transformation

    Translets "are precompiled XSL documents that are optimized and converted into simple Java classes. When you compile your application Java files, you compile your XSL files into Java class files. During runtime, you can load translets like any regular Java class and perform XSL transformations over and over again.
    The syntax checking and parsing of XSL documents are done when the XSL files are compiled. The transformation therefore takes only as long as the compiled code takes to execute, which improves performance multiple folds.
    The downside to using XSL is that "it can take a considerable amount of time and reduce performance. The time needed to parse XML and XSL documents is directly proportional to the size of the documents. Each transformation requires the XML and XSL documents to be loaded, syntax checked, and parsed." I recommends using translets for the following reasons.
    I had written an application (<a href="http://www.simplygites.com" title="www.simplygites.com">SimplyGites</a>) using standard XSL / XML transformation and experienced some very slow server-side transformation on the very complex screens with large amounts of xml. Timings showed these problem screens took 2-3 seconds to transform, which was totally unacceptable non-functional requirements.
    I considered rewriting these screens as JSP or PHP, then I discovered Translets. And wow what a discovery the timings for these pages now compiled as Translets(java classes) are amazing in comparison to the original timings ? I now have them transforming in 500ms (all now under 1 second).
    I would recommend anyone using XSL/XML transformation to use Translets, these have now been running tried and tested on the <a href="http://www.simplygites.com" title="www.simplygites.com">SimplyGites</a> for the past 6months.
    Technolgies used:
    Weblogic 8.1 SP5
    Java 1.4.2
    Required Jars
    xsltc.jar
    runtime.jar
    BCEL.jar
    JLex.jar
    java_cup.jar
    regexp.jar
    xml-dtm.jar
    For more information see http://xml.apache.org/xalan-j/xsltc_usage.html
    I hope this helps anyone that has XML/XSLT performance issues.
    Mark
    MB Computer Ltd
    www.simplygites.com

    Thanks for your help.
    The problem was that my firewall was blocking my server.

  • How to use XSLT processor in java to get xml

    hi friends,
    i have raw xml and xsl files as input to xsltprocessor which should give xml as output.
    my raw xml and xsl looks like this:-
    name_space.xml:-
    <xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
    xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
    xmlns:rs='urn:schemas-microsoft-com:rowset'
    xmlns:z='#RowsetSchema'>
    <s:Schema id='RowsetSchema'>
    <s:ElementType name='row' content='eltOnly'>
    <s:AttributeType name='ID' rs:number='1' rs:nullable='true'
    rs:writeunknown='true'>
    <s:datatype dt:type='int' dt:maxLength='4' rs:precision='10'
    rs:fixedlength='true'/>
    </s:AttributeType>
    <s:AttributeType name='CODE' rs:number='2' rs:nullable='true'
    rs:writeunknown='true'>
    <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='50'/>
    </s:AttributeType>
    <s:AttributeType name='NAME' rs:number='3' rs:nullable='true'
    rs:writeunknown='true'>
    <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='255'/>
    </s:AttributeType>
    <s:AttributeType name='SOURCE' rs:number='4' rs:nullable='true'
    rs:writeunknown='true'>
    <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='10'/>
    </s:AttributeType>
    <s:AttributeType name='IDENT' rs:number='5' rs:nullable='true'
    rs:writeunknown='true'>
    <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='128'/>
    </s:AttributeType>
    <s:AttributeType name='OBS_LEVEL' rs:number='6' rs:nullable='true'
    rs:writeunknown='true'>
    <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='50'/>
    </s:AttributeType>
    <s:AttributeType name='ATA_CODE' rs:number='7' rs:nullable='true'
    rs:writeunknown='true'>
    <s:datatype dt:type='string' rs:dbtype='str' dt:maxLength='12'/>
    </s:AttributeType>
    <s:AttributeType name='SCORE' rs:number='8' rs:nullable='true'
    rs:writeunknown='true'>
    <s:datatype dt:type='int' dt:maxLength='4' rs:precision='10'
    rs:fixedlength='true'/>
    </s:AttributeType>
    <s:AttributeType name='HAS_EFF_NOTE' rs:number='9' rs:nullable='true'
    rs:writeunknown='true'>
    <s:datatype dt:type='ui1' dt:maxLength='1' rs:precision='3'
    rs:fixedlength='true'/>
    </s:AttributeType>
    <s:extends type='rs:rowbase'/>
    </s:ElementType>
    </s:Schema>
    <rs:data>
    <z:row ID='1018' CODE='OBSV' NAME='ALT BRK - LOSS OF THE PEDAL ARTIFICIAL FEEL ON THE RIGHT SIDE'
    SOURCE='' IDENT='' OBS_LEVEL='' ATA_CODE='32-43' SCORE='1'
    HAS_EFF_NOTE='0'/>
    <z:row ID='1017' CODE='OBSV' NAME='ALT BRK - LOSS OF THE PEDAL ARTIFICIAL FEEL ON THE LEFT SIDE'
    SOURCE='' IDENT='' OBS_LEVEL='' ATA_CODE='32-43' SCORE='1'
    HAS_EFF_NOTE='0'/>
    <z:row ID='100' CODE='LOCAL' NAME='ACCU PRESS DROPS VERY QUICKLY PARKING BRAKE OFF'
    SOURCE='' IDENT='' OBS_LEVEL='INDICATOR(S)' ATA_CODE='32-44'
    SCORE='1' HAS_EFF_NOTE='0'/>
    </rs:data>
    </xml>
    and my XSL File:-
    <?xml version="1.0" encoding="UTF-8" ?>
    - <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema" exclude-result-prefixes="rs z">
    <xsl:output method="xml" omit-xml-declaration="yes" indent="yes" />
    - <xsl:template match="//xml/rs:data">
    - <Entities Count="{count(z:row)}">
    <xsl:apply-templates select="z:row" />
    </Entities>
    </xsl:template>
    - <xsl:template match="z:row">
    <Entity ID="{@ID}" ATA="{@ATA_CODE}" Name="{@NAME}" Code="{@CODE}" Source="{@SOURCE}" Ident="{@IDENT}" Level="{@OBS_LEVEL}" EffNote="{@HAS_EFF_NOTE}" Score="{@SCORE}" />
    </xsl:template>
    </xsl:stylesheet>
    AND I NEED OUTPUT XML AS:-
    <Entities Count="3">
         <Entity ID="1018" ATA="32-43" Name="ALT BRK - LOSS OF THE PEDAL ARTIFICIAL FEEL ON THE RIGHT SIDE" Code="OBSV" Source="" Ident="" Level="" EffNote="0" Score="1"></Entity>
         <Entity ID="1017" ATA="32-43" Name="ALT BRK - LOSS OF THE PEDAL ARTIFICIAL FEEL ON THE LEFT SIDE" Code="OBSV" Source="" Ident="" Level="" EffNote="0" Score="1"></Entity>
         <Entity ID="100" ATA="32-44" Name="ACCU PRESS DROPS VERY QUICKLY PARKING BRAKE OFF" Code="LOCAL" Source="" Ident="" Level="INDICATOR(S)" EffNote="0" Score="1"></Entity>
    </Entities>
    how to write a bean to get this xmloutput.
    thank in advance

    Hi Sliba,
    You may download and use the XDK for Java that is available from OTN to do this.
    Here is the code that will be handy for use. Just substitute your XML document and stylesheet
    in the code snippet pasted below. I hope this helps.
    There are many more useful XML samples you can find at http://otn.oracle.com/sample_code/tech/xml/content.html
    Regards
    Abhijeet
    // import the necessary libraries
    import oracle.xml.parser.v2.XSLProcessor;
    import oracle.xml.parser.v2.XSLStylesheet;
    import oracle.xml.parser.v2.XMLDocument;
    import oracle.xml.parser.v2.DOMParser;
    import java.io.StringReader;
    public class Test
    public Test()
    // Xml document that needs to be transformed
    private static String xmldoc = "<xml xmlns:s=\"http:www.myschema.com\" >" +
    "<s:result>" +
    "<s:status>1234554321</s:status>"+
    "<s:approvalcode>1234567887654321</s:approvalcode> "+
    "</s:result>" +
    "</xml>";
    // Xsl stylesheet that will be applied
    private static String xsldoc ="<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns:s=\"http:www.myschema.com\" > " +
    " <xsl:template match=\"s:result\"> "+
    " My transform status: <xsl:value-of select=\"s:status\"/> <BR/>" +
    " My transform Approval code : <xsl:value-of select=\"s:approvalcode\"/> " +
    "</xsl:template> " +
    "</xsl:stylesheet> ";
    public void transform(String xmlstr,String xslstr) throws Exception {
    // Create the DOM parser instance
    DOMParser dp = new DOMParser();
    // Create StringReader object
    StringReader xmlreader = new StringReader(xmlstr);
    // Parse the xml document string
    dp.parse(xmlreader);
    // Get java object representation of XML document
    XMLDocument xmldoc = dp.getDocument();
    // Create an instance of XSL processor
    XSLProcessor processor = new XSLProcessor();
    // Create StringReader object
    StringReader xslreader = new StringReader(xslstr);
    // Parse the xsl stylesheet
    XSLStylesheet xsl = processor.newXSLStylesheet(xslreader);
    processor.showWarnings(true);
    processor.setErrorStream(System.err);
    processor.processXSL(xsl,xmldoc,System.out);
    return;
    public static void main(String[] args) throws Exception
    Test test = new Test();
    System.out.println("Executing test");
    test.transform(xmldoc,xsldoc);
    }

  • XML + XSLT - Retaining LF's in output

    Hi
    I am using FOP to process an XML file to a PDF using a XSLT. The
    description column can have LF characters in it, which currently are
    getting filtered out. I have converted teh LF's to the escape codes,
    but this has had no effect (I do something similar with the greater
    than symbol and that works). How do I go about retaining them. This
    has been driving me around the bend for ages. Some guidence in this
    would be most appreciated.
    Below is some sample code illustrating the issue. The second row is
    supposed to span multiple lines in the text cell.
    ------------- XML --------------------------------
    <SERVERS>
    <SERVER>
    <NAME>SERV1.DOMAIN.COM</NAME>
    <DESCRIPTION>This description does not have any LF's in the
    text</DESCRIPTION>
    </SERVER>
    <SERVER>
    <NAME>SERV2.DOMAIN.COM</NAME>
    <DESCRIPTION>This is intended to be a line with a LF between here
    and here and another LF between here
    and here and another
    LF between here
    and here</DESCRIPTION>
    </SERVER>
    </SERVERS>
    ------------- XSLT -------------------------------
    <?xml version="1.0" encoding="utf-8"?>
    <xsl:stylesheet version="1.1"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format"
    xmlns:java="http://xml.apache.org/xslt/java"
    exclude-result-prefixes="java">
    <!-- C:\Files\xml>"C:\Program Files\Apache Software
    Foundation\fop-0.20.5\fop.bat" -xml c:\files\xml\servercr.xml -xsl
    C:\files\xml\servercr.xsl -pdf c:\temp\xml\servercr.pdf -->
    <xsl:template match="SERVERS">
    <xsl:variable name="CR" select="'
    '"/>
    <xsl:variable name="LF" select="'
    '"/>
    <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
    xmlns:fox="http://xml.apache.org/fop/extensions">
    <fo:layout-master-set>
    <fo:simple-page-master master-name="A4-L" page-width="297mm"
    page-height="210mm" margin-top="10mm" margin-bottom="10mm"
    margin-left="10mm" margin-right="10mm">
    <fo:region-body margin="10mm"/>
    <fo:region-before extent="20mm"/>
    <fo:region-after extent="10mm"/>
    <fo:region-start extent="10mm"/>
    <fo:region-end extent="10mm"/>
    </fo:simple-page-master>
    </fo:layout-master-set>
    <fo:page-sequence master-reference="A4-L">
    <fo:flow flow-name="xsl-region-body">
    <fo:block>
    <fo:table table-layout="fixed" border-color="rgb(0,0,0)"
    border-style="solid" border-width="1pt">
    <fo:table-column column-width="40mm"/>
    <fo:table-column column-width="200mm"/>
    <fo:table-header background-color="rgb(214,214,214)"
    font-size="8pt" font-weight="bold" text-align="center">
    <fo:table-row text-align="center" font-size="8pt">
    <fo:table-cell border-color="rgb(0,0,0)"
    border-style="solid"
    border-width="1pt"><fo:block>Server</fo:block></fo:table-cell>
    <fo:table-cell border-color="rgb(0,0,0)"
    border-style="solid"
    border-width="1pt"><fo:block>Description</fo:block></fo:table-cell>
    </fo:table-row>
    </fo:table-header>
    <fo:table-body>
    <xsl:for-each select="SERVER">
    <fo:table-row text-align="center" font-size="8pt">
    <fo:table-cell border-color="rgb(0,0,0)"
    border-style="solid" border-width="1pt">
    <fo:block vertical-align="middle">
    <xsl:value-of select="NAME"/>
    </fo:block>
    </fo:table-cell>
    <fo:table-cell border-color="rgb(0,0,0)"
    border-style="solid" border-width="1pt">
    <fo:block vertical-align="middle">
    <xsl:value-of select="DESCRIPTION"/>
    </fo:block>
    </fo:table-cell>
    </fo:table-row>
    </xsl:for-each>
    </fo:table-body>
    </fo:table>
    </fo:block>
    </fo:flow>
    </fo:page-sequence>
    </fo:root>
    </xsl:template>
    </xsl:stylesheet>
    I know this isn't an oracle issue, but hopefully someone can point me in the right direction.
    Thanks for your help.
    Nick.

    Hi
    Thanks for your response it was very useful.
    The attribute linefeed-treatment on its own didn't solve the problem, and another link I found suggested that may be a bug. However making use of the attribute white-space-collapse did seem to do what I wanted!
    So it loks like the solution is to use one bug to fix another :) I'm sure that can't be good and is asking for problems later on. But for now it will do.
    Many thanks for your guidance.
    Nick.

  • Help,about jsp+xml+xslt

    if I write like this:
    <?xml version="1.0" encoding="GB2312"?>
    <%@ page contentType="text/html;charset=GB2312"%>
    <?xml-stylesheet type="text/xsl" href="xslt/test.xslt"?>
    <news>
    <word>
    link
    </word>
    <link>
    abc.jsp
    </link>
    </news>
    the test.xslt can convert the xml to html
    but I write like this:
    <?xml version="1.0" encoding="GB2312"?>
    <%@ page contentType="text/html;charset=GB2312"%>
    <?xml-stylesheet type="text/xsl" href="xslt/href.xslt"?>
    <%
    out.println("<news><word>link</word><link>abc.jsp</link></news>");
    %>
    the test.xslt would not work,why????

    first the xslt is in a .xsl file
    second I'm pretty sure you can't put java in an xsl file.

  • Parameterized XSLT XML file

    I apologize if this topic is out of place, but I can not find any forum more suitable to my question. Please advise.
    I use XML and XSLT to render a "tree" in my jsp page. When user clicks a tree leaf, a new page is loaded.
    Each user will see a different tree, depending on his role defined in the application. The worst thing I can do is to have a different XML file for each role.
    Is is possible that I can have just one XML file defining a generic tree, and depends on user role, certain branches and leaves are displayable. In another words, is it possbile to have a XML file parameterized by an external variable.
    The external variable here is the user role, which comes from a session scope bean.
    MSXML has similar feature that is quite close, but my app is based on Java, Struts on Unix.

    Thanks for the hint. I am newbie, and I am quite at lost to make this work.
    Here is my tree xml file tree.xml ( a portion of if)
    =======
    <?xml version="1.0" ?>
    <?xml-stylesheet type="text/xsl" href="../css/xmlTree.xsl"?>
    <!DOCTYPE tree SYSTEM 'tree.dtd'>
    <tree>
    <branch id="IDAdmin"> <!-- Start User Administration branch -->
    <branchText> User ID Setup</branchText>
    <leaf> <leafText> Add</leafText> <link>../add_user.jsp</link> </leaf>
    <leaf> <leafText> Change</leafText> <link>#</link> </leaf>
    </branch> <!-- End of User Administration branch -->
    ===================
    Here is the xmlTree.xsl
    <?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method="html"></xsl:output>
    <xsl:param name="roleNm" select="'ADMINISTRATOR'"/>
    <xsl:template match="/">
    <html>
    <head>
    <title>XML Tree Control</title>
    <link rel="stylesheet" type="text/css" href="../css/xmlTree.css"/>
    <script type="text/javascript" src="../js/xmlTree.js"></script>
    </head>
    <xsl:apply-templates/>
    </html>
    </xsl:template>
    <xsl:template match="tree">
    <body>
    <b><xsl:value-of select="$roleNm"/></b>
    <xsl:apply-templates/>
    </body>
    </xsl:template>
    Here is a portion of my jsp page
    <frame name="nav_frame" bgcolor="#FFFFCC" src="tree.xm"/>' frameborder="0"
    Can youn kindly give me a bit more detail where the setParameter call should be set ? I guess it will be a scriplet in my jsp, but I don't know how to put them together. Thanks

  • Jsp+xslt+xml

    hi,
    I want to display the xml file which is as following:
    <item>
    <title>title1</title>
    <content>content1</content>
    </item>
    <item>
    <title>title2</title>
    <content>content2</content>
    </item>
    I want to display all titles in a table. When clicking a title, then displaying the corresponding content.
    So I wrote code:
    <xsl:for-each select="title">
    <a>
    <xsl:attribute name="href">content.jsp</xsl:text></xsl:attribute>
    <xsl:apply-templates />
    </a>
    </xsl:for-each>
    How can i transfer the title name to the content.jsp so that the corresponding content can be handled in content.jsp?
    Any suggestion is helpful.

    Hi jacky_chenp,
    I am facing a problem in JSP + XSLT + XML, just see whether you can help as I am new to it.
    I am getting the following error message while try to compile JSP_Book_Inventory.jsp
    Error: java.security.PrivilegedActionException <<java.lang.ClassNotFoundException: org.apache.xalan.xslt.XSLTInputSource>>
    JSP_Book_Inventory.jsp
    <%@ taglib uri="http://jakarta.apache.org/taglibs/xsl-1.0" prefix="xsl" %>
    <html>
    <head><title>Book Inventory</title></head>
    <body>
    <xsl:apply xml="XML_Book_Inventory" xsl="XSL_Book_Inventory.xsl" />
    </body>
    </html>
    XML_Book_Inventory.xml
    <?xml version='1.0' encoding='ISO-8859-1'?>
    <books>
    <book isbn="123">
    <title>Web Servers for Fun and Profit</title>
    <quantity>10</quantity>
    <price>$17.95</price>
    </book>
    <book isbn="456">
    <title>Web Programming for Mobile Devices</title>
    <quantity>2</quantity>
    <price>$38.95</price>
    </book>
    <book isbn="789">
    <title>Duke: A Biography of the Java Evangelist</title>
    <quantity>25</quantity>
    <price>$15.00</price>
    </book>
    </books>
    XSL_Book_Inventory.xsl
    <?xml version='1.0' encoding='windows-1252'?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <!-- Root template -->
    <xsl:template match="books">
    <table border="1" width="100%">
    <th>ISBN</th>
    <th>Title</th>
    <th>Quantity</th>
    <th>Price</th>
    <xsl:for-each select="book">
    <tr>
    <td><xsl:value-of select="@isbn" /></td>
    <td><xsl:value-of select="title" /></td>
    <td><xsl:value-of select="quantity" /></td>
    <td><xsl:value-of select="price" /></td>
    </tr>
    </xsl:for-each>
    </table>
    </xsl:template>
    </xsl:stylesheet>
    Thank you.

  • How To Populate An Advanced Data Grid In Flex With An XML Document Created In JAVA

    Flex Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="856" height="698" initialize="onInitData()">
        <mx:RemoteObject destination="utilityUCFlexRO" id="utilityUCFlexRO">
            <mx:method name="updateStationDetails" result="handleUpdateStationDetailsResult(event)" fault="handleUpdateStationDetailsFault(event)"/>
        </mx:RemoteObject>
        <mx:RemoteObject id="uniqueIdMasterUCFlexRO" destination="uniqueIdMasterUCFlexRO">
            <mx:method name="readByCustomerName" result="handleReadByCustomerNameResult(event)" fault="handleReadByCustomerNameFault(event)"/>
            <mx:method name="getCustomerAcDetails" result="handlegetCustomerAcDetailsResult(event)" fault="handlegetCustomerAcDetailsFault(event)"/>
        </mx:RemoteObject>
        <mx:Script>
            <![CDATA[
                import mx.events.ListEvent;
                import mx.collections.ItemResponder;
                import com.citizen.cbs.model.UniqueIdMaster;
                import mx.managers.PopUpManager;
                import mx.controls.ProgressBarMode;
                import mx.effects.Fade;
                import mx.controls.ProgressBar;
                import com.citizen.cbs.CitizenApplication;
                import mx.core.Application;
                import mx.messaging.messages.ErrorMessage;
                import mx.rpc.events.FaultEvent;
                import mx.rpc.events.ResultEvent;
                import mx.collections.ArrayCollection;
                import mx.controls.Alert;
                private var moduleCloseFlag:Boolean=false;
                private var v:UniqueIdMaster;
                [Bindable]
                private var customerDetails:ArrayCollection;
                [Bindable]
                private var branch:int=0;
                [Bindable]
                private var XMLDocument:XML;
                [Bindable]
                private var acDetails:XMLList;
                private var _progBar:ProgressBar = new ProgressBar();
                private function showLoading(e:Event = null):void
                    _progBar.width = 200;
                    _progBar.indeterminate = true;
                    _progBar.labelPlacement = 'center';
                    _progBar.setStyle("removedEffect", Fade);
                    _progBar.setStyle("addedEffect", Fade);
                    _progBar.setStyle("color", 0xFFFFFF);
                    _progBar.setStyle("borderColor", 0x000000);
                    _progBar.setStyle("barColor", 0x6699cc);
                    _progBar.label = "Please wait.......";
                    _progBar.mode = ProgressBarMode.MANUAL;
                    PopUpManager.addPopUp(_progBar,this,true);
                    PopUpManager.centerPopUp(_progBar);
                    _progBar.setProgress(0, 0);
                private function onInitData():void
                    utilityUCFlexRO.updateStationDetails(CitizenApplication.menuParameters["modulecode"]);
                private function handleUpdateStationDetailsResult(event:ResultEvent):void
                    if(moduleCloseFlag==true)
                        Application.application.unloadModule();
                private function handleUpdateStationDetailsFault(event:FaultEvent):void
                    var errorMessage:ErrorMessage = event.message as ErrorMessage;
                    Alert.show(errorMessage.rootCause.message);
                private function onSearch():void
                    if(txtName.text=="" || txtName.text==null)
                        Alert.show("Enter a name for search");
                        return;
                    if((txtName.text).length < 4)
                        Alert.show("Search should contain more than 3 alphabets");
                        return;
                    var d:String = txtName.text;
                    branch = CitizenApplication.initInfo.registeredUser.branchDetails.bdBranchNo;
                    uniqueIdMasterUCFlexRO.readByCustomerName(d,branch);
                    showLoading();
                private function handleReadByCustomerNameResult(event:ResultEvent):void                //In handle if record does not exists, dsiplays error message and resets the field
                    customerDetails =ArrayCollection(event.result);
                    PopUpManager.removePopUp(_progBar);
                    if(customerDetails.length==0)
                        Alert.show("Record Not Found, Enter Proper Name ");
                        onReset();
                private function handleReadByCustomerNameFault(event:FaultEvent):void
                    Alert.show(event.fault.faultDetail + " -- " + event.fault.faultString + "handleReadByCustomerNameFault");
                private function onReset():void
                    customerDetails=new ArrayCollection();
                    txtName.text="";
                private function onCancel():void
                    utilityUCFlexRO.updateStationDetails("MM0001");
                    moduleCloseFlag=true;
                private function btnBackClick():void
                    view1.selectedIndex=0;
                private function btnBackClick1():void
                    view1.selectedIndex=1;
                private function onItemClick( e:ListEvent ):void
                    if(dgCustDetails.selectedItem == null)
                        Alert.show("Select Proper Record");
                    else
                        lblId.text = e.itemRenderer.data.uimCustomerId;
                        lblName.text = e.itemRenderer.data.uimCustomerName;
                        var custId:int = Number(lblId.text);   
                        uniqueIdMasterUCFlexRO.getCustomerAcDetails(custId,branch);
                        showLoading();           
                private function handlegetCustomerAcDetailsResult(event:ResultEvent):void               
                    //XMLDocument = event.result as XML;
                    acDetails = new XMLList(event.result.menu);
                    //Alert.show("Name: "+event.result.@name);
                    PopUpManager.removePopUp(_progBar);
                    view1.selectedIndex=1;
                    //adg1.dataProvider=acDetails;
                private function handlegetCustomerAcDetailsFault(event:FaultEvent):void
                    PopUpManager.removePopUp(_progBar);
                    Alert.show(event.fault.faultDetail + " -- " + event.fault.faultString + "handlegetCustomerAcDetailsFault");
            ]]>
        </mx:Script>
        <mx:ViewStack height="688" width="856" id="view1">
            <mx:Canvas>
                <mx:Panel x="51" y="25" width="754" height="550" layout="absolute" title="Customer Search Page">
                    <mx:HBox x="174" y="26" horizontalAlign="center" verticalAlign="middle">
                        <mx:Label text="Enter Name:"/>
                        <mx:TextInput id="txtName" width="228"/>
                        <mx:LinkButton label="Search" click="onSearch()"/>
                    </mx:HBox>
                    <mx:Label text="--" id="lblId" x="40" y="194"/>
                    <mx:Label text="--" id="lblName" x="40" y="226"/>
                    <mx:DataGrid dataProvider="{customerDetails}" id="dgCustDetails" allowMultipleSelection="false" editable="false"
                        showHeaders="true" draggableColumns="false" width="718" height="373" itemClick="onItemClick(event);" x="10" y="61">
                        <mx:columns>
                            <mx:DataGridColumn headerText="Customer Id" dataField="uimCustomerId" width="150"/>
                            <mx:DataGridColumn headerText="Customer Name" dataField="uimCustomerName"/>
                        </mx:columns>
                    </mx:DataGrid>
                    <mx:ControlBar>
                        <mx:Button label="CANCEL" click="onCancel()" width="80"/>
                        <mx:Button label="RESET" click="onReset()" width="80"/>
                    </mx:ControlBar>
                </mx:Panel>
            </mx:Canvas>
            <mx:Canvas>
                <mx:TitleWindow x="10" y="10" width="836" height="421" layout="absolute">
                    <mx:AdvancedDataGrid x="6.5" y="10" id="adg1" designViewDataType="tree" variableRowHeight="true" width="807" height="278" fontSize="14">
                        <mx:dataProvider>
                              <mx:HierarchicalData source="{acDetails}"/>
                        </mx:dataProvider>
                        <mx:groupedColumns>
                            <mx:AdvancedDataGridColumn headerText="Type Of A/c" dataField="@Name" width="150"/>
                            <mx:AdvancedDataGridColumn headerText="Details Of A/c"/>
                        </mx:groupedColumns>
                        <mx:rendererProviders>
                            <mx:AdvancedDataGridRendererProvider id="adgpr1" depth="2" columnIndex="1" renderer="AcDetails1" columnSpan="0"/>
                        </mx:rendererProviders>
                    </mx:AdvancedDataGrid>
                    <mx:ControlBar height="56" y="335">
                        <mx:Button label="BACK" width="80" click="btnBackClick()"/>
                        <mx:Spacer width="100%"/>
                        <mx:Button label="EXIT" click="onCancel()" width="80"/>
                    </mx:ControlBar>
                </mx:TitleWindow>
            </mx:Canvas>
        </mx:ViewStack>
    </mx:Module>
    XML File Generated In JAVA:
    <?xml version="1.0" encoding="UTF-8"?>
    <menu>
    <AcType Name="Savings">
    <SavingAcDetails AcName="Mr. MELROY BENT" AccountNo="4" ClearBalance="744.18" ProductID="SB" TotalBalance="744.18">
    <SavingMoreAcDetails AcStatus="OPERATIVE" AcType="NORMAL" FreezeCode="No Freeze" ModeOfOper="AnyOne Single Or Survivor"/>
    </SavingAcDetails>
    </AcType>
    <AcType Name="TermDeposit">
    <TDAcDetails AcName="Mr. BENT MELROY" AccountNo="1731" ProductID="TD">
    <TDMoreAcDetails AcStatus="OPERATIVE" AcType="NORMAL" FreezeCode="No Freeze" ModeOfOper="Either or Survivor"/>
    </TDAcDetails>
    <TDAcDetails AcName="Mr. BENT MELROY" AccountNo="2287" ProductID="TD">
    <TDMoreAcDetails AcStatus="NEW" AcType="NORMAL" FreezeCode="No Freeze" ModeOfOper="Self"/>
    </TDAcDetails>
    <TDAcDetails AcName="Mr. BENT MELROY" AccountNo="78" ProductID="TD">
    <TDMoreAcDetails AcStatus="OPERATIVE" AcType="NORMAL" FreezeCode="No Freeze" ModeOfOper="Self"/>
    </TDAcDetails>
    </AcType>
    </menu>
    Tried Alot Of Examples Online But In Vain....
    Need Help....
    Thanks In Advance....

    Please help me !!!! I have been stuck up with this issue for the past two days and I need to atleast figure out if this is possible or not in the first place.

  • Unable to transform XML with XSL in java code

    Hi,
    Could somebody please tell me what's wrong with my code, why it isn't transform the XML with XSL to the output that I want. If I use the command line to transform the XML, it output perfectly:
    java org.apache.xalan.xslt.Process -in marc.xml -xsl MARC21slim2MODS.xsl -out out.xml
    Here is the code of my program to transform the XML with XSL, I am using xalan-j_2_2-bin:
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import org.w3c.dom.*;
    import javax.xml.parsers.*;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.*;
    import javax.xml.transform.dom.*;
    import java.math.BigInteger;
    String xslDoc = "MODS.xsl";
    String xmlResult = "out.xml";
    DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
    dfactory.setNamespaceAware(true);
    DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
    Document xmlDoc = docBuilder.newDocument();
    Element root = xmlDoc.createElement("collection");
    root.setAttribute("xmlns", "http://www.loc.gov/MARC21/slim");
    xmlDoc.appendChild(root);
    TransformerFactory factory = TransformerFactory.newInstance();
    Transformer transformer = factory.newTransformer(new StreamSource(xslDoc));
    FileWriter fw = new FileWriter(new File(xmlResult));
    StreamResult output = new StreamResult(fw);
    transformer.transform(new DOMSource(xmlDoc), output);
    fw.flush();
    fw.close();
    ========================
    marc.xml -- source XML file
    ========================
    <?xml version="1.0" encoding="UTF-8"?>
    <collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>01488cam 2200337 a 4500</leader><controlfield tag="001">2502929</controlfield><controlfield tag="005">19930521155141.9</controlfield><controlfield tag="008">920219s1993 caua j 000 0 eng </controlfield><datafield ind1=" " ind2=" " tag="035"><subfield code="9">(DLC) 92005291</subfield></datafield><datafield ind1=" " ind2=" " tag="906"><subfield code="a">7</subfield><subfield code="b">cbc</subfield><subfield code="c">orignew</subfield><subfield code="d">1</subfield><subfield code="e">ocip</subfield><subfield code="f">19</subfield><subfield code="g">y-gencatlg</subfield></datafield>
    </record></collection>
    ========================
    out.xml -- result using command line
    ========================
    <?xml version="1.0" encoding="UTF-8"?>
    <collection xmlns="http://www.loc.gov/mods/" xmlns:xlink="http://www.w3.org/TR/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/mods/ http://www.loc.gov/standards/marcxml/schema/mods.xsd">
    <mods>
    <titleInfo>
    <title>Arithmetic</title>
    </titleInfo>
    <name type="personal">
    <namePart>Sandburg, Carl</namePart>
    <namePart type="date">1878-1967</namePart>
    <role>creator</role>
    </name>
    </mods>
    </collection>
    ========================
    out.xml -- result using my java program
    ========================
    <?xml version="1.0" encoding="UTF-8"?>
    <collection xmlns="http://www.loc.gov/mods/" xmlns:xlink="http://www.w3.org/TR/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.loc.gov/mods/ http://www.loc.gov/standards/marcxml/schema/mods.xsd">01488cam 2200337 a 4500250292919930521155141.9920219s1993 caua j 000 0 eng (DLC) 920052917cbcorignew1ocip19y-gencatlgpc16 to br00 02-19-92; br02 to SCD 02-21-92; fd11 02-24-92 (PS3537.A618 A...); fa00 02-26-92; fa05 03-02-92; fm31 03-06-92; CIP ver. pv08 04-16-93; pv01 to CLT 04-20-93; lb10 05-21-93
    </collection>

    I am using the same XSL file. My Java program use the same XSL file I used in the command line.
    It is possible that my Java code is using a different parser, but I developed a seperate program to parse the XML using the same parser that my Java code is using. It output the result I expected. Here is the code for the program:
    import java.io.*;
    import javax.xml.transform.*;
    import javax.xml.transform.stream.*;
    public class Convertor {
    public static void main(String[] args) throws Exception {
    String xslDoc = "MARC21slim2MODS.xsl";
    String xmlResult = "out.xml";
    String xmlDoc = marc.xml";
    TransformerFactory factory = TransformerFactory.newInstance();
    Transformer transformer = factory.newTransformer(new StreamSource(xslDoc));
    StreamSource xmlSource = new StreamSource(xmlDoc);
    FileWriter fw = new FileWriter(new File(xmlResult));
    StreamResult output = new StreamResult(fw);
    transformer.transform(xmlSource, output);
    }

  • XML-XSLT problem. Please help

    I want to apply an XSLT to my XML to retrieve an element "firstName"
    My XSLT is as follows:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html"/>
    <xsl:template match="customer">
    <html>
    <xsl:apply-templates/>
    </html>
    </xsl:template>
    <xsl:template match="customerBank">
    <b>
    <xsl:value-of select="preceding-sibling::customerAddress/street"/>
    </b>
    </xsl:template>
    </xsl:stylesheet>
    Expected Output should be:
    Jonathan
    Chadrick
    Antonia
    Diane
    Jennifer
    Andrea
    Michael
    Mario
    My Output is :
    JonathanGold32
    Jonathan
    First National TrustEarthfarm Investment BankEF00123456789123456789012VISA ChadrickPowell45
    Chadrick
    First National TrustEF00123456789123456789012VISASnowboarding AntoniaSuares28
    Antonia
    Investment Corporate HoldingsEF00123456789123456789012VISAKayaking DianeChristoff31
    Diane
    Investment Corporate HoldingsEF00123456789123456789012VISABeach JenniferWestlein41
    Jennifer
    Investment Corporate HoldingsEF00123456789123456789012VISAKayaking AndreaDesroaches33
    Andrea
    Investment Corporate HoldingsEF00123456789123456789012VISATrekking MichaelSeva21
    Michael
    Investment Corporate HoldingsEF00123456789123456789012VISACity breaks MarioGinelli34
    Mario
    Investment Corporate HoldingsEF00123456789123456789012VISAKayaking
    Why are the information from other node coming. Please clarify.
    My XML is
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml-stylesheet type="text/xml" href="cuetomer.xml?>
    <customerList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="customerList.xsd">
         <customer customerID="jgol001">
              <customerName>
                   <firstName>Jonathan</firstName>
                   <lastName>Gold</lastName>
                   <age>32</age>
              </customerName>
              <customerAddress>
                   <street>4801 Long Street</street>
                   <city>Earthfarm</city>
                   <country>USA</country>
                   <phoneNumber>123-456-7890</phoneNumber>
                   <emailAddress>[email protected]</emailAddress>
              </customerAddress>
              <customerBank>
                   <bankName>First National Trust</bankName>
                   <bankName>Earthfarm Investment Bank</bankName>
                   <IBAN>EF00123456789</IBAN>
                   <creditCardNum>123456789012</creditCardNum>
                   <creditCardType>VISA</creditCardType>
              </customerBank>
         </customer>
         <customer customerID="cpow001">
              <customerName>
                   <firstName>Chadrick</firstName>
                   <lastName>Powell</lastName>
                   <age>45</age>
              </customerName>
              <customerAddress>
                   <street>4802 Long Street</street>
                   <city>Earthfarm</city>
                   <country>USA</country>
                   <phoneNumber>123-456-7890</phoneNumber>
                   <emailAddress>[email protected]</emailAddress>
              </customerAddress>
              <customerBank>
                   <bankName>First National Trust</bankName>
                   <IBAN>EF00123456789</IBAN>
                   <creditCardNum>123456789012</creditCardNum>
                   <creditCardType>VISA</creditCardType>
              </customerBank>
              <vacationPref>Snowboarding</vacationPref>
         </customer>
         <customer customerID="asua001">
              <customerName>
                   <firstName>Antonia</firstName>
                   <lastName>Suares</lastName>
                   <age>28</age>
              </customerName>
              <customerAddress>
                   <street>4803 Long Street</street>
                   <city>Earthfarm</city>
                   <country>France</country>
                   <phoneNumber>123-456-7890</phoneNumber>
                   <emailAddress>[email protected]</emailAddress>
              </customerAddress>
              <customerBank>
                   <bankName>Investment Corporate Holdings</bankName>
                   <IBAN>EF00123456789</IBAN>
                   <creditCardNum>123456789012</creditCardNum>
                   <creditCardType>VISA</creditCardType>
              </customerBank>
              <vacationPref>Kayaking</vacationPref>
         </customer>
         <customer customerID="asua006">
              <customerName>
                   <firstName>Diane</firstName>
                   <lastName>Christoff</lastName>
                   <age>31</age>
              </customerName>
              <customerAddress>
                   <street>4803 Long Street</street>
                   <city>Earthfarm</city>
                   <country>Germany</country>
                   <phoneNumber>123-456-7890</phoneNumber>
                   <emailAddress>[email protected]</emailAddress>
              </customerAddress>
              <customerBank>
                   <bankName>Investment Corporate Holdings</bankName>
                   <IBAN>EF00123456789</IBAN>
                   <creditCardNum>123456789012</creditCardNum>
                   <creditCardType>VISA</creditCardType>
              </customerBank>
              <vacationPref>Beach</vacationPref>
         </customer>
         <customer customerID="asua005">
              <customerName>
                   <firstName>Jennifer</firstName>
                   <lastName>Westlein</lastName>
                   <age>41</age>
              </customerName>
              <customerAddress>
                   <street>4803 Long Street</street>
                   <city>Earthfarm</city>
                   <country>UK</country>
                   <phoneNumber>123-456-7890</phoneNumber>
                   <emailAddress>[email protected]</emailAddress>
              </customerAddress>
              <customerBank>
                   <bankName>Investment Corporate Holdings</bankName>
                   <IBAN>EF00123456789</IBAN>
                   <creditCardNum>123456789012</creditCardNum>
                   <creditCardType>VISA</creditCardType>
              </customerBank>
              <vacationPref>Kayaking</vacationPref>
         </customer>
         <customer customerID="asua004">
              <customerName>
                   <firstName>Andrea</firstName>
                   <lastName>Desroaches</lastName>
                   <age>33</age>
              </customerName>
              <customerAddress>
                   <street>4803 Long Street</street>
                   <city>Earthfarm</city>
                   <country>USA</country>
                   <phoneNumber>123-456-7890</phoneNumber>
                   <emailAddress>[email protected]</emailAddress>
              </customerAddress>
              <customerBank>
                   <bankName>Investment Corporate Holdings</bankName>
                   <IBAN>EF00123456789</IBAN>
                   <creditCardNum>123456789012</creditCardNum>
                   <creditCardType>VISA</creditCardType>
              </customerBank>
              <vacationPref>Trekking</vacationPref>
         </customer>
         <customer customerID="asua003">
              <customerName>
                   <firstName>Michael</firstName>
                   <lastName>Seva</lastName>
                   <age>21</age>
              </customerName>
              <customerAddress>
                   <street>4803 Long Street</street>
                   <city>Earthfarm</city>
                   <country>UK</country>
                   <phoneNumber>123-456-7890</phoneNumber>
                   <emailAddress>[email protected]</emailAddress>
              </customerAddress>
              <customerBank>
                   <bankName>Investment Corporate Holdings</bankName>
                   <IBAN>EF00123456789</IBAN>
                   <creditCardNum>123456789012</creditCardNum>
                   <creditCardType>VISA</creditCardType>
              </customerBank>
              <vacationPref>City breaks</vacationPref>
         </customer>
         <customer customerID="asua002">
              <customerName>
                   <firstName>Mario</firstName>
                   <lastName>Ginelli</lastName>
                   <age>34</age>
              </customerName>
              <customerAddress>
                   <street>4803 Long Street</street>
                   <city>Earthfarm</city>
                   <country>Canada</country>
                   <phoneNumber>123-456-7890</phoneNumber>
                   <emailAddress>[email protected]</emailAddress>
              </customerAddress>
              <customerBank>
                   <bankName>Investment Corporate Holdings</bankName>
                   <IBAN>EF00123456789</IBAN>
                   <creditCardNum>123456789012</creditCardNum>
                   <creditCardType>VISA</creditCardType>
              </customerBank>
              <vacationPref>Kayaking</vacationPref>
         </customer>
    </customerList>
    Thanks in advance
    Amit

    Thanks for the reply.
    I was trying to understand the XPath expression axes and was trying to achieve the same by using preceding-sibling.
    After some reading I was able to get the desired result by applying the following XSLT
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="html"/>
    <xsl:template match="customerList">
    <html>
    <b>
    <br>
    <xsl:apply-templates select="customer/customerAddress"/>
    </br>
    </b>
    </html>
    </xsl:template>
    <xsl:template match="customerAddress">
    <br>
    <xsl:value-of select="preceding-sibling::customerName/firstName"/>
    </br>
    </xsl:template>
    </xsl:stylesheet>
    Thanks a lot. May be it will be helpful to others.

  • XML/XSLT problem

    I'm currently reading info on using XSLT with XML documents ("Java Server Programming" by WROX), but I'm having quite a few problems getting anything to work. Can someone point me to a page/document that simply explains what .jar files to install, where to get them and where to place them to enable parsing XML files and using XSLT? I'm running jdk1.3.1_02.
    Thank You
    Tom Berry

    - download: http://java.sun.com/xml/downloads/javaxmlpack.html
    - install JAXP
    - follow the XSLT tutorial: http://java.sun.com/webservices/docs/1.0/tutorial/doc/JAXPXSLT.html
    - have fun!

  • JSP   vs.    XML/XSLT

    Hi all!
    I'm in a bit of a dilema. As the least knowledgable member of our small development group (3 people incl. me) I'm caught in the middle of a pretty fierce debate over whether or not to we should implement JSP.
    Currently to seperate business logic from presentation we have our servlets pass XML to the browser and then the browser renders the HTML using the appropriate .xsl (sometimes we use server-side transformation).
    Now one of the guys wants to use MVC/Struts and JSPs in order to create a much needed UI for an application. The plan is to not put any Java code in the JSP (seperation of logic and presentation - good, business logic in both the JSP and Servlet - bad.) but the other guy is still vehemently against it.
    He says that anything JSP can do we can already do with XML/XSLT and to add JSP to our environment would complicate things.
    And while I agree with him there, there are some things that when you do them with JSPs make the code more readable and transparent.
    If you had to take a side, which one would you choose?
    Has anyone else out there already gone through this debate? I'd be interested in knowing the outcome.
    Thanks,
    John

    I have a couple of comments.
    1> "XML to the browser and then the browser renders the HTML using the appropriate .xsl"
    I all cases you should do the transformations on the server. Lot of browser do not know how to
    do a xsl transform. And since you can do it some time why not do it not everytime?
    2> "business logic in both the JSP and Servlet"
    Business logic should neither be in servlets nor in jsp. I think they should be in business logic beans.
    3> "anything JSP can do we can already do with XML/XSLT "
    Although anything can be done using xml/xsl or jsp there are a bit of differences where struts-jsp architecture is more perferable.
    Imaging a web site which has lots of online forms(with textfiedls, checkboxes, select lists, etc) which are to be validated and if some validation fails the same form is to be shown with the values already submitted prefilled. Doing this with xml/xsl or even simple jsp could be a nightmare.
    But if you use struts MVC architecture with jsp and struts taglib this will be very very simple.
    Introducing struts-jsp will not complicate things and if the scnario described above is there or could arise in your application then you should seriously think about using struts+jsp. That does not mean you will have to scrap you xml+xsl architecture. You can still generate the xml using your action bean , put the xml in request and forward it to you jsp for rendetion. The jsp page could then use a taglib which has the xsl transformation code to do the xslt transformation.
    The above comments are not just my thoughts but i have also implemented/experienced the above during various projects and they have proved to be useful.
    Cheers!

  • Oracle XML format to VB ADO XML xslt

    Hello all,
    I believe Oracle produces XML in the following format:
    <?xml version = '1.0?>
    <row>
    <xxx3>abc</xxx3>
    <xxx2>def</xxx2>
    </row>
    BUT, I need to get it in the following XML form:
    <xml abcdef>
    <rs:data>
    <z:row a="abc">
    <z:row b="def">
    </rs:data>
    </xml>
    Does anybody have an xslt to do this or can anybody point me in the direction of how to do it please?
    Thanks in advance,
    Carlos

    Here is somethign to get you started on transformation. All you have to do is expand the example.
    SQL> set serveroutput on size unlimited
    SQL> declare
      2      l_ctx DBMS_XMLQUERY.ctxType ;
      3      l_xml xmltype ;
      4      l_xsl xmltype ;
      5  begin
      6      select xmltype(dbms_xmlquery.getxml('select * from scott.emp where rownum < 3')) into l_xml from dual ;
      7      dbms_output.put_line('original:'||chr(10)||l_xml.getStringVal()) ;
      8
      9      l_xsl := xmltype(
    10               '<?xml version="1.0"?>'||
    11               '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"'||
    12               ' version="1.0"'||
    13               ' result-ns=""'||
    14               ' indent="yes">'||
    15               '<xsl:output method="xml" media-type="text/xml" indent="yes"/>'||
    16               '<xsl:template match="/">'||
    17               '<xml>'||
    18               ' <xsl:for-each select="/'||l_xml.getRootElement()||'/ROW">'||
    19               '<DATA>'||
    20               ' <xsl:copy-of select="./*" />'||
    21               '</DATA>'||
    22               ' </xsl:for-each>'||
    23               '</xml>'||
    24               '</xsl:template>'||
    25               '</xsl:stylesheet>') ;
    26      l_xml := l_xml.transform(l_xsl) ;
    27      dbms_output.put_line('Modified:'||chr(10)||l_xml.getStringVal()) ;
    28  end ;
    29  /
    original:
    <?xml version = '1.0'?>
    <ROWSET>
       <ROW num="1">
          <EMPNO>7369</EMPNO>
          <ENAME>SMITH</ENAME>
          <JOB>CLERK</JOB>
          <MGR>7902</MGR>
          <HIREDATE>12/17/1980
    0:0:0</HIREDATE>
          <SAL>800</SAL>
          <DEPTNO>20</DEPTNO>
       </ROW>
       <ROW num="2">
          <EMPNO>7499</EMPNO>
          <ENAME>ALLEN</ENAME>
          <JOB>SALESMAN</JOB>
          <MGR>7698</MGR>
    <HIREDATE>2/20/1981 0:0:0</HIREDATE>
          <SAL>1600</SAL>
          <COMM>300</COMM>
          <DEPTNO>30</DEPTNO>
       </ROW>
    </ROWSET>
    Modified:
    <xml>
      <DATA>
        <EMPNO>7369</EMPNO>
        <ENAME>SMITH</ENAME>
        <JOB>CLERK</JOB>
        <MGR>7902</MGR>
        <HIREDATE>12/17/1980 0:0:0</HIREDATE>
        <SAL>800</SAL>
    <DEPTNO>20</DEPTNO>
      </DATA>
      <DATA>
        <EMPNO>7499</EMPNO>
        <ENAME>ALLEN</ENAME>
        <JOB>SALESMAN</JOB>
        <MGR>7698</MGR>
        <HIREDATE>2/20/1981 0:0:0</HIREDATE>
        <SAL>1600</SAL>
    <COMM>300</COMM>
        <DEPTNO>30</DEPTNO>
      </DATA>
    </xml>
    PL/SQL procedure successfully completed.
    SQL>

Maybe you are looking for

  • Solution for a "colour picker" problem.

    Hello, I had the most annoying problem with "Colours" in DreamWeaver 8. I just couldnt seem to get DreamWeaver to select colours from the page I was working in. I could select colours from the colour popup or "swab", but trying to match colours with

  • Query in pl/sql oracle

    Hi All! I want to write following type of query in PL/SQL How can I write one which will work. <B> SELECT count(1) INTO v_count2 from TRJ_TRAN_REJ_T a and PEU_PUR_ENRL_UNT_T b where a.TRJ_CVRG_PER_DATE IN (b.PEU_EFF_DATE AND b.PEU_END_DATE) AND a.pur

  • Itunes says I have incomplete series passes.  I have downloaded everything, so how can I get it to complete the pass?

    itunes says I have incomplete series passes.  I have downloaded everything, so how can I get it to complete the pass?

  • Rejected material report

    Hi buddies, How to have plantwise rejected material  report? Kind Regards.

  • Printing HTML PAGE in a Applet

    I am tryng to print a HTML Page in a Applet . When Using Eclipse Environment everythig goes fine. Now I am trying to use the appletviewer to run the same source, but it appears the following: http://10.15.1.26/ Conecting to http://10.15.1.26/ Excepti