Given some xml and an xsd, how to remove extra stuff in the xml.

Hi. I have a question. I am trying to use the various XML libraries to parse/validate an xml file given an XSD schema. I want to remove the extra stuff in the xml to output a new xml. The problem is as I validate or parse the SAXParseException it produce only gives me the localName. Is there a way I can keep track of something detail like the XPath as I validate or parse??? Thank for the help in advanced

forgot to mention. Basically, I want to try to validate and find all the errors in the an old xml, then be able to fix the errors to end up having an valid xml file.

Similar Messages

  • How to remove extra spaces in a xml formatted string

    Hi,
    I am trying to remove extra spaces between the xml tags. For
    example, if a string is something like
    ' <header 1> <header 2> test </header 2> </header1>'
    I want to get rid of the spaces only between the closing tag of header 1 and opening tag of header 2 and closing tag of header 2 and opening tag of header 1, in short ,I want to remove the extra spaces between the tags if there are no other characters between them. I do not want the remove the spaces between closing tag header 2 and opening tag of header ,as there is occurence of other characters.
    I am aware that this can be done by looping through the string and using instr to identify the characters '<' and '>', but I would like to use it as a last resort only.
    Can anyone suggest me a better way of doing it in a single go by manipulating the data?
    Any help is really appreciated.
    Regards,
    Anil.

    You can use the replace function. If you only expect one extra space, then:
    scott@ORA92> select replace ('<header 1> <header 2> test </header 2> </header1>',
    2      '><', '><')
    3 from dual
    4 /
    REPLACE('<HEADER1><HEADER2>TEST</HEADER2></HEADER
    <header 1> <header 2> test </header 2> </header1>
    If you expect more extra spaces, then you will need to wrap another replace function around it for each space, for example the following will eliminate up to three spaces:
    scott@ORA92> select replace (replace (replace ('<header 1> <header 2> test </header 2> </header1>',
    2      '>     <', '><'), '>     <', '><'), '> <', '><')
    3 from dual
    4 /
    REPLACE(REPLACE(REPLACE('<HEADER1><HEADER2>TEST
    <header 1><header 2> test </header 2></header1>

  • When saving files under options the file name is duplicated how to remove extra folder with the same name

    Under Firefox Options I clicked Saving Files under Downloads but the file name appears twice and an extra folder with the same name is created within the folder i.e.:
    G:\Akbar's Songs\HAMARA FORUMS DOWNLOADS\HAMARA FORUMS DOWNLOADS
    As you can see the folder is repeated, how can I correct this?
    Also the music files I download from a site downloads as WinRar file and I need to open it. Is there an option where the files open automatically in the folder I have selected?
    Many thanks for your help.

    The "beta" version is for testing and may be more prone to problems, so I suggest trying the regular version (9.20) even though it hasn't been updated since 2010.

  • How to remove extra char in the uploaded file...?

    Dear All,
    There is file upload page in our portal.When user uploads the file (CSV) i can see there is extra char (^M) in the unix env.How can I remove that extra char before inserting into the database.For inserting into database I am using below code:
    BlobDomain blobdomain = (BlobDomain)pageContext.getParameterObject(upldFileNameHD);
    header.setFileData(blobdomain);
    Did anyone can help me on this...
    Thanks

    Raffy is right in giving the explanation on why this happens.
    Now way to
    1. Remove it:
    A. open file in vi
    B. use this command, the way it works is, search(%s) for the ^M char and replace it with space (//) , and do this globally (g)
    :%s/^M//g
    C. To type ^M char press Ctrl Key and press either M or J, it should print that char.
    D. Save the file (:wq)
    2. Avoid it:
    when doing FTP, use binary mode, just type bin before you do a put.
    Thanks,
    Tapash

  • For some weird reason now, every time I try to open a LinkedIn page it seems to get re-routed to a UPS page. Did I inadvertently trigger a script of some kind and, if so, how do I un-do it?

    For some weird reason now, every time I try to open a LinkedIn page in Safari it seems to get re-routed to a UPS page. Did I inadvertently trigger a script of some kind and, if so, how do I un-do it? This happens, no matter what the LinkedIn page is.

    Hi ...
    From your Safari menu bar click Safari > Empty Cacche. Quit then relaunch Safari to test.
    If that didn't help, go to ~/Library/Caches/com.apple.Safar/Cache.db
    Move the Cache.db file from the com.apple.Safari folder to the Trash.
    Quit then relaunch Safari to test.
    Doubtful just visiting a page in within the LinkedIn site triggers a script of any kind.

  • TS4062 I replaced my iPad with a new one. I backed up to iCloud but did not do a physical iTune Sync. Now I am having trouble recovering some Notes and Photos. I have been reinstalling Apps from the App Store. How do I recover my Notes?

    I replaced my iPad with a new one. I backed up to iCloud but did not do a physical iTune Sync. Now I am having trouble recovering some Notes and Photos. I have been reinstalling Apps from the App Store. How do I recover my Notes?

    Thank you again for all of your help!! I really appreciate it!
    I think I am following -- I was able to upload to my iPhoto and all photos and videos are there that is a plus! I tried to create an Event in my iPhoto and put all of my photos in that event but for some reason, now my iTunes it not recognizing that Event in my iPhoto. It is not allowing me to import just that event at the moment but I may be doing something wrong. At least all of my pics and vids are in iPhoto so that is a plus and I know they are at least saved somewhere. Just for some reason, my iTunes it not locating the event that I created with only those photos.
    Thank you for letting me know about my contacts! How do I know if I have the contacts app?
    Also, I had no clue that my iCloud could be backed up via cellular data! However, is this a new feature with the most updated iOS?? Unforutnatly I am like 2 iOS updates behind because I don't have enough storage on my phone. I still get the notification that my phone needs to be plugged in and connected to wifi in order to back up to the cloud :-(
    How can I sync using USB? Right now when i click on the info tab for my iPhone in my iTunes this is the answer that I get -- I am a little unclear as to what it means.
    Sync Contacts:
    Your contacts are being synced with you iPhone over the air from iCloud. Over-the-air sync settings can be changed on you iPhone
    Sync Calendars:
    Your calendars are being synced with you iPhone over the air from iCloud. Over-the-air sync settings can be changed on you iPhone

  • HT201272 My hard drive had some issues and all of my music videos are gone.  The itunes store is charging to download them.  How do I get them re-downloaded?

    My hard drive had some issues and all of my music videos are gone.  The itunes store is charging to download them.  How do I get them re-downloaded?

    From your OLD computer...
    Copy your ENTIRE iTunes FOLDER to an External Drive... and then from the External Drive to your New Computer..
    Full Details Here  >  http://support.apple.com/kb/HT1751
    Also see this migrate iTunes library post by turingtest2

  • I have an Iphone 3gs and today I had taken some pictures and my battery was 8% i was looking at the few I had took. Then my phone died but when I plugged it into the charger and got it on I went to upload the pictures but they were deleted!

    I have an Iphone 3gs and today I had taken some pictures and my battery was 8% i was looking at the few I had took. Then my phone died but when I plugged it into the charger and got it on I went to upload the pictures but they were deleted! All my other pictures that i have taken are still there, it just deleted the ones I took a couple of hours before it died!
    I was just wondering if there is anyway of getting them back at all? and how common is this?

    Sounds like your iPhone was hacked to unlock and now updating locks back to the original carrier.
    Where did you get the iPhone?

  • Is it possible and if so how can I right click on the on screen touch keyboard

    Is it possible and if so how can I right click on the on screen touch keyboard.

    No it not design for that. I just tried it. Left click only. I recomend that you do not mess with setting with in the software it self you may end up causing the keyboard to malfunction and crashing your computer.I all so just double check our computers help and support On screen keyboard settings. There was no option given for switching the mouse clicker.  Just sticky keys and short cuts are listed. Sorry I hope this answered your question. I would all so not recomend trying to install other software you may find on switching key board setting unless it came from HP company design especially use on these types of computers. You may end up destroying your hard drive and computer all together.

  • On my itouch 4th gen, I use imessage and message many people, but sometimes when i send a message the send bar on top will go almost all the way and stop. This will happen for some time and then work later. is there anything to avoid the freezinginsending

    On my itouch 4th gen, I use imessage and message many people, but sometimes when i send a message the send bar on top will go almost all the way and stop. This will happen for some time and then work later. is there anything to avoid the freezing problem while it sends

    See:
    iOS: Troubleshooting Messages
    However, I suspect it is just a tempery network problem beyond your control

  • I recently bought a MacBook Air.  I migrated the info from my old MacBook to the new Air.  None of my contacts migrated.  I still have them on my old Macbook, Ipad and iPhone.  How do I get them to the new Air?

    I recently bought a MacBook Air.  I migrated the info from my old MacBook to the new Air.  None of my contacts migrated.  I still have them on my old Macbook, Ipad and iPhone.  How do I get them to the new Air?

    You can copy the iWeb application from the desktop machine to your new MBA.  But if it's iWeb 2 it won't work with Mavericks or Mt. Lion. Also  copy the Domain.sites file from the desktop to your MBA as that's the file with your webstite files in it.
    Happy New Year

  • HT5622 I own three Apple devices, but my iPad remained associated with my old email address and password. How can I register it with the same new email and password?

    I own three Apple devices, but my iPad remained associated with my old email address and password. How can I register it with the same new email and password?

    If you updated your existing account then try logging out of it on the iPad by tapping on the id in Settings > Store and then log back in and see if that 'refreshes' the account on the iPad. If you created a new account then any content that you purchased/downloaded via the old account will remain tied to that old account, and only that old account can download updates to its apps.

  • Somehow i have synced my photos from my area on to my ipod touch, and dont know how to remove the photos. Any help?

    Somehow i have synced my photos from my area on to my ipod touch, and dont know how to remove the photos. Any help?

    You need to unsync them.  If you uses the folder syncing method either remove them from your syncing folder or change which is you syncing folder.  Also see:
    iPhone, iPad and iPod touch: Syncing photos via iTunes

  • How to remove available downloads from the list

    how to remove available downloads from the list without it resuming when i open itunes or check for available downloads?

    There is not a way to remove them from the list.  Just let them download, and then delete them from your library when they are done.

  • How to remove SD Card from the Card Reader slot - Satellite A100?

    Hi,
    Is there anyone to help me? I inserted a 64 MB SD card in the card reader slot of my Toshiba A100 model. It's the first time i have inserted the card. The card is inside the slot. I can not take it out! I don't have any idea how to remove the card from the card reader slot. I can see the contents of my SD card, can open the files too. But how to remove it out from the slot. Please help me giving your idea to remove the card out from the slot.
    Arjun

    Hi
    In my knowledge the SD card slot doesnt has a any additional helps like the PCMCIA slot to remove the card.
    You have to remove it simply. Try to grab the card and move it out. You can try to use the pair of tweezers. Maybe it helps

Maybe you are looking for

  • Core Audio disk too slow error?

    I've read most of the reports from previous versions -relating to ibook disk speed and how an external fire wire drive is the way to go, so I got one, how do i set up Garage band to record to it, i can see it on the dt, but I'm still getting the same

  • Different servers for dialup-access and exec-access

    Hi all, I am trying to configure a 3640 for authorization. The 'tricky' part is that I have to make a difference between dialup-access on one hand and exec-access on the other hand. I am using TACACS+ for authentication and authorization. The origina

  • Is it possible to set a field in another item/list in a workflow?

    I've created a list workflow to add a task after a new client is added to my client list. I am trying to create a pre-determined due date, so that the workflow works out the due date so that it's 2 days from today. So I decided to use the 'Add time t

  • Force FM execution on batch job work process

    Hi! Is it possible to asynchronously start FM execution on batch job work process? Additions: CALL FUNCTION func STARTING NEW TASK taskname. CALL FUNCTION func IN BACKGROUND TASK. starts FM execution just on another dialog process. Context of require

  • ZipOutputStream problem

    hi, im creating zip file which contains two files. The problem is that it will create path folder in the zip where my file is located if im zipping more than one file. I will give example to make it clear. When my file is located in C:\User\Admin\Des