Real simple xslt problem/question

Hi, i have a real simple xslt problem but i just cant figure out how to do it by looking at various examples on the net. i have a xml document and in it are some elements with a "result" tag name. i want to use xslt to reproduce exactly the same xml document except with an attribute called "id" added to those elements with a "result" tag name. i'm sure that theres a simple solution to it but i just cant figure it out. any helps greatly appreciated, thanks

Start with the XSLT identity transform (I don't have it handy and it's fairly long, but you should be able to google it up). Add this:<xsl:template match="result">
  <result id="">
    <xsl:apply-templates>
  </result>
</xsl:template>

Similar Messages

  • Another simple classpath problem question

    Hi All
    Yes I know, there are a lots of questions about this matter, but I couldn't found a solution to my problem.
    I have a simple program:
    public class prueba {
            public static void main(String[] args) {
                    System.out.println("Ahi va...");
    }placed in /tmp/javier/prueba.java
    After compiled, I've tried to run it from / and then problems started:
    cd /
    java /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
    I said, ok...it could be a classpath problem...then:
    java -cp /tmp/javier/ /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba
    Damn, another try...
    java -cp .:/tmp/javier/ /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
    Jesus Christ....may be the last slash....
    java -cp .:/tmp/javier /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
    Oh...no.... may be classpath to java classes..
    java -cp .:/usr/java/j2sdk1.4.2_01/lib/jre/:/tmp/javier/ /tmp/javier/prueba
    Exception in thread "main" java.lang.NoClassDefFoundError: /tmp/javier/prueba (wrong name: prueba)
    Well, I don't know why this error happens....
    Please, could somebody help me !!!
    Thanks in advance...
    <jl>

    It's not too early to start following the Sun coding
    conventions for Java:
    http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.
    tmlHi
    thanks for your reply.
    Yes, I agree. I use conventions with my programs. But my real problem was with a real application and then I did quickly this simple code to help others to understand the problem and give a fast reply...
    Let me know if that works. (It was fine on my
    machine.) - MODYes it works fine, thanks.... and Damn...Murphys law again, the only option I didn't tried is the solution to my problem... :)
    Thanks again...

  • Real Simple Events Problem. Please Help.

    Hi
    I'm a student learning java at the moment and having a problem getting events sorted. I am trying to reference a evetn between two classes defined within the same main class.
    private ColorPanel c;
    ....withing class called ButtonPanel
    public void actionPerformed(ActionEvent event) {
    Object source = event.getSource();
    if (source == aButton){
    aButton.addActionListener(c);
    .........within class called ColorPanel
    public void actionPerformed(ActionEvent event) {
    String cmd = event.getActionCommand();
    Color c = getBackground();
    if (cmd.equals("red")) c = Color.red;
    Am i going about this the right way. Any help greatly appreciated.
    Alan
    P.s. the program has two frames, press a button in one and it changes the color in the other.

    When you build aButton, add the action handler you show in your ColorPanel class:
    JButton aButton = new JButton(...);
    aButton.addActionListener( yourListener );Then in the actionPerformed method do the color change, like you show. You only need one action handler - the one that listens for mouse clicks and sets the color.
    You shouldn't add listeners in an actionPerformed method. If you add them every time you'll get another call to the actionPerformed for every additional handler added and your program will die a slow death.

  • Few problems/questions! (cover flow, album art...etc)

    Ok I finally added my songs to my new IPOD (replaced my old one) and this is my first Ipod with video, color...etc. Its the IPOD Classic 80 GIG.
    Well I am having a few problems/questions:
    ---Why when I hit "Get album art" does it ONLY get art for my videos? It doesn't get any for all 1,500+ songs! Is it because they aren't downloaded from Itunes? If so then why does it do it for the movies then? They aren't from ITunes either!
    ---With Cover Flow I updated the Album Art myself and have about 700 songs with art now. But I have two problems.
    1. It won't display all 700 songs under Cover Flow!
    2. It won't show them in order by song name! Can I change that?!? If not then how is it showing them by? What do I need to change?
    ---Are there any other video types supported besides that on Mpeg4 and that other weird type? If not why not? Its a pain to have to convert everything. Its almost not worth having this video IPOD if you have to go through sop much effort just to watch 1 stupid video. I mean I spent more money on extra programs now for music and videos then I did on the IPOD almost.
    ---Is there any way to transfer your music from one IPOD to another? I know some people say you can't but why? What about people like me who have music ripped from our own cds and NOTHING from ITunes? Its a REAL pain having to rerip all the cds, put them back on, rename all the songs, fix all the info...etc. Its taken me 4 days now. Apple needs to think about a "IPOD TO IPOD" music transfer kinda program.
    ---How do you get pics on the IPOD without having to keep them on your PC? I notice it has to SYNC them every time I have it plugged into the PC! But if I tell it NOT to sync pics anymore then they won't stay on the IPOD if turn that option off and unplug the IPOD. Theres got to be another way to add them.

    Assassin X wrote:
    ---With Cover Flow I updated the Album Art myself and have about 700 songs with art now. But I have two problems.
    1. It won't display all 700 songs under Cover Flow!
    2. It won't show them in order by song name! Can I change that?!? If not then how is it showing them by? What do I need to change?
    Cover flow on the ipod can only be done (as far as I know) on Album by Artist Name. On iTunes you can change it around
    Assassin X wrote:
    ---Are there any other video types supported besides that on Mpeg4 and that other weird type? If not why not? Its a pain to have to convert everything. Its almost not worth having this video IPOD if you have to go through sop much effort just to watch 1 stupid video. I mean I spent more money on extra programs now for music and videos then I did on the IPOD almost.
    Try using freeware, heres an excellent video converter for iPods:
    http://www.videora.com/en-us/Converter/iPod/

  • JDeveloper IDE simple setting problem

    Hi,
    Recently we switched to JDeveloper from Visual Cafe .I have a simple setting problem.How can I set the options so that IDE gives, the core java classes and packages,and our application classes and packeges, prompts in imports as well as in code.Where to set the options.
    eg: when I write
    import java. it should prompt all the pakages.
    Thanks in advance.
    -Gopal
    null

    I am not sure I understand what you are requesting, but ...
    You can configure JDeveloper projects to include various libraries by default.
    This is done by selecting menu Tools | Default Project Properties.../ Libraries tab.
    You should define a library for your classes.
    You can import any of the packages / classes from all the libraries which your project includes.
    It would be incorrect for a tool to automatically add a bunch of import lines at the top of every file because each file should import what it needs and just as importantly, not import what it does not need depending on the component type (e.g. a servlet should not include javax.swing.* ).
    An easy way to import elements into JDeveloper is to type in something like:
    import java.
    // and then type in Ctrl Space
    and this launches the package browser, you can select packages or classes to import.
    You can also do this at the variable declaratiton point such as typing in:
    foo() {
    Frame x
    // Press Control Alt Space
    and this will correctly change the type (Frame) to the type you select in the package browser and add the import statement.
    -John
    null

  • Simple OOP Problem. Help!

    This is just a simple OOP problem that i cant decide on a best
    implementation for.
    im passing an object to an instance of, 'TabbedFrame', which is just
    a frame with a Tabbed Pane in it that is holding custom panels.
    however, these custom panels need access to the object being
    passed to 'TabbedFrame' and to some methods in it.
    i cant make them static however so how do i gain access to them?
    is my only option to pass the 'TabbedFrame' to each panel?
    like - jtabbedpane.add( "Panel 1", new mypanel1(this));
    here is code:
    new TabbedFrame( DataObject );
    public class TabbedFrame{
    public TabbedFrame(DataObject do){
    this.do = do;
    jtabbedpane.add( "Panel 1", new mypanel1() );
    DataObject do;
    public class mypanel1{
    public mypanel1(){
    // need access to DataObject of the 'TabbedFrame' object that instantiated
    // this 'mypanel1' and to some of its methods
    }i would just pass the DataObject to evey panel (there are 12) but
    i also need to be able to call methods in the 'TabbedFrame'.
    Any help would be appreciated!

    Modify mypanel1's constructor:
    public class mypanel1{
    TabbedFrame tf;
    public mypanel1(TabbedFrame tf){
    this.tf = tf;
    // need access to DataObject of the 'TabbedFrame' object that instantiated
    // this 'mypanel1' and to some of its methods
    DataObject theDo = tf.getDataObject();
    tf.someMethod(); // Call method on the TabbedFrame
    }In TabbedFrame:
    public TabbedFrame(DataObject do){
    this.do = do;
    // Modify call to constructor to pass "this" TabbedFrame.
    jtabbedpane.add( "Panel 1", new mypanel1(this) );
    }

  • Simple X-fi Question, Please Help

    !Simple X-fi Question, Please HelpL I've been looking for an external sound card that is similar to the 2002 Creative Extigy and think I may found it in the Creative X-Fi. I have some questions about the X-fi though. Can the X-fi:
    1. Input sound from an optical port
    2. Output that sound to 5. surround- Front, surround, center/sub
    3. Is the X-Fi stand-alone, external, and powered by a USB or a wall outlet (you do not need a computer hooked up to it)
    Basically I want to connect a TosLink optical cable from my Xbox to the X-Fi. That will deli'ver the sound to the X-Fi. Then I want that sound to go to a 5. headset that is connected to the X-fi via 5. front, surround, and center/sub wires. The X-Fi has to be stand-alone and cannot be connected to a PC to do this.
    Thank you for your help.

    The connector must match, and the connector polarity (plus and minus voltage) must match.  Sorry, I don't know if the positive voltage goes on the inside of the connector or the outside.    Any wattage of 12 or more should be adequate.
    Message Edited by toomanydonuts on 01-10-2008 01:29 AM

  • IMOVIE08/IPHOTO08 TRANSFER PROBLEM QUESTION... HELP HELP HELP!!!

    IMOVIE/IPHOTO TRANSFER PROBLEM QUESTION... HELP HELP HELP!!!
    much like the email above, i am having trouble importing movies --all taken with my same nikon camera and uploaded to iphoto-- from iphoto08 to imovie08. i did a software update today and half the movies i wanted from iphoto, somehow, ended up on imovie. not the half i need to work with, by the way. just came back from christmas with the family. the first time my dad has seen my son. the first time my wife has seen my dad. lots of pictures. my dad wants copies. i got great ideas about making him a DVD... in imovie, i choose, "import movies", follow the steps, create a new event AND... no movie clips show up in my new event... BUT, when i click "mac HD" on my desktop and go the "imovie events", i see the movies is just supposedly imported to imovie as files and can watch them. doesn't help me much when trying to create a movie to send to my dad. no video is played in imovie. HELP HELP HELP!!! i went so far as to trash my 15 movies from iphoto because i thought perhaps the computer was seeing them as photos and not movies. right now my vacation movies are on my desktop. how can i get them to show up in imovie and start my project? HELP HELP HELP!!!

    I think you have set your iPod to an option which everytime you connect it to itunes, it will delete all songs on it and replace it with songs currently in your library. What you need to do is click on the ipod on the sidebar, and on the bottem of the new page click the tick box that says "Manually manage music and video". That way you can delete old songs from your computer and they will stay on your ipod everytime you connect it. Hope that helps ^_^
      Windows XP Pro  

  • 5610 problems/questions

    Okay, i have a 5610, firmware v9.4, and i have the foll problems/questions...
    1) The calender and alarm systems sometimes refuse to work. In the calender, i put reminders, but often it never gives any alarm, even though i have set it to alert me at such-and-such time. The alarm too, simply doesn't work at times. any solutions?
    2) On starting the phone, while updating the library, the phone temporarily gets hanged. After about 5 minutes, its back to normal, and the library is updated, but in those 5 mins i can't do anythinh. any solutions?
    3)On connecting my cell to the comp, i usually use memory storage mode, to access the memory card in windows explorer, cuz its faster than pc suite. afer disconnecting, my phone often says "not enough memory on phone. update cancelled", referring to the music player library update. any solutions?
    4)In menu>steeings>security>security level, what do the options do, i've not noticed any difference...

    security level is to either set passwords for start up of phone ,keypad locks,lock code for phone this enable you to put a pin on the phone where if it was to get stolen the person would need a pin the activate the phone with another sim in it
    If  i have helped at all a click on the white star below would be nice thanks.
    Now using the Lumia 1520

  • PLEASE report what you've already tried when posting problems/questions!

    A lot of threads have a common theme:
    (1) The first post describes a problem, or asks a question.
    (2) The second (or third, or fourth) post suggests doing or trying something.
    (3) The next response, from the original poster, says "Oh, I already tried that!"
    Please, when describing a problem or asking a question, be reasonably detailed about the scenario, what you did, what results you got, WHAT YOU'VE ALREADY TRIED, etc.
    Vague undetailed problems/questions, not describing the N steps you've already taken to try to resolve it, etc. just waste time and bandwidth all around!
    Doug

    Hi Doug;
    If we are going to start of list of things NOT to do when posting a question, the one I always think is the absolute silliest is when they say I am having trouble with an application and never ever tell up what application they are talking about as if we have a crystal ball which is going to tell us what mythical application it is. Well it turns out generally my crystal ball is foggy just then so I have to ask what are you talking about here.
    Allan

  • Simple Crop tool question... how do I save the crop section?

    Hi,
    I have a very simple crop tool question. I'm a photoshop girl usually... so Illustrator is new to me. When I select the crop section I want... how do I save it?... if I select another tool in the tool panel, the crop section disappears and I can't get it back when I re-select Crop tool. If I select Save as... it saves the whole document...and not just my crop section.
    Like I said, simple question...but I just don't know the secret to the Illustrator crop tool.
    Thanks!
    Yzza

    Either press the Tab key or F key.

  • A Simpler, More Direct Question About Merge Joins

    This thread is related to Merge Joins Should Be Faster and Merge Join but asks a simpler, more direct question:
    Why does merge sort join choose to sort data that is already sorted? Here are some Explain query plans to illustrate my point.
    SQL> EXPLAIN PLAN FOR
      2  SELECT * FROM spoTriples ORDER BY s;
    PLAN_TABLE_OUTPUT
    |   0 | SELECT STATEMENT |              |   998K|    35M|  5311   (1)| 00:01:04|
    |   1 |  INDEX FULL SCAN | PKSPOTRIPLES |   998K|    35M|  5311   (1)| 00:01:04|
    ---------------------------------------------------------------------------------Notice that the plan does not involve a SORT operation. This is because spoTriples is an Index-Organized Table on the primary key index of (s,p,o), which contains all of the columns in the table. This means the table is already sorted on s, which is the column in the ORDER BY clause. The optimizer is taking advantage of the fact that the table is already sorted, which it should.
    Now look at this plan:
    SQL> EXPLAIN PLAN FOR
      2  SELECT /*+ USE_MERGE(t1 t2) */ t1.s, t2.s
      3  FROM spoTriples t1, spoTriples t2
      4  WHERE t1.s = t2.s;
    Explained.
    PLAN_TABLE_OUTPUT
    |   0 | SELECT STATEMENT       |              |    11M|   297M|       | 13019 (6)| 00:02:37 |
    |   1 |  MERGE JOIN            |              |    11M|   297M|       | 13019 (6)| 00:02:37 |
    |   2 |   SORT JOIN            |              |   998K|    12M|    38M|  6389 (4)| 00:01:17 |
    |   3 |    INDEX FAST FULL SCAN| PKSPOTRIPLES |   998K|    12M|       |  1460 (3)| 00:00:18 |
    |*  4 |   SORT JOIN            |              |   998K|    12M|    38M|  6389 (4)| 00:01:17 |
    |   5 |    INDEX FAST FULL SCAN| PKSPOTRIPLES |   998K|    12M|       |  1460 (3)| 00:00:18 |
    Predicate Information (identified by operation id):
       4 - access("T1"."S"="T2"."S")
           filter("T1"."S"="T2"."S")I'm doing a self join on the column by which the table is sorted. I'm using a hint to force a merge join, but despite the data already being sorted, the optimizer insists on sorting each instance of spoTriples before doing the merge join. The sort should be unnecessary for the same reason that it is unnecessary in the case with the ORDER BY above.
    Is there anyway to make Oracle be aware of and take advantage of the fact that it doesn't have to sort this data before merge joining it?

    Licensing questions are best addressed by visiting the Oracle store, or contacting a salesrep in your area
    But I doubt you can redistribute the product if you aren't licensed yourself.
    Question 3 and 4 have obvious answers
    3: Even if you could this is illegal
    4: if tnsping is not included in the client, tnsping is not included in the client, and there will be no replacement.
    Tnsping only establishes whether a listener is running and shouldn't be called from an application
    Sybrand Bakker
    Senior Oracle DBA

  • MSI 925XE BIOS 1.3 to 1.4 Upgrade problem/question

    Hi,
    Today I upgraded my board from BIOS 1.3 to 1.4 (successfully, *phew*). The BIOS page on the MSI site states that it fixes some problems, but nothing related to temperature sensors is mentioned:
    http://www.msi.com.tw/program/support/bios/bos/spt_bos_detail.php?UID=635&kind=1
    Now the actual problem/question is that with BIOS v1.3 my full load temp was roughly 65 degrees celcius (3.4GHz LGA775 CPU). Now with v1.4 my full load temperature shows up as 47-48 degrees celcius.
    This of course doesnt seem like a bad thing at first, lower temp = good, but I cant help but wonder whether the temperature was being inaccurately shown in 1.3, or whether it is being shown wrongly now with 1.4. A drop in full load temp of about 18 degrees celcius sure raises some questions.
    If anyone knows anything about this, Id appreciate any feedback. Also if there is some kind of tech support email address that MSI has (I couldnt find one on the site), could you please pass it to me, thanks.
    I didnt post my entire system specs because really all the other components are irrelevant, I didnt change the setup in any way other than the BIOS. If I needed to post some addition info, tell me what it is, and I will.
    Thank you.

    Sorry that I didnt reply for a while. Busy weekend. Anyways...
    What kind of chassis cooling? When as I said the case is open right now cause Im still experimenting with everything, so really its like no chassis at all for now. What kind of fan do I use with the XP-120? Its a quiet fan, I cant seem to find the box. If Im not mistaken, its the green version of this:
    http://www.thermaltake.com/dcfans/led/thunderblade120.htm
    And finally... Yes of course I was able to fit the XP120 on the motherboard, how else would I be running the comp hehe? BTW, I wouldnt necessarily recommend it to others though, the installation was very problematic. But still, its possible.

  • Very simple XSLT string replacing question

    Hi,
    This is a really simple question for you guys, but it took me long, and i still couldn't solve it.
    I just want to remove all spaces from a node inside an XML file.
    XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <root insertedtime="2008-05-01T14:03:00.000+10:00" pkid="23421">
       <books>
          <book type='fiction'>
             <author>John Smith</author>
             <title>Book title</title>
             <year>2 0  0 8</year>
          </book>
       </books>
    </root>in the 'year' node, the value should not contain any spaces, that's the reason why i need to remove spaces using XSLT. Apart from removing space, i also need to make sure that the 'year' node has a non-empty value. Here's the XSLT:
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
        <xsl:strip-space elements="*"/>
        <xsl:template match="@*|node()">
            <xsl:copy>
                <xsl:apply-templates select="@*|node()"/>
            </xsl:copy>
        </xsl:template>
        <xsl:template match="//books/book[@type='fiction']">
            <xsl:copy>
                <xsl:apply-templates select="@*"/>
                <xsl:attribute name="id">101</xsl:attribute>
                <xsl:call-template name="emptyCheck">
                    <xsl:with-param name="val" select="year"/>
                    <xsl:with-param name="type" select="@type"/>
                    <xsl:with-param name="copy" select="'true'"/>
                </xsl:call-template>
                <xsl:value-of select="translate(year, ' ', '')"/>
            </xsl:copy>
        </xsl:template>
        <!-- emptyCheck checks if a string is an empty string -->
        <xsl:template name="emptyCheck">
            <xsl:param name="val"/>
            <xsl:param name="type"/>
            <xsl:param name="copy"/>
            <xsl:if test="boolean($copy)">
                <xsl:apply-templates select="node()"/>
            </xsl:if>
            <xsl:if test="string-length($val) = 0 ">
                <exception description="Type {$type} value cannot be empty"/>
            </xsl:if>
        </xsl:template>
    </xsl:stylesheet>The 'emptyCheck' function works fine, but the space replacing is not working, this is the result after the transform:
    <?xml version="1.0" encoding="utf-8"?>
    <root insertedtime="2008-05-01T14:03:00.000+10:00" pkid="23421">
       <books>
          <book type="fiction" id="101">
             <author>John Smith</author>
             <title>Book title</title>
             <year>2 0 0 8</year>2008</book>
       </books>
    </root>The spaced year value is still there, the no-space year is added outside the 'year' tags'
    anyone can help me, your help is extremely appreciated!
    Thanks!

    You should add a template for 'year' :<xsl:template match="year">
    <year><xsl:value-of select="translate(.,' ','')"/></year>
    </xsl:template>and remove the translate call in the 'book' template.
    It would be better to add a 'priority' attribute at each template so it would be explicit which template to use because match="@*|node()" could be interpreted by another transform engine as the unique template to be used !

  • My problem is too complex for a simple one-line question. Is there an upload facility where I can describe the problem in some detail?

    My Problem with Word and Excel for Ms Office 2011
    I work on a MacBook Pro (Mavericks, v.10.9.1) as an editor of a scholarly journal.
    I regularly receive submissions as Ms Word, Excel and PowerPoint files, mostly created  on Windows computers.
    For the past 10 years I have been using Ms Office software for Mac without any problems to open and process these documents.
    I have since 2012 been using Ms Office 2011 for Mac without without any problems.
    About 10 days ago, I started getting  error messages when trying to open Ms Word and Excel  files, but I have no problems with opening and editing PowerPoint files.
    Failed Clean Reinstallation Attempts
    I completely removed all traces of  Ms Office from every nook and cranny of my Mac, following the procedure  “How to completely remove Office for Mac 2011”  from the MS support website at  http://support.microsoft.com/kb/2398768, and then made a clean reinstallation of Ms Office 2011, followed by two recommended updates.  The problem is back.
    The Error Messages
    When I click on an existing .DOC or .DOCX Word file I get the following error message:
    (1)
    "The Open XML file Normal-dotm cannot be opened because there are problems with the contents or the file might contain characters (for example, \ /)."
    Details
    No error detail available.
    It then lists the name of the document that I was unable to open.
    (2)
    If I click on the image of a Blank page in the Word Document Gallery the following error message is displayed:
    "Word cannot open the existing global template
    (Normal.dotm)."
    (3)
    If I then click on OK, a blank document 1 opens up. When I type information and try to save it I again I get the error message:
    This is not a valid file name. Try one or two of the following:
    *Check the path to make sure it was typed correctly.
    *Select a file from the list of files and folders.
    Workaround Solution by Editing Ms Word Documents Via Pages
    I can open the Word documents that Word cannot in My Mac’s Pages word processing program, and after editing, export them again in Ms Word format, but cannot open the in Ms Word for Mac to see if everything is alright. This is no way to work, using Ms Word.
    Any suggestions how I can solve the problem, sort of buying Ms Office 2013 for Mac?
    (By the way, I am writing this message in Mac’s Notes application).
    <Edited by Host>

    Rembrandt,
    Did the two updates to Office 2011 get you to 14.3.9? That's the latest Mac version of Office.
    I use Office 2013 and Mac Office 2011 on the same machine and have no problems opening any files shared between the two. You followed the instructions for uninstalling and updated your new installation correctly, I have to assume. It sounds as if there is a problem with your cuurent configuration but if it's not an update problem, or an installation problem, I can only direct you to the MS Office for Mac user community -> http://answers.microsoft.com/en-us/mac (sometimes you get lucky and get an actual MS employee answering your question).
    Good luck,
    Clinton

Maybe you are looking for