Applying multiple xsl's

I've inheirited someone else's code, as we tend to do from time to time. The simplest way that I can think of fixing a problem with our xml is to apply one style sheet to the xml, then apply a second.
I have tried multiple times to get this to work, but I have basically no idea what I am doing. I'm no XML guru, by a long shot. If someone could give me an example of applying 2 sheets(1 before the other, so the 2nd transforms the result of the first) using PL/SQL or having one XSL call the other, that would be great.
I have tried using <xsl:apply-imports> and/or the xslprocessor object to apply 2 sheets, but it seems to just apply the 2nd.
We use PL/SQL to generate XML from a query stored in a clob, then apply a stylesheet to it and store it back out in the database in clob form.

I figured out a way to do it, just wondering if this is the right way since I basically just copied code. I've got a good idea, but I'm not 100% sure what it's doing.
I tried to add all the declerations, if i forgot 1 assume that it was declared properly. There was a bunch of DBMSXML stuff before this section of code, figured it wasn't needed.
-------------Declerations----------------------
p_xsl               varchar2--parameter passed in
v_xsl               varchar2(200);
v_xmldoc          xmldom.DOMDocument;
v_stylesheet     xslprocessor.Stylesheet;
v_stylesheet2     xslprocessor.Stylesheet;
r_xml      clob;
------------Initializations--------------------
v_parser := xmlparser.newparser;
xmlparser.setbasedir(v_parser, v_basedir);
xmlparser.parseClob(v_parser, r_xml);
v_xmldoc := xmlparser.getDocument(v_parser);
------------Apply 1st style sheet---------------
v_xsl := 'c:\style_sheet2.xsl';
v_stylesheet2 := xslprocessor.newstylesheet(v_xsl, v_xsl);
v_xslproc := xslProcessor.newProcessor;
dbms_lob.trim(r_xml, 0);
xslprocessor.processXSL(v_xslproc,
                                   v_stylesheet2,
                                   v_xmldoc,
                                   r_xml);
xmlparser.parseClob(v_parser, r_xml);
------------Apply 2nd style sheet---------------
v_xmldoc := xmlparser.getDocument(v_parser);
xslProcessor.freeProcessor(v_xslproc);
v_stylesheet := xslprocessor.newstylesheet(p_xsl, p_xsl);
v_xslproc := xslProcessor.newProcessor;
dbms_lob.trim(r_xml, 0);
xslprocessor.processXSL(v_xslproc,
                                   v_stylesheet,
                                   v_xmldoc,
                                   r_xml);
xmlparser.parseClob(v_parser, r_xml);
------------Free up resources--------------------
xslProcessor.freeProcessor(v_xslproc);
xslprocessor.freeStylesheet(v_stylesheet);
Xslprocessor.freestylesheet(v_stylesheet2);
xmlparser.freeparser(v_parser);

