How to Convert a Element to a different Element?

I get a xml Element from others, for some reason
I must convert it to my format,
like add some attribute, change some attributes' name:
example, original include:
  <original id="000" name="father">
    <original id="001" name="first"/>
    <original id="002" name="second">
      <original id="003" name="third"/>
    </original>
  </original>after Change, it should be:
  <task id="000" abbr="father"> //change "original" to "task", change "name" to "abbr"
    <task id="001" abbr="first" day="" ok="no"/> // add a "ok" attribute
    <task id="002"> // remove a "name" attribute.
      <task id="003" abbr="third">
      <task id="004" abbr="fourth"> // insert a "task"
    </task>
  </task>  Would you give some example code.Thanks!
regards
iooi

here is a style shet for your purpose
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="original[@name='father']">
<task id="{@id}" adrr="{@name}">
<xsl:apply-templates select="original[@name='first']"/>
<xsl:apply-templates select="original[@name='second']"/>
</task>
</xsl:template>
<xsl:template match="original[@name='first']">
<task id="{@id}" adrr="{@name}" day="" ok="no"/>
</xsl:template>
<xsl:template match="original[@name='second']">
<task id="{@id}">
<xsl:apply-templates select="original[@name='third']"/>
</task>
</xsl:template>
<xsl:template match="original[@name='third']">
<task id="{@id}" adrr="{@name}">
<task id="{concat('00',number(@id)+1)}" adrr="fourth"/>
</task>
</xsl:template>
</xsl:stylesheet>

