Xml parsing, one works, one does not?

I am using the xerces parser to validate a xml against a schema. it works fine if i just specified the location of the xml file. however, if i converted the xml file into byte[], it does not work.
something i did not do right?
thanks.
//works
myParser.parse("C://test.xml");
//does not work, xml_data is the byte[] of test.xml
ByteArrayInputStream bais = new ByteArrayInputStream (xml_data);
myParser.parse(new InputSource(bais));
errors:
[warning] org.xml.sax.SAXParseException: schema_reference.4: Failed to read schema document 'stuff.xsd', because 1) could not find the document; 2) the document could not be read; 3) the root element of the document is not <xsd:schema>.
[error] org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'ElectronicPayment'.
cvc-elt.1: Cannot find the declaration of element 'Person'.

You have:
ByteArrayInputStream bais = new ByteArrayInputStream (xml_data);
myParser.parse(new InputSource(bais));
ERROR is: xml_data is a string, not bytes
so: try
ByteArrayInputStream bais = new ByteArrayInputStream (xml_data.getBytes());
myParser.parse(new InputSource(bais));

Similar Messages

  • CL_WD_RUNTIME_SERVICES= ATTACH_FILE_TO_RESPONSE( ) works in one system but does not in other

    Hi folks,
    We are facing an issue here with a custom web dynpro application that export an excel. The following piece of code has been written in this application to export an excel:
    cl_wd_runtime_services=>attach_file_to_response(
           EXPORTING
             i_filename      = c_filename
             i_content       = xtext
             i_mime_type     = c_mimetype
             i_in_new_window = abap_false
             i_inplace       = abap_false ).
    Now, the issue is this - it works fine in one system but does not in other system. HttpWatch shows ERROR_HTTP_INVALID_SERVER_RESPONSE in the system where it does not work. Any ideas?
    Regards,
    Shiromani

    Hi Shiromani,
    You mean "Other System" is other PC. If so, it seems that there is an issue with browser
    Please check the below SAP note
    1679126 - Server sends timeouts that cannot be reproduced
    Also, compare the browsers versions in both systems.
    Regards,
    Rama

  • All-in-one 6830 printer Does not enter sleep mode when connected to a phone line

    HP staff  help. HP all-in-one printer 6830 does not enter sleep mode when conntected to a phone line via 1-Line jack.  The Firmware is PNP1CN1521AR. On August 1, 2015,  I purchased an HP all-in-one 6830  printer and upgraded to firmware PNP1CN1521AR.When a phone line is connected to 1-Line jack of 6830, the printer will no longer enter  sleep mode and the display remains on indefinitly.Removing the phone connection either from the wall outlet or from the printer causes the sleep mode to work correctly again where the control panel display turns off after 5 minutes (or optionally  after 10 or 15 minutes).This problem was previously reported by a user and has not been resolved, see:http://h30434.www3.hp.com/t5/Other-Printing-Questions/Sleep-mode-of-Officejet-Pro-6830/td-p/4772182 The user did not receive a resolution to this problem according to the thread.
    There seems to be a  6830 printer firmware or hardware problem causing this. HP  should be able to confirm this problem on 6830 easily.
    Please advise ASAP.
    Thanks 

    It's a regular analog phone line. I've tested it with other phone lines. No difference. I have another all-in-one printer which works fine (goes to sleep mode) when plugged into the same phone line.
    The 6830 works ok in other aspects. The only problem is the sleep mode. Any 6830 with the firmware I mentioned should replicate the same result, regardless of anything else. The previous firmware to PNP1CN1521AR also created this problem according to the original report of this problem by another user.
    I'm sure there's a bug in the firmware. A subroutine in the firmware monitoring the incoming fax ringing, mistakenly, sees the voltage across the phone jack pins as an event and wakes up the printer instantly even though there's no ringing. As the previous user also suspected, there seems to be an error in the phone line voltage threshold used by the firmware. The present firmware always sees a ringing at the phone line which causes it to never stay in sleep mode.

  • When i try to search for contact or create a new one the keybord does not come up

    when i try to search for contact or create a new one the keybord does not come up

    Try going to settings to General to reset to 'reset all settings'
    This should do the trick!
    Good luck

  • I have Adobe photoshop cs5. need to update camera raw, cause my camera raw is  2010and does not read my camera,  I went out and downloaded the new one and it does not link to adobe photoshop cs5

    I have moved my Photoshop CS5 to my traveling computer,a Surface Pro 3.  I have photoshop loaded but in trying to look at raw images it says my camera raw does not support the sony alpha 65 which is what I have.  I went out and tried to download the newest raw version and even went out and did a zipfile download and it will not update my current version.  What should I do

    I have 6.0.  Tried to download newest verion and it will not download.  Went out and then downloaded a zipfile and it still will not download, thus cannot look at my raw pictures.
    Thanks, John
    m: gener7 
    Sent: Thursday, December 11, 2014 6:01 PM
    To: JOHN STAHLY
    Subject:  I have Adobe photoshop cs5. need to update camera raw, cause my camera raw is  2010and does not read my camera,  I went out and downloaded the new one and it does not link to adobe photoshop cs5
    I have Adobe photoshop cs5. need to update camera raw, cause my camera raw is  2010and does not read my camera,  I went out and downloaded the new one and it does not link to adobe photoshop cs5
    created by gener7 <https://forums.adobe.com/people/gener7>  in Photoshop General Discussion - View the full discussion <https://forums.adobe.com/message/7007148#7007148>

  • How to open multiple artboard illustrator file in illustrator. Coz, whenever we open a multiple artboard file, illustrator provide an option to chose one artboard but does not allow opening of all artboards. Somebody may explain it

    How to open multiple artboard illustrator file in illustrator. Coz, whenever we open a multiple artboard file, illustrator provide an option to chose one artboard but does not allow opening of all artboards. Somebody may explain it

    Doug's got it right. It sounds like you are trying to open a later version file in an earlier version. This will always be handled as opening the PDF portion of the file. Try Googling AI_openMultiPagePDF for a script to open these or Resave from the newer version to the older.

  • The Power Supply Fan is still working, but does not appear to respond to increased loads, and its speed cannot be increased using SMCFanControl. Any suggestions?

    Hi all - My mac pro 1,1 has an enigmatic problem. It's quad-core, 3Ghz, running OS X 10.7.5. The problem began some months back, when running HD video conferences, HD streaming videos and some other graphics-moderate (I won't say intense) uses, such as slide shows in Just Looking. My machine has an ATY, RadeonX1900 card and 2 monitors - both Apple displays, one being 30 inch 2560x1600, the other being 24 inch 1920x1200.
    When I start those types of graphics-moderate apps, after about 5 minutes, something would crash (the monitors making a noise as it did) and the displays would both go black. The power did not appear to be fully cut off from the monitors. I think that the underlying applications, however, did not crash. So, I could still hear and speak to people during video conferences, and I could hear the sound tracks of videos.
    Attempts to restart the computer and get the monitors back did not immediately work to undo the problem, if done straight away. The only way to correct the problem (so as to have the monitors work) was to wait for a few minutes and then restart.
    After a lot of puzzled looking at console logs (and I confess that I am not an expert), I ran into a blank.
    But, because of the timing of the crashes (after ~5minutes use) and restarts (after some minutes wait), I reasoned that the problem might be temperature related.
    Once on that path of thought, I found this article:
    http://worldtv.com/blog/guides_tutorials/fixing_an_overheating_mac_pro_no_expens e_required.php
    I installed both Temperature Monitor and SMCFanControl. And I experimented, and got interesting results:
    Now to the puzzling bit: SMCFanControl shows that the speed of the Power Supply Fan doesn't vary much, even if I use SMCFanControl to ramp fan speeds right up. All of the other fans react to SMCFanControl, going up to and above 2500rpm when commanded. But the Power Supply Fan does not.  Having watched it for a few days now, the Power Supply Fan, according to AFCFanControl, never varies outside of a range from about 600-640 rpm, regardless of what I do with AFCFanControl.
    Also (and not surprisingly), whenever the graphics-moderate apps run, when I ramp all the fan speeds up using SMCFanControl, Temperature Monitor shows that the all of the temperatures within the machine plummet, except in the power supply locations. Power Supply Location 2 is the worst affected. Because the Power Supply Fan does not react as the other fans do, the "crashes" still occur.
    I could post some screen shots of the read outs of SMCFanControl and Temperature Monitor, although I think I have covered the key points in this post.
    It seems that the Power Supply Fan is still working, but does not respond to increased loads.
    Instinctively, I'm worried that if that's right, it might be a hard problem to fix. Any suggestions? Help! I would really appreciate them!
    Cheers
    P

    Thanks for your response Grant. I had already read about, and I think excluded, dust in graphics card/fan/assembly as a cause. The entire inside of the computer, including the graphics card/fan/assembly, is as clean as a whistle. It looks clean. I've cleaned the dust out every now and then (including a few days ago). Also, my undersanding (derived from the article, linked in my first post) is that I might expect to see high temperatures in the Northbridge and memory module B if the graphics card was overheating. According to Temperature Monitor, however, locations do not increase in temperature when I run the relevant apps. Finally, the graphics card/assembly does not feel too hot to touch.
    It is strange that SMCFanControl lists the Power Supply Fan as being software controllable, if that fan is not. Still, your comments are consistent with my observations, as the fan simply does not respond to software control.
    There are two upsides: First, I've something of a work-around. I've worked out what temperature must be achieved in Power Supply Location 2 for a crash to occur, and I can watch that location in Temperature Monitor, terminating the process before that treshold is reached. Of course, that's not ideal. Second, ramping all the other fans up does significantly delay the onset of the problem, and makes recovery time much quicker.
    Is there any donwside to peridically ramping up the other fans when running the relevant apps? Given that it causes all of the other locations to cool significantly, could this lessesn the life expecancy of the mahcine? (I don't want to run the fans up all the time - that's like sitting next to a jet ready for take off!)
    Also, a correction to my first post: Yesterday, with all the other fans running on full and running an HD streaming video, the Power Supply Fan did, eventually, slowly, come up to ~740rpm, which is much higher than the ~640rpm maximum I had previously seen, and this may have aided delaying the onset of the problem. 
    I'm not sure where this leaves me? The problem might now be able managed. Well, sort-of. But it's not eliminated.

  • The work book does not exist in the document store

    Hi Forum,
    Has anyone come accross this error "The work book does not exist in the document store" I just changed the description of my Work book in Development and saved. Now it wont open. The error message is "The work book does not exist in the document store". I already have this work book in Q. So I cannot create another one with a different tech. name. Someone please help

    Youcan no longer display a workbook. You receive an error message when opening: <Internal error>: 1201 document storage
    Cause and prerequisites
    In very rare cases, when you store a workbook, you might not be able to open it again.
    Solution
    Function module BDS_PHIOS_GET_RIGHT has to be changed so that the last available version of the Workbooks can be displayed.

  • I bought Adobe Elements 12; I cannot use panorama photomerge, I have followed the directions to go to Full Edit  mode in edit workspace choose File New Photomerge. However the Photomerge does not work, it does not respond.   The only thing I can come u

    I bought Adobe Elements 12; I cannot use panorama photomerge, I have followed the directions to go to Full Edit  mode in edit workspace> choose File> New> Photomerge. However the Photomerge does not work, it does not respond.
    The only thing I can come up with is that I found a blog that said that in the Trial version Photomerge does not work, however I do Not have the Trial version, I did at one time but I purchase Adobe Elements. Thank you.

    The blog was incorrect. Photomerge should work in the trial, too.
    When things get weird in PSE the first thing to do is to delete the prefs. Go to the editor preferences>general, click this button and restart the editor:

  • Unable to work, CC does not respond

    Unable to work, CC does not respond
    Message to launch photoshop or indesign:
    Error
    There Was an error with this action. Try again later.
    e76a857c-681f-4146-b539-161a9832373c
    I work on Mac 10.9
    thank you

    Looks like toad is right. A quick google search on "does not have any corresponding BIOS drive" shows a load of entries going back to 2006. The ones I looked at are same error as you report, and the fix sounds exactly what toad said:
    The first Google result was -
    http://www.cyberciti.biz/faq/error-devhdx-does-not-have-any-corresponding-bios-drive-and-solution/
    Which basically says to do this -
    # grub-install --recheck /dev/sda
    You did mention recheck in your post. I then read the post again:
    > boot arch iso
    > mount /dev/sda2 /mnt
    > cd /mnt
    > mount -t proc proc proc/
    > mount -t sysfs sys sys/
    > mount -o bind /dev dev/
    > chroot /mnt
    > grub-install /dev/sda
    and you are mounting /dev/sda2 to /mnt but trying to install grub to /dev/sda.
    I can't say for sure that's wrong but surely sda2 wont mount to /dev/sda? I may be miles off here admittedly. I can't remember offhand how mount works.
    Last edited by RichAustin (2011-09-05 13:38:31)

  • [svn:fx-4.0.0] 13615: fix airframework/build. xml so the en_US _rb does not become corrupt when the other. locales target is run.

    Revision: 13615
    Revision: 13615
    Author:   [email protected]
    Date:     2010-01-18 20:59:14 -0800 (Mon, 18 Jan 2010)
    Log Message:
    fix airframework/build.xml so the en_US _rb does not become corrupt when the other.locales target is run.
    -removed the redundant en_US call in the other.locales target
    -added a clean for locales that will only remove the locale being built before rebuild - not all of the locales
    -add updated dita that does not contain spark references
    QE notes: 
    Doc notes:
    Bugs: no but Pete and I discussed briefly
    Reviewer:
    Tests run: doc and other.locales
    Is noteworthy for integration:
    Modified Paths:
        flex/sdk/branches/4.0.0/frameworks/projects/airframework/build.xml
        flex/sdk/branches/4.0.0/frameworks/projects/airframework/bundles/de_DE/docs/packages.dita
        flex/sdk/branches/4.0.0/frameworks/projects/airframework/bundles/fr_FR/docs/packages.dita
        flex/sdk/branches/4.0.0/frameworks/projects/airframework/bundles/ru_RU/docs/packages.dita
        flex/sdk/branches/4.0.0/frameworks/projects/airframework/bundles/zh_CN/docs/packages.dita

    What kind of projects are they (Struts/JSF/Hibernate)? Does the working project differ in any way with other two apps?
    What exactly is not working? Are they recognized by workshop as Struts/JSF/Hibernate app?
    Please send the .log to [email protected]

  • My wife's iPhone 4 opens email documents formatted in office open XML but my iPhone 4 does not. Any insight?

    My wife's iPhone 4 opens email documents formatted in office open XML but my iPhone 4 does not. Any insight?

    Phone started working again for no apparent reason.  We did nothing special.  I am going to leave this open for now as I would like to know what could cause this.

  • IPod model A1059, freezes, unresponsive to all click wheel entries.  Reset does not work.  Does not show up in ITunes or on windows explorer.  What is the problem and how do I fix it?

    IPOD model A1059 appears frozen and is unresponsive to all click wheel entries. Reset does not work.  Does not show up in ITunes or in Windows Explorer.  What is the problem and is there a fix?

    If you are unable to reset the iPod (assuming the hold switch is not in the On position either), then you'll have to let the iPod's battery fully drain. Then connect it to a charger and leave it to charge for a couple of hours.
    B-rock

  • My camera is working but does not work on skype how do I turn the camera on for Skype

    My camer is working but does not work on skype how do I turn the camera on.

    See this thread:
    https://discussions.apple.com/thread/5306216?tstart=0
    FIX: 
    1. You need Time Machine
    2. Go to folder /Library/CoreMediaIO/Plug-Ins/DAL/
    3. Copy AppleCamera.plugin to good place (usb memory stick is the best place).
    4. Go to Time machine in date that skype work fine.
    5. Change AppleCamera.plugin with file from Time Machine
    6. Restart system, Now skype need to work with camera.
    If that doesnt pass,
    Suggest looking here, much success has been found:
    http://community.skype.com/t5/Mac/OS-X-10-8-5-broke-Video-on-MacBook-Air/td-p/18 91729/page/4

  • USB Drives works, but does not show up in "Safely Remove Hardware"

    USB Drives works, but does not show up in "Safely Remove Hardware"
    windows 8 
    USB Drives works, but does not show up in "Safely Remove Hardware"
    Here are my symptom
    - USB Flash Drives , USB External HDD works normally
    - I can see them in "My Computer"
    - I can open "Safely Remove Hardware" via Run Command, but there is no device in the list
    - They show up as "Disk drives" in device manager
    - When I right click their icons in "My Computer", there is no option to "Eject" them
    - In "Disk Management", they show up as "Basic". Prior to this issue, they were "Removable"
    After I tested, it seems that my Vista detects every USB storage device as a normal HDD.
    I don't know why but I'd appreciate any help because I have to plug-in and remove those drives often, especially flash drives.
    Thank you

    Hello Mickey2003
    Welcome to the HP Forums, I hope you enjoy your experience! To help you get the most out of the HP Forums I would like to direct your attention to the HP Forums Guide First Time Here? Learn How to Post and More.
    I understand you are having issues in Windows Vista with your USB Storage devices not showing up in the Safely Remove Hardware list. I am providing you with a link to a Microsoft Hotfix for this very issue titled An external USB storage device may not appear in the Safely Remove Hardware list in the notification.... I would recommend you review the KB document and ensure you a familiar with the Hotfix information and run the hotfix to resolve the issue you are experiencing.
    Please re-post if you require additional support. Thank you for posting on the HP Forums. Have a great day!
    Please click the "Thumbs Up" on the bottom right of this post to say thank you if you appreciate the support I provide!
    Also be sure to mark my post as “Accept as Solution" if you feel my post solved your issue, it will help others who face the same challenge find the same solution.
    Dunidar
    I work on behalf of HP
    Find out a bit more about me by checking out my profile!
    "Customers don’t expect you to be perfect. They do expect you to fix things when they go wrong." ~ Donald Porter

Maybe you are looking for