Similar Messages

  • Applying an XSL using PL/SQL

    I've got a question about the XML toolkit.
    I want to apply an XSL stylesheet on an XML document internally in the database using PL/SQL.
    I've got an application that must work with XML internally but its output must be anything. (CSV, XML, WML etc).
    Normally (when using IE 5.x) the stylesheet is applied when the document is parsed. I want to do this internally in the database.
    Is this possible? And does anyone have examples of this?
    THanks in advance.
    Martin Kleinman,
    Webdeveloper, Desyde BV, Baarn

    Dup post. Posted in AQ forum at {thread:id=1126132}

  • Help, how to apply multiple style to a component

    In HTML we can write class="styleA styleB" to apply multiple
    style, but it's not allowed in flex3.
    So is there a way to walk around? like
    .styleB{
    //include styleA
    }

    You have to combine all songs into one file by using software, for example Audacity.
    PS: I owe this knowledge to a post by Victoria Bampton.

  • Multiple XSL's from one XML?

    So I've got this XML file pointing to an XSL stylesheet, and
    its working great (client-side goin' on here), and yet I begin to
    wonder about the efficiency improvements (since I took data from 3
    HTML pages, and coded it as one XML file) if you can only apply one
    XSL stylesheet to one XML file. Kinda defeats the purpose if you
    have to write two more XML files for two more XSL stylesheets, eh?
    Then I'd be left with 6 files where I started with 3, and the same
    management nightmare. Anyone have a solution to this perplexity,
    cause it doesn't seem like its been solved easily in the forums
    here or anywhere I can find on the Web. I'm thinking maybe
    conditionals, but I'm not sure where to go from there. Thanks in
    advance!

    I'm going to need a little more detail. I have very little
    ASP experience. Are you saying to use the <xsl:include> tag
    in the individual XSL Stylesheets to pull only the data I want from
    the XML file? That's the idea. I've already got different repeat
    areas setup in three different XSL files, each pulling different
    areas of the XML file. But then, how would I direct the browser to
    display the correct XSL file to begin with, when the original call
    to display it is just a link to the XML file, which can only push
    out one of the XSL files to the viewer?

  • One xml, multiple xsl, multiple xslt, one output

    Hi,
    I have one xml file, 3 xsl files, and want to output (append) to a text file.
    I can only get a result when I run one xsl against the xml, if I try adding new xsl and new Transform instances, I get a whole host of errors. The bits in bold are what i'm adding to run a second transformation against original xml file, with a new stylesheet. Where am I going wrong?
    Here's my code:
    // create the XML content input source:
    String xmlInputFile = getFilepathdoc();
    Source xmlSource = new StreamSource(new FileInputStream(xmlInputFile));
    // create the XSLT Stylesheet input source
    String xsltInputFile1 = DefaultValues.xsl1;
    Source xsltSource1 = new StreamSource(new
    FileInputStream(xsltInputFile1));
    String xsltInputFile3 = DefaultValues.xsl3;
    Source xsltSource3 = new StreamSource(new
    FileInputStream(xsltInputFile3));
    // create the result target of the transformation
    // appends file
    String xmlOutputFile = DefaultValues.text1;
    Result transResult = new StreamResult(new FileOutputStream(xmlOutputFile,true));
    // create the transformerfactory & transformer instance
    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer t = tf.newTransformer(xsltSource1);
    TransformerFactory tf3 = TransformerFactory.newInstance();
    Transformer t3 = tf3.newTransformer(xsltSource3);
    // execute transformation & fill result target object
    t.transform(xmlSource, transResult);
    t3.transform(xmlSource, transResult);
    Thanks

    The XSL stylesheets (xsltSource1 and xsltSource3) pose no problem at all. It is only the XML document to be transformed (xmlSource) that can cause problems if you supply its content in a stream-based object like an InputStream or a Reader. To clarify what I mean, here are a few examples.
    1. Multiple XSL transformation using multiple instances of stream-based source objects
    a) Instantiation with an InputStream:...
    Source xmlSource1 = new StreamSource(new FileInputStream(xmlInputFile));
    Source xmlSource3 = new StreamSource(new FileInputStream(xmlInputFile));
    t.transform(xmlSource1, transResult);
    t3.transform(xmlSource3, transResult);
    ...b) Instantiation with a Reader:...
    Source xmlSource1 = new StreamSource(new StringReader(<string content of xmlInputFile>));
    Source xmlSource3 = new StreamSource(new StringReader(<string content of xmlInputFile>));
    t.transform(xmlSource1, transResult);
    t3.transform(xmlSource3, transResult);
    ...Note that if you did the transformation multiple times with either xmlSource1 or xmlSource3, you would get an error. That's why I used different sources.
    2. Multiple XSL transformation using a single instance of a non-stream-based source object
    a) Instantiation with a File:...
    Source xmlSource = new StreamSource(new File("C:/xmlInputFile.xml"));
    t.transform(xmlSource, transResult);
    t3.transform(xmlSource, transResult);
    ...b) Instantiation with a String that conforms to a URL:...
    Source xmlSource = new StreamSource("file:C:/xmlInputFile.xml");
    t.transform(xmlSource, transResult);
    t3.transform(xmlSource, transResult);
    ...

  • 3D: Deleting a mesh, applying multiple materials, "New volume from Layers"

    I am learning the 3D capabilities of Photoshop CS5 Extended and have some questions that do not appear to be covered in the help reference material:
    Can I remove a mesh from a 3D Layer / scene?
    For instance, after having merged two 3D layers together.
    Can I apply multiple materials to a single mesh?
    I can see that more complex meshes have multiple materials applied to them. Does Photoshop have the capability to add/remove more than one materials to meshes?
    What is "New volume from Layer" intended to do?
    I couldn't find this specific menu item in the help reference material anywhere.
    Thanks,
    B.
    PS: I sat waiting on hold for Adobe tech support for 2 hours and 17 minutes with no signs of life before giving up. When I explored callback options online, the website said that no options are available for Photoshop. This level/absence of support is mind-bogglingly awful for an enterprise like Adobe. I know me grousing about it here won't change anything, but I need to get my frustration out of my system and writing it down helps.

    Hi B.,
    Can I remove a mesh from a 3D Layer / scene?
    For instance, after having merged two 3D layers together.
    You can only hide meshes in the scene, not remove or delete them. You have to delete the whole 3D layer to remove meshes from a document.
    Can I apply multiple materials to a single mesh?
    I can see that more complex meshes have multiple materials applied to them. Does Photoshop have the capability to add/remove more than one materials to meshes.
    With Photoshop you can't replace an existing single material with multiple materials. There's very limited ability to edit UV mapping and you'll want to do that in a full 3D modeling application. Repoussé meshes are created with 5 materials to a single mesh object so technically, yes to your question; But that's not really what I think you're asking.
    What is "New volume from Layer" intended to do?
    I couldn't find this specific menu item in the help reference material anywhere.
    This has applications in scientific and medical imaging, but doesn't need to only be used there. An example would be to use a DICOM format, multi-sliced imaging scan and have the layers of the scan modeled into a volume. It is really just taking successive layers and placing them at equal distance in space. The Render Settings dialog offers a few options to vary the displayed volume after it's generated.
    I'll see if I can get that model tomorrow and try to find out why the menu items are not working. You're talking about the group of 4 that includes 'Hide Nearest Surface', right?
    regards,
    steve

  • [javax.servlet.Filter] can i apply multiple jsp & servlet to a filter?

    i have try to applied multiple jsp page & it runs correctly.
    my descriptor is like this:
        <filter-mapping>
            <filter-name>AnonymousFilter</filter-name>
            <url-pattern>/user/a.jsp</url-pattern>     
            <url-pattern>/user/b.jsp</url-pattern>
            <url-pattern>/user/c.jsp</url-pattern>       
        </filter-mapping>now i want to add a servlet, but that filter is not executed...
    i have tried descriptor like this:
        <filter-mapping>
            <filter-name>AnonymousFilter</filter-name>
            <url-pattern>/user/a.jsp</url-pattern>     
            <url-pattern>/user/b.jsp</url-pattern>
            <url-pattern>/user/c.jsp</url-pattern>       
            <servlet-name>dServlet</servlet-name>
        </filter-mapping>and like this:
        <filter-mapping>
            <filter-name>AnonymousFilter</filter-name>
            <url-pattern>/user/a.jsp</url-pattern>     
            <url-pattern>/user/b.jsp</url-pattern>
            <url-pattern>/user/c.jsp</url-pattern>       
        </filter-mapping>
        <filter-mapping>
            <filter-name>AnonymousFilter</filter-name>
            <servlet-name>dServlet</servlet-name>
        </filter-mapping>both are not work...
    is the descriptor wrong? what is the correct descriptor?
    thank you.

    i forgot about dispatcher type...
    the servlet is accessed via FORWARD
    & i map the servlet to /WEB-INF/dServlet...
    it is wrong? but the servlet is accessible...
        <servlet-mapping>
            <servlet-name>dServlet</servlet-name>
            <url-pattern>/WEB-INF/dServlet</url-pattern>
        </servlet-mapping>the web.xml now is:
        <filter-mapping>
            <filter-name>AnonymousFilter</filter-name>
            <url-pattern>/user/a.jsp</url-pattern>     
        </filter-mapping>
        <filter-mapping>
            <filter-name>AnonymousFilter</filter-name>
            <url-pattern>/user/b.jsp</url-pattern>
        </filter-mapping>
        <filter-mapping>
            <filter-name>AnonymousFilter</filter-name>
            <url-pattern>/user/c.jsp</url-pattern>       
        </filter-mapping>
        <filter-mapping>
            <filter-name>AnonymousFilter</filter-name>
            <servlet-name>dServlet</servlet-name>
            <dispatcher>FORWARD</dispatcher>
        </filter-mapping>i put this inside the filter:
    System.out.println(System.out.println("Anonymous Filter > " + httpRequest.getRequestURI());& hopelessly when i access from a.jsp, b.jsp, c.jsp the filter do print in System.out. but not from servlet...
    someone please help me...

  • Applying multiple blending options to same layer?

    How could I apply multiple layer blending options to a single layer? Currently, when I select a blending option and switch to another, it removes the previous blending option
    Thanks.

    You can duplicate the layer and set the top layer to the second blend mode. Or you can create an adjustment layer, and set its blending mode to the preferred second mode (this will blend a merged visible copy of the layers below back into the visible stack). It depends on what you're trying to do. In general though, blending modes are a blend of one layer's pixels into a merged visible copy of those below, so adding two modes to a layer seems to me impossible.

  • Apply multiple effects at once in imovie hd?

    i have applied multiple effects to a clip ("adjust color," "soft focus" "brightness and contrast" etc).
    the effects in combination create a distinctive look which i would like to apply to a whole movie. but it takes a long time to apply each effect.
    is there a way to copy or save a group of effects as a set, and then apply them all at once in order to save time?

    how MUCH faster is FC for rendering effects?
    Not any faster at all.
    The difference is that you can apply them all within a few seconds and then have lunch (or whatever) while FCE renders ALL of them in sequence without further user interaction.

  • OutOfMemoryError when applying an xsl transformation

              Hello,I have an OutOfMemoryError when applying an xsl transformation to generate
              htmlcode in a web page. I'm running Weblogic 6.1 sp2I think the problem comes
              from the objectin which th html is stored during thetransformation. The problem
              only occurs from a minimal xml size. I could fixit by increasing JVM allocated
              size but I would like to find a more flexible solution. If I know an other way
              to solve this problem, I really would appreciate !
              Thank you,
              Laurent.
              [AgentsGeres.jsp]
              

    Hello,
    You might try asking your question in the JSP newsgroup:
    http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=xover&group=weblogic.developer.interest.jsp
    There just may not be a more flexible solution :-)
    This doc may be of some value, see chapter 2:
    http://edocs.bea.com/wls/docs61/pdf/perform.pdf
    HTH,
    Bruce
    Laurent Gosuin wrote:
    >
    Hello,
    I have an OutOfMemoryError when applying an xsl transformation to generate html
    code in a web page. I'm running Weblogic 6.1 sp2
    I think the problem comes from the objectin which th html is stored during the
    transformation. The problem only occurs from a minimal xml size. I could fix
    it by increasing JVM allocated size but I would like to find a more flexible solution.
    If I know an other way to solve this problem, I really would appreciate !
    Thanl you,
    Laurent.
    Name: AgentsGeres.jsp
    AgentsGeres.jsp Type: Hypertext Markup Language (text/html)
    Encoding: base64

  • Applying multiple strokes with JS

    Does anybody have any idea, how to apply multiple strokes to a path with JavaScript? Assigning strokes width, caps, position in stack (my particular concern)? All i can do at the moment is to apply a single stroke. Thanks in advance!

    I'm writing a script that would generate random stroke appearences on the fly, so using premade graphic styles does not work for me. Your samples work for a single stroke and so far i can't figure out how to apply several of them to the same path. Every next setting overwrites the previos. Can't get, say, two storkes of different width and color applied to the same path.
    yourpath.zOrder (ZOrderMethod.SENDTOBACK); works in the layers stack for moving layers up and down, and i would like to move strokes in appearance tab the same way. Can't figure out how to make it either. Thank you anyway, Carlos!

  • Applying multiple themes in powerpoint?

    Does anyone know how to apply multiple slide themes or multiple slide masters to one powerpoint presentation?

    Yes or export as individual QT movie files and joint them with iMovie, QT Pro or a 3rd party app just for joining movies.

  • Lightroom 2.0  Apply multiple presets to selected images

    Lightroom 2.0, Windows XP or Vista
    Is it possible to apply multiple presets, e.g. General - auto tone and General - punch to a selected range of images in Library or Develop Mode?
    What are the steps to do this?
    Thanks in advance,

    I'll try to clarify my question regarding presets.
    1. Can I somehow apply more than one preset to images during Import?
    2. Can I select a group of images, in either the Library or Develop mode, and apply a preset to the entire selection with one or 2 clicks of the mouse. I'd like to avoid clicking on each image to apply the preset.
    I'm not concerned that the multiple presets may be additive. In fact that is exactly what I am trying to accomplish.
    Thanks much for your patience, I'm a newbie.

  • How to apply multiple saved headings/footers to a document?

    Good afternoon!
    I hope this 1) isn't a duplicate question (I searched for similar problems before posting) and 2) isn't the case of stupid human error I suspect it is.
    Basically, I've created and saved five or six different header/footers that I need to apply to a document. After opening my document, I follow the following steps:
    1. Document -> Header & Footer -> Add -> Apply first saved header
    2. Save document
    3. Document -> Header & Footer -> Add -> Click "Add New" -> Apply second saved header
    At the point where I choose the second saved header, the header I applied first disappears in the preview window, and as soon as I apply the second saved header, it overwrites the first header entirely rather than coexisting with it on the page.
    Is there a way to make multiple saved headers/footers exist simultaneously in a single document? I know you can add new headers/footers by hand to a document with existing headers/footers as described in the Acrobat Help File, but I have scores of documents to apply these to, so I wanted to use saved settings together with a batch job.
    I hope that's all clear, but please let me know if there's any confusion as to what I've done/need to do.
    Thank you so much in advance for your assistance.
    JMW
    P.S.
    All PDFs were created using Adobe Acrobat/Distiller 8.0 and Framemaker 9.0 on Windows XP SP4.

    Bon Dias,
    If the values for Top, Bottom, Left, and Right are the same in the Margin pane of each saved setting's "Add Header and Footer" dialog you may want to consider making each saved setting's Margin setup different.
    Be well...

  • Using multiple XSL files parsing a XML file

    Hi,
    Can a single XML be procesed by a XSL file in which are included many XSL stylesheet?
    I mean, my Java servlet writes the results of the SQL
    queries in a single XML document. Something like this:
    <?xml version="1.0" encoding="UTF-8" ?>
    <body>
    <!-- Part 1 -->
    <record>
    <nombre>Monica</nombre>
    <apellido1>Amann</apellido1>
    <apellido2>Ostos</apellido2>
    </record>
    <!-- Part 2 -->
    <record>
    <domicilio>Rodriguez Arias</domicilio>
    <numero>41</numero>
    <piso>5</piso>
    </record>
    <!-- Part 3 -->
    <record>
    <nombre>Ana</nombre>
    <apellido1>Garcia</apellido1>
    <apellido2>Ostos</apellido2>
    <domicilio>Rodriguez Arias</domicilio>
    <numero>41</numero>
    <piso>5</piso>
    <mano>Decha</mano>
    </record>
    </body>
    I want to be able to apply a particular stylesheet into diferent part of the XML file.
    I mean, i have a XSL (father), in which are included various XSL. My problem is that
    i can apply the bloque1.xsl to process part1 in the xml, and bloque2.xsl to process
    part2 in the xml and the same with the thrid.
    This is my XSL (father), but i don't know whats the way to do it. And i don�t konw if
    it's possible to do it.
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:fo="http://www.w3.org/1999/XSL/Format"
    version="1.0">
    <xsl:include href="/aplic/fop/ejemplos/bloque1.xsl" />
    <xsl:include href="/aplic/fop/ejemplos/bloque2.xsl" />
    <xsl:include href="/aplic/fop/ejemplos/bloque3.xsl" />
    <xsl:template match="body">
         <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
              <fo:layout-master-set>
              <fo:simple-page-master master-name="simple"
                   page-height="21cm"
                   page-width="21cm"
                   margin-top="1cm"
                   margin-bottom="1cm"
                   margin-left="1.5cm"
                   margin-right="1.5cm">
                   <fo:region-body margin-top="1.5cm"
                   margin-bottom="1.5cm"/>
              </fo:simple-page-master>
              </fo:layout-master-set>
              <fo:page-sequence master-reference="simple">
              <fo:flow flow-name="xsl-region-body">
              <fo:block text-align="right">
                        <fo:external-graphic src="c:\aplic\fop\ejemplos\barcode.jpeg" width="8.1cm" height="3.7cm"/>
              </fo:block>
                   <xsl:apply-templates/>
              </fo:flow>
              </fo:page-sequence>
         </fo:root>
    </xsl:template>
    <!-- Here i should code the rest of the XSL to join the diferents parts of the XML with its corresponded XSL -->
    </xsl:stylesheet>
    Finally i have to produce a single resultant report into pdf outformat. For this, i am using XSL-FO.
    Thanks a lot, and i'm sorry for my english language.

    The examples of Xalan (check xml.apache.org) do just that.
    Micks