Similar Messages

  • How to convert lossless audio files in itunes to AAC or mp3 in itunes 10

    i noticed some files won't upload to my kids older ipod shuffle (2nd). they are the larger less or uncompressed file types.
    i've got itunes 10 and there is no way to convert the files to AAC or mp3 that i can see. these are files in my library. i would like to create a playlist for his ipod in AAC: from library to playlist

    This explains how to covert song files.  It works in iTunes 10.  You set the import preference to the file type you want and the Advanced menu > Create  XXX Version will change to match.
    iTunes: How to convert a song to a different file format, http://support.apple.com/kb/HT1550

  • How to convert Mp4's to Mp3's on v.9?

    Hi
    How do I convert mp4s to mp3s?
    Thanks, Pat

    Go to iTunes>Preferences>General and choose the Import Settings button. Pick the format you want to convert your files to (MP3 for example). in your iTunes library or playlist highlight the song or songs you want to convert and go to the Advanced menu on the top bar of iTunes and choose, again for example "Create MP3 version": How to convert a song to a different file format format

  • Ho do I convert my Elements 5 Catalog to Elements 13 which I just purchased.  I followed one of the tutorials and converted my Elements 5 Catalog to a "pse.13db" file.  How do I get Elements 13 to recognize that converted file?  When I open Elements 13 Ca

    Ho do I convert my Elements 5 Catalog to Elements 13 which I just purchased.  I followed one of the tutorials and converted my Elements 5 Catalog to a "pse.13db" file.  How do I get Elements 13 to recognize that converted file?  When I open Elements 13 Catalog Manager and browse to the correct location, it doesn't show the file.  Help!  Thanks

    Bumps a écrit:
    Yes - I can run both versions on my PC.  But I really would like to have all of my pictures in the same catalog.
    You can't merge catalogs (even PSE13 ones) in any PSE version (only LR can do that). So, converting catalogs is not the solution to your problem.
    Since you have PSE5 working on your computer and your images also, the solution is to 'write metadata to files in PSE5) and to re-import the images in the PSE13 catalog. That won't duplicate your image files and you'll lose albums/collections, stacks and version sets, but you'll recover tags, captions and ratings.
    To be able to re-import the files indexed in PSE5, you may have to move them to a new master folder.
    I am not sure what your problem with the conversion may be. It's quite possible that the resulting catalog.pse13db is ok and that the issue lies in the ability to open it in the PSE13 organizer.
    As stated by dj_page, double clicking on that file should open the organizer with the new catalog. You could test that by creating a dummy catalog in PSE13 and importing a small batch of photos. Locate the path of the catalog with the menu Help/system info. Copy the catalog.pse13db in another folder and the 'double click' way to open the organizer with that moved catalog database.
    For other users that may be interested in using PSE5 (issued in 2006) on newer OS, here is a useful link:
    Adobe - Photoshop Elements : For Windows : Adobe Photoshop Elements 5.0.2 update

  • How do I convert trial Elements 10 to a purchased DVD?

    How do I convert trial Elements 10 to a purchased DVD?  i can't find anyplace to input the serial numbers.  It used to pop up all the time, but now when I have the serial numbers, I can't find it anywhere.

    I found where to enter the serial numbers:  I had to go to The Editor;  the input screen did not pop up on the Welcome Page or the Organizer.

  • How do I convert Mac files to a different extension?

    I know how to convert a window's file extension. For example, I can change a .jpg to an .exe, if i needed too.
    I want to know how to change a powerpoint 2008 file, which has a .pptx extension to a .ppt extension. How can I do that on a MAC?

    First of all, it's as easy as clicking into the Title, and selecting all, or any part, and changing it. BUT, if you think you fool PowerPoint by changing the newer version to an older extension, you won't. You would be better served, maybe, to "save as", and select the older PPT version. So far, in my experience, the latest Office is terrible at these conversions, and reading older versions. Once again, leave it to MS to try to put lipstick on a pig.

  • How to Convert your DVD to any format at your will...

    Long time ago, I hope I could take part in some classes to strengthen my health and my good figure. But due to my special job as a salesman, I don't have enough time to do that. So I bought one DVD of yoga, I hope I could do that through watching DVD. So I put DVD into my computer to be ready to practice, unfortunately all my players can't read them. I feel so upset. I tried to look for nearly all the ways I knew to deal with it, but nothing had happened. One of my friends introduce AiseesoftDVD Riper to me. I tried it, yes, it works. Now I could play yoga anytime and anywhere when I am free. It is benifit both for my health and my figure, I love this feelings. Now I hope I could help you through my experiences.
    This guide aims to show you how to convert DVD to different video format both for windows/mac users.
    Part 1: How to Convert DVD on Windows with AiseesoftBest DVD Ripper
    Step 1: Load DVD
    Put your DVD to your DVD Drive and click "Load DVD" button to add your DVD
    Step 2: Choose Profile
    Choose your output video profile from a drop-down list.
    Step 3: Start Conversion win
    Part 2: How to Convert DVD on Mac with AiseesoftDVD Ripper for Mac
    Step 1: Load DVD
    Click the "Load DVD" button, find the DVD folder of the movie you want to add from your DVD-ROM, and Click "Open".
    Step 2: Choose output profile and settings
    Selecting output format is really easy, you can chose your output format according to your devices players and the default setting works great.
    For a veteran of digital player, you could customize your own settings by clicking "Settings" button to chose your own video resolution, frame rate, bit rate, encoder, etc.
    Step 3: Start Conversion
    What amazing softwares! I hope it is helped for all of you.

    Hi,
    source structure---------------------->target structure
    x--------------------------------------->y
        sample------------------------------->root1
        a(1)------------------------------------->attribute1
        b(2)------------------------------------->attribute2
        c(3)------------------------------------->attribute3
            sample1(123)------------------------->element1
             a(1)-------------------------------->attribute1.1
             b(2)-------------------------------->attribute1.2
             c(3)-------------------------------->attribute1.3
    Everything specified under target are elements.

  • Video Format Total Solution: How to Convert and Edit Video on Windows/Mac

    More and More video formats are coming out with different video encoders and it makes our spare time more and more colorful. However, it is not to say that there is no problems. Actually, different video formats make it difficult to share video with others, even your own camcorder and iPod. Is there an easy way to convert videos effectively. Yes, there is.
    In this article, I will show you guys how to convert videos on windows and mac.
    Part 1. How to Convert and Edit Videos on Windows
    For Windows users, you need a Video Converter(http://www.aiseesoft.com/total-video-converter.html) to do that for you.
    Here I use Aiseesoft Total Video Converter(http://www.aiseesoft.com/total-video-converter.html)
    Step 1: Download and install Aiseesoft Total Video Converter
    After you download it to your computer, double click it and it is really easy to install.
    You just need to click “next” and it will complete it in seconds. It will automatically run after installation.
    http://www.aiseesoft.com/images/guide/total-video-converter/screen.jpg
    Step 2: Load Video
    Click “Add File” to find the video that you want to convert and click “open”. It will be loaded automatically.
    Step 3: Select the target to decode
    In the “Profile” drop download list you can find your target according the usage of your output video, such as if you want to put the video on your iPod touch, you can select the “iPod” in the first list and “iPod touch 2 MPEG-4 640*480(*.mp4)” in the second list.
    Step 4: Set Advanced Parameters
    After you select the right output profile, you can click “setting” button to set your advanced parameters. You can adjust video and audio settings separately. In video section, you can change “video encoder”, “resolution”, “frame rate”, “video bitrate”In audio section, you can change “audio encoder”, “sample rate”, “channel”, “audio bitrate”If you want to save this profile and settings and use it next time you can click “save as” button to give a name to it. And the next time you want to use it you can find it in the profile list named “user defined”.
    Step 5: Choose a Destination
    To browse and find a output folder for your output files or just the default one.
    Finally, Click “Convert” button to begin your conversion, here in the converting
    interface you can choose “shut down the computer when conversion complete” or “open output folder when conversion complete” or you just do not choose neither one.
    Tips: How to Edit the Output Video
    This video converter is also a video editor, you can use it to edit your output video as follows:
    http://www.aiseesoft.com/images/guide/total-video-converter/effect.jpg
    1. Effect:
    You are allowed to adjust the “Brightness”, “Contrast”, “Saturation” and you can choose the “deinterlacing” to make the video more enjoyable.
    2. Trim:
    In “Trim” section you can pick up any part of the video to convert.
    There are two ways to select the part of the video you want. One is set the start and end time in the box. The other one is to drag the start and end button in the processing bar.
    3. Crop:
    This function allows you to choose a certain play area to convert. That means you can choose a part of the screen you like to convert. For example, you just like the tv in the middle of the screen, then you can drag the frame around the preview window to select the tv and the output preview will show you the output video.In this section you can also choose the “zoom mode”, such as “keep original”, “full screen”, “16:9”, “4:3”.
    4. Watermark
    In the section, you can add a watermark on the output video to show people something, such as your name, website, studio name or other things. The watermark could be words and picture. You can adjust the transparent of the watermark easily to make it more beautiful.
    Part 2. How to Convert Video on Mac
    This time you need a Video Converter for Mac(http://www.aiseesoft.com/video-converter-for-mac.html)
    Step 1: Add File
    Click “Add File” button to load the video you want to converter
    http://www.aiseesoft.com/images/guide/mac-video-converter/steps.jpg
    Step 2: Choose profile and adjust settings
    You can find your output video format from a drop-list called “Profile”You can also adjust the specific settings of the output video, such as “Resolution”, “Bitrate”, “Encoder” and so on.

    @ Tamwini
    Your only goal is to sell software.
    ‡Thank you for hitting the Blue/Green Star button‡
    N8-00 RM 596 V:111.030.0609; E71-1(05) RM 346 V: 500.21.009

  • How to display the header data on different position in alv report

    hi all,
    how to display the header data on different position in alv report.
    for example ,
    customer                                                   name
      xxxx                                                         xxxx
                     vendor        name     street 
                      xxxx         xxxx      xxxxx
    pls   help me .

    hi
    as per my understanding you need to trnasfer header internal table data  to pdf..
    please check the following links for internal table to pdf..
    Convertion of Internal table data to PDF
    This link is related to ur issue
    Re: how to insert the calling of the FM: OTF to PDF
    Thanks

  • HOW TO CONVERT PDF FILE IN TO XML FILE?

    HOW TO CONVERT PDF FILE IN TO XML FILE

    No Office programs can open a pdf and edit the contents so you will have to get a different app to convert teh pdf into xls format. There are plenty to be found on the web.
    Rod Gill
    The one and only Project VBA Book
    Rod Gill Project Management

  • How do I reinstall Elements 8 after Hard Drive Crash

    C Drive irreparably crashed.  The PSE8 catalog folder was in C:\Documents and Settings\All users\Adobe, etc. and was backed up on a different drive (Yay Me!).  The Pictures were in E:\ Elements Pictures\ (117 GB). When Windows was reinstalled, the Drive Letters were changed by the reinstall program, such that the Windows boot drive is now the E drive and the Pictures are on the D: drive, but still in their original folder.  (Ultimately, the plan to get a new Drive, rename it C, and reinstall Windows on it.)
    It appears that I cannot use "Backup and Restore" as is the common response to "How do I move Elements and Pictures to a new Computer?"
    I can reinstall PSE8 on my E (boot) drive, then replace the new catalog folder with the old one which has my data.  How do I then get that catalog to look to the Pictures on the drive which has a new letter (D)?  I cannot reinstate the old drive letter, as that letter is now in use as the boot drive letter.
    Am I better off just waiting for the new C drive, reinstalling Windows there, replacing the catalog folder, and relettering the Pictures drive to its old Letter?  It may be awhile before I get the new C drive as I am waiting for Seagate to replace under warranty the dead drive, and would like to if at all possible continue to use PSE8 in the interim.
    Many Thanks in advance for your advice.

    Take a look at Option 3 here:
    http://www.johnrellis.com/psedbtool/photoshop-elements-faq.htm#_Quickly_reconnecting_large

  • How to convert 64-bit to 32-bit oracle 8.1.7

    We are planning to upgrade our O/S version from AIX 4.3.3 to 5.2
    The limitation is that AIX 5.2 and 8.1.7.4 64-bit are not certified. We are also running Oracle Financials 11.0.3 so we cannot upgrade to 9.2.X versions.
    Can anybody tell me how to convert Oracle 8.1.7 64-bit to 32-bit? ( before upgrading to AIX 5.2)
    Is there a performance degradation between 64-bit and 32-bit RDBMS?

    Javed, I suggest you open an iTAR with Oracle support. For one thing I believe you will need a different binary. You may already have the install CD since I believe we received both and choose 64 bit.
    HTH -- Mark D Powell --

  • How to convert concurrent program out files .out file to .txt files in

    Hi
    Trying to know if there is a way to convert the concurrent programs' output files witn '.out' extension to files with extension '.txt'
    thanks
    kp

    Why you want to change the file extension to txt instead of out?
    I believe you cannot do and you are not supposed to change it. Controlling the report output to different types can be done as explained in these docs.
    How to Setup The Report Output to Different Viewer Types in Oracle Applications 11i [ID 184375.1]
    How to Control the Name and the Application that Opens the Concurrent Request Output File on the Client? [ID 316752.1]
    Thanks,
    Hussein

  • Essbase 9.3 Calc scripts. Pb with dates. How to convert (string = number) ?

    Hello,
    I've a problem with Essbase(Planning?) Scripts on version 9.3. It looks simple but I do not find any (clean) solution :
    On my Essbase database, I have a member called "Reference_Date" on my axis Indicators. It is a date data type, that is to say, it displays a number corresponding to a YYYYMMDD format. For example : 20091029 for October 29th 2009.
    In calc scripts I often need to compare the month included in that "Reference_Date" with the current Member of my Time Axis (I have 12 Months members based on the format M02 for February for example). The final aim is to calculate a number of complete years since that "Reference_Date".
    But theses two elements are not of the same "type" (one is a number value and the other is a "member" in Time Axis). So I'm forced to convert one of this two elements in order to compare it.
    For example I can extract the month value of the "Reference_Date"' and put an "M" before it to have a Time member equivalent or I can convert the member Name M10 to a number (10))
    in both cases I have the same type problem : I don't know how to convert a string into a number nor how to convert a number into a string.
    (For example @CONCATENATE doesn't work with numbers). and that my only remaining problem.
    I didn't find any Essbase Function which do this (conversion number <=>string).
    Is anyone have an Idea ?
    Thanks for your help
    Best regards

    I don't know any way for you to compare your data against your metadata. Not directly. To me it makes little enough sense to try that I'm not surprised the developers didn't provide for it.
    I've converted member names to strings, manipulated the strings (calc script functions are not good at this), and turned them back into member names, but that's really the only use I've had for string manipulation. I don't think an equivalency operator even exists for string data. And I see no way to begin thinking of a member name, once converted to a string, as a number.
    It makes even less sense to me to try thinking of a data value as a string. Even text values in Sys 11 are stored as numbers. Not encoded characters, but just a number to look up somewhere.
    I think you can do what you want though, with something like this...
    IF (@ISMBR("FY08"))
    vYr = 2008;
    ELSEIF (@ISMBR("FY09"))
    vYr = 2009;
    ENDIF;
    IF (@ISMBR("M01"))
    vMth = 1;
    ELSEIF (@ISMBR("M02"))
    vMth = = 2;
    ENDIF;
    "Years_Since_Reference" = ((vYr * 100) + Mth) - ("Reference_Date" / 12);
    Obviously, the math will need some work, coz that doesn't actually work, but the logic above essentially turns your metadata into numbers, which is what you are after.
    Good luck,
    -- Joe

  • How to convert an int variable into String type

    hi everybody
    i want to know how to convert an interger variable into string variable
    i have to implement a code which goes like this
    Chioce ch;
    for(int i=0;i<32;i++)
    // here i need a code to convert the int variable i into a string variable
    ch.add(String variable);
    how do i convert that int variable i into a String type variable??
    can anyone help me?

    Different methods:
    int a;
    string s=a+"";or
    String.valueOf(int) is the better option because Int.toString() generated an intermediate object to get the endresult
    Ema

Maybe you are looking for

  • [solved]Menu Text in Libreoffice gone (with gnome 3.4?)

    I see a really strange behavior with libreoffice from the testing repos. I can't see text in my menus anymore. It's like all text has a white overlay. If i turn on icons, it gets a bit better and I can see some letters. It's a bit hard to describe, s

  • Trouble with Updating Apps on USED Mac Pro

    I purchased a used Macbook Pro in Summer 2013, and I thought that I had updated the system to be under my Apple ID and user info so that I can update applications through my account. However this keeps popping up, and I need to know how to disable th

  • Pictures on both internal and external HDs

    Hi -My iphoto libray pulls pictures from both my internal and external hard drives.  When the external is turned off or disconnected, I get a lot of outline/exclamation point errors.  I'd like to pull all the external photos onto the internal hard dr

  • DHMI connection​s

    Hi there, I connected my Z400 displayport to my TV via bp927aa adapter and it worked well except there were background noise when I changed TV input. However, I lost the video when I turned on TV the other day morning and my computer could not detect

  • Calling Msg-Box on condition with jQuery/Javascript

    Hello experts! I am stuck with my development as I don't know how to write the jQuery code. I want to call a message box (in fact an invisble DIV) when the value of my page item "P2008_MX_MODE" equals one. I have the following code for the message bo