How to add XSLT processing tag?

Hello,
I am using the following codes to generate xml with xslt processing tags.
However it does not working. That is, it does not add the xslt processing
tag into xml outputs. I am using 1.6.x. I must be doing something wrong?
Document doc = db.newDocument();
Element root = doc.createElement("myroot");
doc.appendChild(root);
ProcessingInstruction pi =
     doc.createProcessingInstruction("xml-stylesheet",
     "type =\"text/xsl\" href=\""+xslt+"\"");
doc.insertBefore(pi, root);
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
OutputFormat format = new OutputFormat(doc);
XMLSerializer serial = new XMLSerializer(pw, format);
serial.asDOMSerializer();
serial.serialize(doc.getDocumentElement());
pw.flush();

Instead of adding processing instruction directly inside DOM object, add the processing instruction while serializing XML like this
Document doc = db.newDocument();
Element root = doc.createElement("myroot");
doc.appendChild(root);
//ProcessingInstruction pi = doc.createProcessingInstruction("xml-stylesheet",
//     "type =\"text/xsl\" href=\""+xslt+"\"");
//doc.insertBefore(pi, root);
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
OutputFormat format = new OutputFormat(doc);
XMLSerializer serial = new XMLSerializer(pw, format);
serial.asContentHandler().processingInstruction("xml-stylesheet","type=\"text/xsl\" href=\"users.xsl\"");
serial.asDOMSerializer();
serial.serialize(doc.getDocumentElement());
pw.flush();or use an alternate serializer like this one (coming from [http://exampledepot.com/]
    // This method writes a DOM document to a file
    public static void writeXmlFile(Document doc, String filename) {
        try {
            // Prepare the DOM document for writing
            Source source = new DOMSource(doc);
            // Prepare the output file
//            File file = new File(filename);
              StringWriter sw = new StringWriter();
            Result result = new StreamResult(System.out);
            // Write the DOM document to the file
            Transformer xformer = TransformerFactory.newInstance().newTransformer();
            xformer.transform(source, result);
        } catch (TransformerConfigurationException e) {
        } catch (TransformerException e) {
    }  

Similar Messages

  • How to add the "EXPLICIT" tag on my music (not pirated)

    Hello (i'm French, so i'm sorry for my English)
    Well, when sometimes i buy some musics, i can see the red tag "EXPLICIT" & my question is (after many research) is:
    How to add this tag on my own music (music that i bought in a store & ripped into Apple Lossless [.m4a])
    Thank you very much.
    Message was edited by: Haaghun

    http://hints.macworld.com/article.php?story=20070616175442397
    http://mac.majorgeeks.com/download5526.html

  • How to add a br tag in headerText attribute in af:column in jdeveloper

    Hi,
    I want to add a <br> tag in headerText attribute of <af:column> in jdeveloper 11.1.1.5.0. I want to add this in a String getting from a java bean.
    for eg. i have month and Year so i want to print it in the format given below
    2012
    Jan
    and for taht i hav to add a <br> tag in the headerText attribute of <af:column>. for eg.
    String month= "2012" + "<br>" +"Jan";
    bt this is printing as it is in the header text .
    thnx.

    Bind the headerText property to the managed bean for the taskflow / jspx.
    Write the code in the getter of the headerText.
    Alternatively you can use EL in the headerText property on the jsff/jspx .. for e.g if there are different attributes for the month and the year you can use
    headerText="#{bindings.month.inputValue} #{bindings.year.inputValue} "

  • How to Add  Multiple Meta tags?

    I work for a large state educational orgranization that needs
    to add meta tags to the header as part of the
    Dublin Core Metadata Initiative.
    In this case, not having meta tags is not an option.
    The meta data has to be unique to each page. Using the
    Keywords / Description parameters provided in the menu will not
    work.
    Hacking the "ccKeywordsAndDescription.js"
    "ccKeywordsAndDescription.htm" files is not an option as different
    meta data tags are required on each page and sometimes several of
    the same meta data tags are required on one page
    (ex: <meta name="DC.Subject" scheme="Keyword"
    content="####">
    Because of this, adding a template parameter for each
    editable meta data tag appears not to work as well.
    This issue was brought up once before in this form by some
    one else but not answered. I figured I would check again.

    It does not look like this is doable within Contribute, so we
    are going outside for a solution.
    The users create the page they need in Contribute from a
    template with an editable region in the header. Then the users go
    back in to the page with a Meta tag creation program called Tag Gen
    which has the same editable region defined in its preferences. They
    can add the needed tags save and close the page without ever
    dealing with the page code. Then they go back into Contribute to
    publish the page.
    It is kind of alot of Micky Mouse work but it is the only
    solution we could find.

  • How to add a new tag library into ALBPM 5.7?

    I want to use a tag library but I don't know ho to configure ALBPM to use it.
    Anyone knows how to do it?
    Thanks
    Regards

    Hello,
    I think u need to import all resources used by your TagLib as .TLD .JAR to inside process.

  • How to add cleaning process in BOM?

    In my process weekly cleaning is done but I have BOM which is created for per Brew.How can I add the cleaning components in my BOM,Should I create different BOM if yes then How can I connect associate the cost of components with reference to the order.
    Kindly provide me the solution.
    Edited by: ChintanH on Jul 26, 2011 2:51 PM

    Pl explain your requirement indetail.
    Based on your requirement,
    Yes you can add the cleaning componenets in the BOM (if the production process will take more than a week).
    In recipe  you can also add a phase called cleaning and you can assign the BOM components (Cleaning) in that.
    then assign the backflush indicatro, once you confirm that operation, it will be backflushed.
    (Normally since the cleaning components are very low value, it will be treated as consumables. and issued against cost centers)
    Thanks,
    JK

  • How to add Multiple XML Tags for a single column for an RDF

    Hi Gurus,
    I have Requirement in the Oracle D2k Report from which we are generating the xml tags.
    My Requirement is in a table i have 2 columns say A and B.
    i am able to generate three xml tags separately using the report builder by clicking on the column name and in the xml setting giving the xml tag.
    eg: table Acount contains 2 columns A and B with respective data
    A B
    QT 1
    QTS 0
    QTR 2
    i am able to general xml tags like this
    <ACount>
    <AStatus>QT</AStatus>
    <HeadCount>1</HeadCount>
    </ACount>
    <ACount>
    <AStatus>QTS</AStatus>
    <HeadCount>0</HeadCount>
    </ACount>
    my requiremnt for the xml tags is
    <ACount>
    <AStatusQT>1</AStatusQT>
    <AStatusQTS>0</AStatusQTS>
    </ACount>
    kindly help me out how to achieve this requirment in the rdf file mulitple xml tags.
    all your input are most valuable to me, thanks in advance
    Edited by: 909577 on Apr 9, 2012 3:10 PM

    I'm sorry for being so dense, but I'm not quite following, although what I've tried makes me think if I can follow you, it will work :)
    To answer your initial questions, you are correct with both your assumptions:
    1) detailType is the parameter that specificies YTD/Weekly, this is a "report defined" parameter that I am using to determine which Row Group to display (either YTD or Weekly)
    2) SchoolDaysActiveWeek is the parameter that is being set to either true or false -- this is a field in the cube that states whether that record is for the current week or not
    So in following your instructions, well that's the problem I'm not quite following :)
    1) When you say Delete the SchoolDaysActiveWeek parameter from the report only, do you mean to mark the parameter as Hidden?  If so, I've done this.
    2) I'm not quite sure where to use the statement you provided me.  You said to put it in the dataset, but I don't know which dataset.  I assume you mean the "main" dataset (as opposed to the hidden dataset that gets generated when you mark a field
    as a parameter).  If this is the case, the only place I could see that would allow you to use such a statement is in the Filter section of the properties.  I tried this, and it did not generate any errors, but it also kept my report groups from displaying
    -- it just showed a blank report, so I think it probably wasn't bringing back any rows to populate them with.
    I also tried going into the Expression section for the SchoolDaysActiveWeek parameter in the second screenshot and placing the statement there.  When I did this and ran the report, I would get the following error:
    The 'SchoolDaysActiveWeek' parameter is missing a value
    So what am I missing!? 
    Also, thanks for taking the time to respond!!

  • How to add html image tag in formsweb.cfg file

    Dear all,
    I am trying to display one image in background(not on form) by using HTMLbeforeform attribute in formsweb.cfg.
    from local machine that image is displaying..from other machine which is network I can able to access the forms first page but that image is not displaying..
    Where i need to keep the image? Is there any shared folder to keep images?
    The following code can give a clear idea...
    # HTML page title
    pageTitle=My Forms Server
    # HTML attributes for the BODY tag
    HTMLbodyAttrs=
    # HTML to add before the form
    HTMLbeforeForm=<img src='G:\images\logo.jpg' align=left height=150 width=150>--wich loc i need to place the img
    # HTML to add after the form
    HTMLafterForm=<MARQUEE><font color=blue><b><I>HAVE A NICE DAY!</MARQUEE>

    The image-tag has to point to an url at the application-server which is accessible from the client's browser. So, if your forms-url is something like
    http://host:port/forms/frmservlet?config=xxxThe image-url should be something like
    HTMLbeforeForm=<img src='/path/logo.jpg' align=left height=150 width=150>where path is a virtual directory on the application server. Either create such a virtual directory or use an existing one, like /forms/java, which points to $ORACLE_HOME/forms/java on the server.
    You can test that by puttin the url "by hand" in the browser like
    http://host:port/forms/java/logo.jpg

  • How to add parent XML tag in ID CS5

    Hi,
    I have the following xml structrure in the InDesign cs5 document.
         <para>
              <link>
                    <insert>
    I want to add <xref> tag within this structure as parent to <insert>, like below:
         <para>
              <link>
                    <xref>
                        <insert>
    can anybody help me on this.
    Thanks,
    Krishnan

    Hi,
    First Select <insert> tag,
    var parentTagName = app.selection[0].associatedXMLElements[0].markupTag.name;
            if(parentTagName.toString() == "insert"){
                app.selection[0].associatedXMLElements[0].xmlElements.add("xref", app.selection[0]);
    Regards,
    Bala.

  • How to add raw HTML tags inside JSF tags...

    Hi
    I would like to use <input type = text > inside my project in some area..The following code hides the input = type html tag and forwards the click event to jsf command button...After selecting the file,it should forward the value to jsf textfield....
    My code seems as below.
    <h:form id="detailForm" onsubmit="printElements(detailForm,this)">
    <f:verbatim>
    <input id="uploadFile" type="file" style ="dispaly:none"size="100" />
    </f:verbatim>
    <h:inputText id="docName" style="width:650px;" maxlength="100"/>
    <h:commandButton id="visibleBrowseButton" value="Select File..." onclick="'detailForm:uploadFile'.click();callClick();">
    </h:commandButton>
    </h:form>
    <script type="text/Javascript">
    function callClick()
    var val = document.detailForm.uploadFile.value;
    document.getElementById('detailForm:docName').value = val;
    </script>
    While running this page it works fine in IE but in Mozilla firefox it troubles me during detailForm:uploadFile'.click().
    I suspect the jsf page cannot able to detect the raw html tag inside jsf tags...Eventhough i tried using inside<f:verbatim> it wont works..
    I would like to know
    1.Whether the code is right,,if the code goes wrong why it got runned in IE not in firefox....
    2.How can raw html tags can be integrated inside JSF tags....

    First of all, why are you ignoring valuable answers about a JSF fileupload component in your previous topic?
    Second, you can just nest raw HTML anywhere in your JSF page. Your problem is rather related to JavaScript. It has completely nothing to do with Java nor JSF. Learn JavaScript -there is a nice tut at w3schools.com- and look for a JavaScript forum if you still stucks. There are ones at webdeveloper.com and dynamicdrive.com.
    The f:verbatim is only required if you was using JSF 1.1 or older, which is not the case. You would have occurred completely different problems.

  • How to add XML Header tag to XML output from XI?

    Hi ,
    My requirement is I need to genarate the XML according to client requirements.
    I am able to genareate the XML with  <?xml version="1.0" encoding="UTF-8" ?>  as Header but client requiremetn is like this
    <?xml version="1.0" encoding="UTF-8" ?>
    <?Label MEXICO|PROFILE|2033169|SUCCESS?>
    and hear MEXICO and 2033169 will change dynamically for every xml genaration. How it make as dynamical and how can I achive this.?
    Plz guid me...
    Thanks
    Krishna

    You can refer to the code provided in this thread XML Tag Issue: Need extra Line with Xml RooTag and Convert the IDOC XML file into single string? . Java mapping would do these steps -
    a) Convert the incoming xml into string.
    b) Modify it with some string function as per requirement.
    c) Convert the string back to xml.
    For more understanding about Java mapping, go through links provided in the thread java mapping .
    Regards,
    Sunil Chandra

  • How do I add a type tag to my enclosure with iWeb?

    I encode my video with QuickTime, manage my website with iWeb, and upload it to the web with Transmit.
    A few episodes ago, my podcasts stopped updating on Podcast Alley. Tech support pointed out the problem: There are no type tags on any of my enclosures.
    From what I gather, the type tag tell you what kind file it is - ie, a .m4v
    I don't have any idea how to add a type tag to an enclosure using iWeb, and I don't even know if its possible. I would think that iWeb would do it automatically.
    Also, how do I change my feed? I originally just used the feed iWeb created:
    http://www.leilajones.com/jonescast/...esCast/rss.xml
    But then set up a feedburner feed - which I now submit when I submit anywhere new.
    http://feeds.feedburner.com/jonescast
    But how do I change the rss feed on my website with iWeb... I love the simplicity of it, but it's so limiting...
    Also, how do I change the feed in iTunes to the Feedburner feed?
    Thanks for your help,
    http://www.jonescast.com

    Page 215 might help:  http://manuals.info.apple.com/en_US/iPhone_iOS4_User_Guide.pdf

  • How to Add meta tag in bsp

    hi experts,
    we have a bsp page,in which i need to declare meta tags,like in html.
    but though i delare it,while i debug the code,I can see its not  passing through the meta code.
    please advise me how to add a meta tag in bsp.
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <%@extension name="xhtmlb" prefix="xhtmlb" %>
    <%@extension name="crm_bsp_ic" prefix="crmic" %>
    <%@extension name="bsp" prefix="bsp" %>
    <%@extension name="chtmlb" prefix="chtmlb" %>
    <%@extension name="thtmlb" prefix="thtmlb" %>
    <%
      DATA: lv_xml         TYPE string.
      lv_xml = controller->configuration_descr->get_config_data( ).
    %>
    <%meta http-equiv name=  "WorkspaceId"  content= "a2ac9b45-65bb-4d25-9fb6-d9478280fa19"  /% >
    <%meta  http-equiv name="SmartTags" content="SAPCRMCREATEACCOUNT" /%>
    <chtmlb:config xml  = "<%= lv_xml %>"
                   displayMode = "<%= controller->view_group_context->is_view_in_display_mode( controller ). %>"
                   mode = "RUNTIME" />
    Edited by: Anu_87 on Jun 29, 2010 6:50 PM

    Hi,
    there are no meta tags in HTMLB !!   If you really need to include these in your development, you have to do it with the old HTML tags like this:
    <html>
    <head>
    meta name="author" content="Anna Lyse"
    meta http-equiv="expires" content="Sat, 01 Dec 2001 00:00:00 GMT"
    meta name="keywords" lang="en-us" content="vacation, Greece, sunshine"
    </head>
    </html>
    I cannot enter the correct code for META because the @§$%&/ configuration in this forum is triggering an error page !!

  • How to add bad pixels to a DNG made from a CFA sensor raw data ?

    Hello all, I'm trying to build a proper DNG file from the raw CFA image acquired directly form an industrial camera.
    As usually there are a number of bad pixels around and I would like to mark them in the DNG so they can be correctly interpolated when the image is processed.
    In the latest DNG SDK (1.4) I've only found this rather thin references:
    "Defective Pixels
    There are two ways to deal with defective pixels in DNG.
    The first is to map out (interpolate over) the defective pixels before storing the raw data in DNG.
    The second is to include a bad pixel fixing opcode in the OpcodeList1 tag."
    OK, as each program/customer/etc. seem to have its own ( best ) algorithm to interpolate the bad pixels then OpcodeList1 it is.
    But then I've got this: FixBadPixelsConstant and I'm not clear about its usage, especially BayerPhase, is the same BayerPhase that is specified as a global property of the CFA or it is something separate and what ?
    Also is there some "industry standard" value for the Constant that will make more likely the established programs to process correctly the image ?
    And this Constant value is unique per DNG or can it be more ot them added, i.e. to somehow characterize the "badness" of the pixel, like reduced sensitivity, stuck at 0/max, etc ?
    In the end if somebody can share an one-liner on how to add programatically this tag using the SDK I'll be very grateful.
    Sorry for my newebie questions and many thanks for your help.

    Hello Dear
    Look FB60 screen has two parts :
    The one in which you enter information related to vendor is Header Level, in this case you already assign Personnel No. in Vendor Master so no field is required as Personnel no. will be picked up from Vendor Master level.
    The Other is line item level is bottom half part, if you want to assign personnel no. at Expense G/L level then if you scroll right you will find a field for Personnel no. If you can't see the field check your setting at OBVV for the field status group you assign to particular Expense G/L.
    Hope you Understood
    Cheers
    IMK

  • How to add localized (english, french, etc) metadata

    I found that i can access localized versions of an image metadata tag with Bridge scripting.
    This is great, except i don't know how to add different language tags in Bridge.
    I am exporting the metadata to an xml file and it would be great if i could have the title tag in two or three different languages.
    Thank you
    Balint

    Hi,
    You can add localized text via the XMPScript API. Use SetLocalizedText() on the alt-text property. For example:
    xmp.setLocalizedText(XMPConst.NS_DC, "title", "en", "en-US", "SomeEnglish);
    xmp.setLocalizedText(XMPConst.NS_DC, "title", "fr", "fr-FR", "SomeFrench");
    If you always supply both the generic, fr, and specific, fr-FR, tags then you should have no problems and a new entry will be added to the array unless there is already an exact match - in which case you would modify the entry.
    Hope that makes sense.

Maybe you are looking for

  • Batch Updating a UDF based on user input.

    I have been asked to come up with a way to update several PO's with a update. We have several PO that come in on 1 container, the Container NO (UDF) is updated per PO Then several weeks later the Rev. Delivery Date (UDF) needs updated. Is there a way

  • Threaded Anchored Text Boxes Causing Problems (Crashing)

    I have a set of three anchored styled text boxes inside my primary text flow. Indesign seemed to allow this, but is now having trouble after I resized the Primary text frame and pinched these anchored boxes. The documnet is now in overset after the s

  • Edit Built in Reports

    Hi, Can I change the SQL Query of the built in Reports. Please  help

  • Commit in procedure, function

    Hi all, I am confusing about "use of commit in procedure and function".How commit reflect to the performance ? Is there any error raises by frequent use? pls explain me. Thanks in advance sanjay

  • Not able to Setup PIA with IP

    Hi Guys, I am trying to setup a PIA with app server in the same server. When I used "localhost" as AppServer name, it works correctly. However, if I used IP address as AppServer name, it displays an error to show app server down. Does anybody come cr