Maybe you are looking for

  • Playback Quality on HD LCD TV is same as Canvas - Pixelated.

    Hey Guys, Can anyone help me here - I recently purchased a 19" HD ready TV for full screen playback through FCP 6. I used a Mini DVI to DVI adaptor from the Mac then a DVI to HDMI to go into the TV. Everything works fine & is in sync, except the qual

  • Editing Final Cut Studio Projects on Final Cut X

    Has anyone heard if you will ever be able to edit older Final Cut projects on the FC X?

  • G3 Ti200 Pro VT - TV Out & nView?

    Hello all. I have the above card, and, as it seems with most people, I can't get TV out to work. I want to use the card for video editing and have managed to get Video In working fine. I have tried 21.83, 28.32 & 30.82 drivers but I am unable to sele

  • How to repair PS Elements 6.0?

    Good evening, After 2 years of trouble free functioning with Vista on my Sony Vaio laptop, this program decided to go on strike. It won't launch anymore and instead I get a pop-up indicating problems with the licence/registration and saying that I ne

  • Help - How to process RMA on 2 instances (OM&Financials and Manufacturing)

    Hi, My company has implemented 12i on 2 instances, one for Order Management/Financials and one for Manufacturing with Financials Shell (enough set-up to run Mfg module). How is an RMA created and processed on instance 1, yet linked to the receiving o