Strange problem when validating XML agains DTD file.

Dear experts,
I'm write a simple code snippet that validates my XML file agains a given DTD.
It allways report the following error:
org.xml.sax.SAXParseException: The markup in the document preceding the root element must be well-formed.
     at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
     at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)Althought, my xml file is OK with Xmlspy.
My code is:
System.setProperty("javax.xml.parsers.DocumentBuilderFactory",
                         "org.apache.xerces.jaxp.DocumentBuilderFactoryImpl");
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      factory.setNamespaceAware(true);
      factory.setValidating(true);
      factory.setAttribute(
          "http://java.sun.com/xml/jaxp/properties/schemaLanguage",
          "http://www.w3.org/2001/XMLSchema");
      factory.setAttribute(
          "http://java.sun.com/xml/jaxp/properties/schemaSource", SchemaUrl);
      DocumentBuilder builder = factory.newDocumentBuilder();
      Validator handler = new Validator();
      builder.setErrorHandler(handler);
      builder.parse(new java.io.FileInputStream(new java.io.File(XmlDocumentUrl)));And here are the xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE capsule SYSTEM "c:/SampleFiles/capsule.dtd">
<capsule>
     <header>
          <name>Capsule 1</name>
          <author>Author</author>
          <company>Company</company>
          <last-save-time>Fri Apr 01 14:59:21 GMT+07:00 2005</last-save-time>
          <description>description</description>
     </header>
     <datasets>
          <dataset type="input">
               <name>dataset1</name>
               <description></description>
               <columns>
                    <column type="fromsource">
                         <name>partno</name>
                         <data-type>varchar</data-type>
                         <length>80</length>
                         <precision/>
                         <scale/>
                         <allow-null>false</allow-null>
                         <default-value/>
                    </column>
                    <column type="notfromsource">
                         <name>balanceonhand</name>
                         <data-type>integer</data-type>
                         <length/>
                         <precision/>
                         <scale/>
                         <allow-null>false</allow-null>
                         <default-value/>
                    </column>
               </columns>
               <rule>LET a=update; LET b=employye set salary = 100; print a + b</rule>
               <!--output: update employee set salary = 100-->
               <command>inmemory (getvalue_dataset("dataset1".rule))</command>
               <params>
                    <param>
                         <name/>
                         <type/>
                    </param>
               </params>
          </dataset>
     </datasets>
</capsule>What I can do now? Change my xml file?
Please provide some hints.
Thanks in advance.

I tried to remove the DOCTYPE, but the problem stayed the same.
Thanks.

Similar Messages

  • Strange problem when copying files to NAS

    Hello all. I have a strange problem when trying to copy files from my intel iMac to my Seagate NAS. I am copying files from my HD and when the file is nearly copyied i get an error message saying that the file can't be copied because it is already in use by another application. Well... it surely isn't. I try copying them by ftp (Filezilla) and everything works fine. I can then access them through my media server but !!!! NOT THROUGH MY iMac!!!! It is like the files are not there!!!! But they definetely are! I tried fixing the disk permissions, rebooting NAS, iMac etc but nothing seems to solve the problem. Is there any suggestion of what might be wrong? I am under Mavericks and i am pretty sure that the problem started after the update. When copying from my external USB hard drive to my iMac HD everything works fine. The problem is from my iMac to my NAS.

    Wow... thanks for the time you devote Linc.... Well below are the results of the above commands....
    Step 1 returned no text.
    Step 2 returned the following text:
    com.tunabellysoftware.checkmytemp.GNTPClientService
    jp.co.canon.MasterInstaller
    com.WesternDigital.WDSmartWareD
    com.wdc.WDDMservice
    com.teamviewer.service
    com.tappin.agent.plist
    com.microsoft.office.licensing.helper
    com.klieme.TimeMachineScheduler
    com.adobe.SwitchBoard
    com.adobe.fpsaud
    Step 3 returned the following text:
    com.adobe.PDApp.AAMUpdatesNotifier.59168.9D679ECB-757D-43DD-920E-153524EA697A
    jp.co.canon.cijscannerregister.67792
    jp.co.canon.ij.CNSSelectorAgent.66384
    OpenObject.fuspredownloader.65328
    com.tappin.TappIn.53712
    com.ecamm.PhoneViewHelper.65680
    com.pratikkumar.RemoteHelper.51424
    com.elgato.eyetvhelper.10064
    6.0.65152
    com.tunabellysoftware.TemperatureGaugeHelper
    com.paragon.ntfs.trial
    com.teamviewer.desktop
    com.teamviewer.teamviewer
    com.sony.PMBPortable.AutoRun
    com.google.keystone.user.agent
    com.adobe.ARM.df0ab5bbe6f698196fcc21e3c1e66dcb758bd911f4d637272d9d8109
    com.adobe.AAM.Scheduler-1.0
    Step 4 returned the following text:
    /Library/Components:
    /Library/Extensions:
    ATTOCelerityFC8.kext
    ATTOExpressSASHBA2.kext
    ATTOExpressSASRAID2.kext
    ArcMSR.kext
    CalDigitHDProDrv.kext
    HighPointIOP.kext
    HighPointRR.kext
    PromiseSTEX.kext
    SoftRAID.kext
    /Library/Frameworks:
    AEProfiling.framework
    AERegistration.framework
    Adobe AIR.framework
    AudioMixEngine.framework
    NyxAudioAnalysis.framework
    PluginManager.framework
    TSLicense.framework
    WesternDigital
    iLifeFaceRecognition.framework
    iLifeKit.framework
    iLifePageLayout.framework
    iLifeSQLAccess.framework
    iLifeSlideshow.framework
    iTunesLibrary.framework
    /Library/Input Methods:
    /Library/Internet Plug-Ins:
    AdobePDFViewer.plugin
    AdobePDFViewerNPAPI.plugin
    Aspera Web.plugin
    Default Browser.plugin
    EPPEX Plugin.plugin
    Flash Player.plugin
    Flip4Mac WMV Plugin.plugin
    JavaAppletPlugin.plugin
    NavIn.plugin
    Quartz Composer.webplugin
    QuickTime Plugin.plugin
    SharePointBrowserPlugin.plugin
    SharePointWebKitPlugin.webplugin
    Silverlight.plugin
    flashplayer.xpt
    iPhotoPhotocast.plugin
    nsIQTScriptablePlugin.xpt
    /Library/Keyboard Layouts:
    /Library/LaunchAgents:
    com.adobe.AAM.Updater-1.0.plist
    com.apple.NavService.plist
    com.oracle.java.Java-Updater.plist
    com.sony.PMBPortable.AutoRun.plist
    com.teamviewer.teamviewer.plist
    com.teamviewer.teamviewer_desktop.plist
    /Library/LaunchDaemons:
    com.WesternDigital.WDSmartWareD.plist
    com.adobe.SwitchBoard.plist
    com.adobe.fpsaud.plist
    com.klieme.TimeMachineScheduler.plist
    com.microsoft.office.licensing.helper.plist
    com.oracle.java.Helper-Tool.plist
    com.tappin.agent.plist
    com.teamviewer.teamviewer_service.plist
    com.wdc.WDDMservice.plist
    jp.co.canon.MasterInstaller.plist
    /Library/PreferencePanes:
    EyeConnect.prefPane
    Flash Player.prefPane
    Flip4Mac WMV.prefPane
    GRproofing.prefPane
    Growl.prefPane
    JavaControlPanel.prefPane
    NTFSforMacOSX.prefPane
    Perian.prefPane
    TappIn.prefPane
    TimeMachineScheduler.prefPane
    /Library/PrivilegedHelperTools:
    com.microsoft.office.licensing.helper
    jp.co.canon.MasterInstaller
    /Library/QuickLook:
    GBQLGenerator.qlgenerator
    QuickLookEyeTV.qlgenerator
    iBooksAuthor.qlgenerator
    iWork.qlgenerator
    /Library/QuickTime:
    AC3MovieImport.component
    AppleIntermediateCodec.component
    AppleMPEG2Codec.component
    EyeTV MPEG Support.component
    Perian.component
    /Library/ScriptingAdditions:
    Adobe Unit Types.osax
    /Library/Spotlight:
    GBSpotlightImporter.mdimporter
    LogicPro.mdimporter
    Microsoft Office.mdimporter
    iBooksAuthor.mdimporter
    iWork.mdimporter
    /Library/StartupItems:
    ChmodBPF
    DynDNSUpdater
    EyeConnect
    /etc/mach_init.d:
    /etc/mach_init_per_login_session.d:
    /etc/mach_init_per_user.d:
    Library/Address Book Plug-Ins:
    SkypeABDialer.bundle
    SkypeABSMS.bundle
    Library/Fonts:
    AC-CondensedScript_Unicode.otf
    AC-CuttingEdge.otf
    AC-FrenchToast.otf
    AC-Gorgi.otf
    AC-HiSchool.otf
    AC-Hollow_Unicode.otf
    AC-Lundi.otf
    AC-Lycee.otf
    AC-Pathetic_unicode.otf
    AC-mutlu_unicode.otf
    ACRealAdult.otf
    AVI-BonatiPT-Bold.ttf
    AVI-BonatiPT-BoldItalic.ttf
    AVI-BonatiPT-Italic.ttf
    AVI-BonatiPT-Normal.ttf
    AVI-Jacobs-Bold.ttf
    AVI-Jacobs-BoldItalic.ttf
    AVI-Jacobs-Italic.ttf
    AVI-Jacobs-Normal.ttf
    AVI-Optima-Bold.ttf
    AVI-Optima-BoldItalic.ttf
    AVI-Optima-Italic.ttf
    AVI-Optima-Normal.ttf
    AVI-OptimaCollege-Italic.ttf
    AVI-OptimaCollege.ttf
    AVI-ParisAifel-Medium.ttf
    AVI-ParisAifel-MediumItalic.ttf
    AdLib BT.suit
    AdLibBTReg
    Andale Mono
    ArbuckleShadowNF.otf
    Arial
    Arial Black
    Arial Narrow
    BleeckerStreetShadedNF.otf
    BundleofJoyOutlineNF.otf
    CF Bac
    CF Bar
    CF Bar-Bold
    CF BarText
    CF BarText-Bold
    CF Big
    CF Compacta Bold
    CF Compacta ExtraBold
    CF Compacta Light
    CF Compacta Medium
    CF Compacta Regular
    CF Criton
    CF Criton-Contrafos
    CF Criton-Heavy
    CF Derrida-Bold
    CF Derrida-Book
    CF Derrida-Heavy
    CF Derrida-Light
    CF Derrida-SemiBold
    CF DogEatDog
    CF Fat
    CF Holly
    CF Holly-Bold
    CF Holly-Light
    CF Holly-Medium
    CF Initials
    CF Jet
    CF Jet-Alter
    CF Jet-Left
    CF Jet-Right
    CF Jet-Simple
    CF K-Graffiti
    CF K-Select
    CF KouroudiSelect-Bold
    CF KouroudiSelect-Fun
    CF KouroudiSelect-Regular
    CF KouroudisGraffiti-Dust
    CF KouroudisGraffiti-Light
    CF KouroudisGraffiti-Regular
    CF LetterGothic
    CF MatrixDot
    CF MatrixFax
    CF MatrixMonospace
    CF MatrixNegative
    CF Newspaper
    CF PainterBlack
    CF PainterBold
    CF PainterRegular
    CF Poster
    CF Sans
    CF Sans-Bold
    CF Sans-Heavy
    CF SempliceBold
    CF SempliceRegular
    CF SempliceThin
    CF Smooth
    CF Smooth-CondBold
    CF Smooth-CondNorm
    CF Smooth-ExtraBold
    CF Smooth-Revenge
    CF Smooth-Toy
    CF Sophia
    CF Sophia-Bold
    CF Sophia-BoldItalic
    CF Sophia-Italic
    CF Stamp
    CF Stencil
    CF Suprematica
    CF Twins
    CF Venus
    CFBarSG
    CFBarSGBol
    CFBarTexSG
    CFBarTexSGBol
    CFBigSG
    CFCriSGCon
    CFCriSGHea
    CFDogEatDogSG
    CFEteoclesContrafos
    CFEteoclesHeavy
    CFEteoclesRegular
    CFFatSG
    CFHolSGBol
    CFHolSGLig
    CFHolSGMed
    CFIniSG
    CFJetAlt
    CFJetLef
    CFJetRig
    CFJetSim
    CFKouGraSGDus
    CFKouGraSGLig
    CFKouGraSGReg
    CFKouSelSGBol
    CFKouSelSGFun
    CFKouSelSGReg
    CFLetGotSG
    CFNewSG
    CFSanSG
    CFSanSGBol
    CFSanSGHea
    CFSmoSGConBol
    CFSmoSGConNor
    CFSmoSGExtBol
    CFSmoSGRev
    CFSmoSGToy
    CFSopSG
    CFSopSGBol
    CFSopSGBolIta
    CFSopSGIta
    CFSteSG
    CFSupSG
    CFTwiSG
    Century
    ChicaGogoOpenNF.otf
    D-Regular.suit
    DReg
    DejaVuSans-Bold.ttf
    DejaVuSans-BoldOblique.ttf
    DejaVuSans-ExtraLight.ttf
    DejaVuSans-Oblique.ttf
    DejaVuSans.ttf
    DejaVuSansCondensed-Bold.ttf
    DejaVuSansCondensed-BoldOblique.ttf
    DejaVuSansCondensed-Oblique.ttf
    DejaVuSansCondensed.ttf
    DejaVuSansMono-Bold.ttf
    DejaVuSansMono-BoldOblique.ttf
    DejaVuSansMono-Oblique.ttf
    DejaVuSansMono.ttf
    DejaVuSerif-Bold.ttf
    DejaVuSerif-BoldOblique.ttf
    DejaVuSerif-Oblique.ttf
    DejaVuSerif.ttf
    DejaVuSerifCondensed-Bold.ttf
    DejaVuSerifCondensed-BoldOblique.ttf
    DejaVuSerifCondensed-Oblique.ttf
    DejaVuSerifCondensed.ttf
    Demo_ConeriaScript.ttf
    Demo_ConeriaScript_Slanted.ttf
    Demon
    Demonstrator.suit
    DidgereeDoodleOutlineNF.otf
    DrumagStudioOutlineNF.otf
    ElektromotoNarrowOutlineNF.otf
    Franklin Gothic Demi
    Franklin Gothic Heavy
    FuturBTBol
    FuturCon
    Futura Bd BT.suit
    Futura Condensed.suit
    GFS Goschen-Italic.otf
    GFSAmbrosia.otf
    GFSDecker.otf
    GFSEustace.otf
    GFSFleischman.otf
    GFSGaraldus.otf
    GFSIgnacio.otf
    GFSJackson.otf
    GFSNeohellenic.otf
    GFSNeohellenicBold.otf
    GFSNeohellenicBoldIt.otf
    GFSNeohellenicIt.otf
    GFSNicefore.otf
    GFSPhilostratos.otf
    GFSPolyglot.otf
    GFSTheokritos.otf
    Georgia
    Gill Sans Hel
    Gill Sans Hel Pt-SCOS
    Gill Sans Hel Pt-SCOSBold
    Gill Sans Hel-Bold
    Gill Sans Hel-BoldItalic
    Gill Sans Hel-Con
    Gill Sans Hel-ConBold
    Gill Sans Hel-Demi
    Gill Sans Hel-DemiItalic
    Gill Sans Hel-ExBold
    Gill Sans Hel-ExConBold
    Gill Sans Hel-ExLight
    Gill Sans Hel-Italic
    Gill Sans Hel-Light
    Gill Sans Hel-LightItalic
    Gill Sans Hel-SCOS
    Gill Sans Hel-SCOSBold
    Gill Sans Hel-SemCon
    Gill Sans Hel-SemConBdIt
    Gill Sans Hel-SemConBold
    Gill Sans Hel-SemConIt
    Gill Sans Hel-SemConLight
    Gill Sans Hel-SemConThin
    Gill Sans Hel-Thin
    Gill Sans Hel-UltBold
    Gulim.ttf
    HelveConBol
    HelveNeuMedCon
    Helvetica Condensed.suit
    HelveticaNeue MediumCond.suit
    Looney Tunes Tilt BT.ttf
    LooseCabooseOutlineNF.otf
    Lucida Sans
    PF DaVinciScriptPoly-Inked.ttf
    PF DaVinciScriptPoly-Reg.ttf
    PFAlfabeta
    PFAlfabetaOS Poly Bold.ttf
    PFAlfabetaOS Poly BoldItal.ttf
    PFAlfabetaOS Poly Italic.ttf
    PFAlfabetaOS Poly Regular.ttf
    PFAmateur
    PFArabats.ttf
    PFBarApart
    PFBaseline
    PFBaselineDisplay
    PFBeatnick
    PFBedroom
    PFBellGothicText
    PFBerkleyBlue
    PFBevel
    PFBodoniScriptOne
    PFBodoniScriptTwo
    PFBodoniText
    PFBodoniText Poly-Bold.ttf
    PFBodoniText PolyBoldItalic.ttf
    PFBodoniText-Poly Italic.ttf
    PFBodoniText-Poly Regular.ttf
    PFBulletin
    PFCatalog
    PFCatalogPoly-Bold.ttf
    PFCatalogPoly-BoldItalic.ttf
    PFCatalogPoly-Italic.ttf
    PFCatalogPoly-Regular.ttf
    PFCentury
    PFCereal
    PFCheltenham
    PFCosmonut
    PFCosmonut-Astrobats.ttf
    PFDaVinciScript
    PFDeeJay
    PFDidotOsPoly-Bold.ttf
    PFDidotOsPoly-BoldItalic.ttf
    PFDidotOsPoly-Italic.ttf
    PFDidotOsPoly-Regular.ttf
    PFDigicons-One.ttf
    PFDigicons-Two.ttf
    PFDigidotSemiSquare
    PFDigidotSquare
    PFDinDisplay
    PFDinText
    PFDinTextCompressed
    PFDinTextCondensed
    PFDiplomat
    PFDiplomatPoly-Bold.ttf
    PFDiplomatPoly-BoldItalic.ttf
    PFDiplomatPoly-Italic.ttf
    PFDiplomatPoly-Regular.ttf
    PFDiplomatSans
    PFEarthbound
    PFEphemera
    PFEphemera Poly-Bold.ttf
    PFEphemera Poly-BoldItalic.ttf
    PFEphemera Poly-Italic.ttf
    PFEphemera Poly-Regular.ttf
    PFEtnica
    PFFragment
    PFFranklinGothic
    PFFreeScript
    PFFuel
    PFFusionSans
    PFFuturaNeu
    PFGaramondClassic
    PFGlobal
    PFGoudyInitials.ttf
    PFGrid
    PFHardkore
    PFHausSquare
    PFHighwayGothic
    PFHighwayGothicCompressed
    PFHighwayGothicCondensed
    PFHighwayGothicExtended
    PFHighwayGothicXtraCond
    PFHipster
    PFHitower
    PFHybrid
    PFIndex
    PFInnercity
    PFIsotext
    PFIsotextExtended
    PFJunior
    PFKids
    PFKids-LilStuff.ttf
    PFKonstantinople
    PFKonstantinople Initials.ttf
    PFLetterGothicDisplay
    PFLetterGothicNext
    PFLibera
    PFLithoText
    PFMacsimile
    PFManicAttack
    PFMechanica
    PFMediterra
    PFMonumenta
    PFNext
    PFOnline
    PFPanel
    PFPaperback
    PFPapernote
    PFPlasmatic
    PFPlayskool
    PFPremierDisplay
    PFPremierFrame
    PFPremierText
    PFPress
    PFPsychedelia
    PFRadikale
    PFRafSkript
    PFReminder
    PFReport
    PFRetrospace
    PFRoyalscript
    PFScriptor-Ligatures.ttf
    PFScriptor-Ornaments.ttf
    PFScriptor-Regular.ttf
    PFSectorA
    PFSectorB
    PFSidetrip
    PFSignSkript
    PFSignSkript-AdClips.ttf
    PFStamps
    PFStudio
    PFSugar
    PFSystemplus
    PFTemple
    PFTemple-Icons.ttf
    PFTempleSerif
    PFTextbook
    PFTraffic
    PFTransport
    PFUniversal
    PFVenue
    PFVideotext
    PFWonderland
    PFWonderland-Wonderbats.ttf
    Palatino Linotype
    SketchIcons.ttf
    SketchIconsbold.ttf
    SnoopySnailsOutlineNF.otf
    StadionGreek
    Tahoma
    That_'s Font Folks!.ttf
    Times New Roman
    Times.suit
    TimesRom
    Trebuchet MS
    UB-Aircraft
    UB-AntiqueOlive
    UB-AntiqueOlive-Bold
    UB-AntiqueOlive-BoldItalic
    UB-AntiqueOlive-Italic
    UB-AntiqueOliveBlack
    UB-AntiqueOliveBlack-Italic
    UB-AntiqueOliveCompact
    UB-AntiqueOliveCompact-Ita
    UB-AntiqueOliveLight
    UB-AntiqueOliveLight-Italic
    UB-AvantGarde
    UB-Baskerville
    UB-Baskerville-Bold
    UB-Baskerville-BoldItalic
    UB-Baskerville-Italic
    UB-Bonati
    UB-BonatiCond
    UB-BonatiHeavy
    UB-Byzantine
    UB-Calculator
    UB-Calligula
    UB-Century
    UB-Century-Bold
    UB-Century-BoldItalic
    UB-Century-Italic
    UB-Donuts
    UB-DonutsCond
    UB-End
    UB-Europa
    UB-FarWest
    UB-FarWestExt
    UB-Fashion
    UB-Fine
    UB-Flores
    UB-Free
    UB-Front
    UB-Future
    UB-FutureCond
    UB-Goudies
    UB-Helvetica
    UB-Helvetica-Bold
    UB-Helvetica-BoldItalic
    UB-Helvetica-Italic
    UB-HelveticaBlack
    UB-HelveticaBlack-Italic
    UB-HelveticaCond
    UB-HelveticaCond-Bold
    UB-HelveticaCond-BoldItalic
    UB-HelveticaLight
    UB-HelveticaLight-Italic
    UB-HelveticaThin
    UB-HelveticaThinCond
    UB-King
    UB-Lucky
    UB-Maskat
    UB-Muratti
    UB-MurattiCond
    UB-NewsLetter
    UB-Ninza
    UB-Omnius
    UB-Optima
    UB-Optima-Bold
    UB-Optima-BoldItalic
    UB-Optima-Italic
    UB-Paris
    UB-Rich
    UB-Rockwell
    UB-Rockwell-Bold
    UB-Rockwell-BoldItalic
    UB-Rockwell-Italic
    UB-RockwellBlack
    UB-RockwellBlack-Italic
    UB-RockwellLight
    UB-RockwellLight-Italic
    UB-Script
    UB-Sherlock
    UB-SherlockCond
    UB-Shop
    UB-Sign
    UB-Slogan
    UB-Soccer
    UB-SoccerCondOblique
    UB-Souvenir
    UB-Souvenir-Bold
    UB-Souvenir-BoldItalic
    UB-Souvenir-Italic
    UB-SouvenirBlack
    UB-SouvenirBlack-Italic
    UB-SouvenirLight
    UB-SouvenirLight-Italic
    UB-Times
    UB-Times-Bold
    UB-Times-BoldItalic
    UB-Times-Italic
    UB-Unifine
    UB-Vampire
    UB-World
    Verdana
    VinnieBoombahOutlineNF.otf
    Wingdings
    Wingdings 2
    Wingdings 3
    nbyzn.ttf
    soundfx.ttf
    Library/Frameworks:
    SamsungKiesFoundation.framework
    SamsungKiesSerialPort.framework
    Library/Input Methods:
    .localized
    Library/InputManagers:
    Library/Internet Plug-Ins:
    Google Earth Web Plug-in.plugin
    iGetterBundle.plugin
    Library/Keyboard Layouts:
    Library/LaunchAgents:
    com.adobe.AAM.Updater-1.0.plist
    com.adobe.ARM.df0ab5bbe6f698196fcc21e3c1e66dcb758bd911f4d637272d9d8109.plist
    [email protected]t.plist
    com.google.keystone.agent.plist
    Library/PreferencePanes:
    .TVPC93ED0576A
    Library/ScriptingAdditions:
    iGetterScriptingAddition.osax
    Library/Services:
    ToastIt.service
    Finallu step 5 returned the following text:
    Skype, EyeTV Helper, RemoteHelper, PhoneViewHelper, TappIn, Dropbox, Canon IJ Network Scanner Selector EX, fuspredownloader, StatusMenu
    I hope you find it helpful Linc. Many thanks for all the attention!

  • Validating xml with dtd

    Hi,
             I have found a piece of code through google, to validate an xml file with an external dtd file. which is
               function validateDocument()
                    xmlDocumentObject = new ActiveXObject("microsoft.XMLDOM")
                    xmlDocumentObject.onreadystatechange = changeHandler
                    xmlDocumentObject.load('C:\\My.xml')
                function changeHandler()
               and for that we need to a import i.e  #import "C:\WINDOWS\system32\msxml4.dll"
              here when i try to import "msxml4.dll" in Acrobat javascript (js) file, it is giving error, application exits.
               How can i import dll in Acrobat javascript to get some functionality, or if not
              What someother way to achieve this(To validate xml with dtd file).
             This is totally making me crazy, please someone help me on this issue.
    thanks in advance.

    thanks Leonard,
             But my problem is i have an xml(i created that using acrobat javascript)and a dtd file, i want validate xml file with that dtd, using acrobat or some other way.  How can i validate xml with dtd, please help me.

  • Strange problem when tried to convert HelloWorld.class..

    Hi friends..
    i've downloaded the Java Card SDK 2.2.1, and i tried to compile HelloWorld application that shipped with its distribution..
    i found strange problem when i tried to convert HelloWorld.class into .CAP, etc.. :(
    I use Windows XP, assume that i've set the Environment Variables needed
    i've compiled the HelloWorld.java into HelloWorld.class..
    the package of of HelloWorld is : com.sun.javacard.samples.HelloWorld;
    and i use this config file :
    -out EXP JCA CAP
    -exportpath .
    -applet  0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1:0x1 com.sun.javacard.samples.HelloWorld.HelloWorld
    com.sun.javacard.samples.HelloWorld
    0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1 1.0and then i tried to run converter script in the Console :
    *C:\java_card_kit-2_2_1\samples>converter -config com\sun\javacard\samples\HelloWorld\HelloWorld.opt*
    *error: file com\sun\javacard\samples\HelloWorld\HelloWorld.opt could not be found*
    Usage:  converter  <options>  package_name  package_aid  major_version.minor_ve
    sion
    OR
    converter -config <filename>
                        use file for all options and parameters to converter
    Where options include:
            -classdir <the root directory of the class hierarchy>
                          set the root directory where the Converter
                          will look for classes
            -i            support the 32-bit integer type
            -exportpath  <list of directories>
                          list the root directories where the Converter
                          will look for export files
            -exportmap    use the token mapping from the pre-defined export
                          file of the package being converted. The converter
                          will look for the export file in the exportpath
            -applet <AID class_name>
                          set the applet AID and the class that defines the
                          install method for the applet
            -d <the root directory for output>
            -out  [CAP] [EXP] [JCA]
                          tell the Converter to output the CAP file,
                          and/or the JCA file, and/or the export file
            -V, -version  print the Converter version string
            -v, -verbose  enable verbose output
            -help         print out this message
            -nowarn       instruct the Converter to not report warning messages
            -mask         indicate this package is for mask, so restrictions on
                          native methods are relaxed
            -debug        enable generation of debugging information
            -nobanner     suppress all standard output messages
            -noverify     turn off verification. Verification is defaultPlease help me regarding this, because i'm new in this field..
    Thanks in advance..

    Thanks safarmer for your reply..
    i tried this :
    C:\java_card_kit-2_2_1\samples>javac -target 1.3 -source 1.1 -g -classpath .\cla
    sses;..\lib\api.jar;..\lib\installer.jar src\com\sun\javacard\samples\HelloWorld
    \*.java
    javac: invalid source release: 1.1
    Usage: javac <options> <source files>
    use -help for a list of possible options
    C:\java_card_kit-2_2_1\samples>javac -target 1.3 -source 1.2 -g -classpath .\cla
    sses;..\lib\api.jar;..\lib\installer.jar src\com\sun\javacard\samples\HelloWorld
    \*.java
    it seems that i can't specify the -source to 1.1, so i tried to use -source 1.2..
    after that, i tried to convert again, and i got this error :
    C:\java_card_kit-2_2_1\samples\src>converter -config com\sun\javacard\samples\He
    lloWorld\HelloWorld.opt
    Java Card 2.2.1 Class File Converter, Version 1.3
    Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to lic
    ense terms.
    error: com.sun.javacard.samples.HelloWorld.HelloWorld: unsupported class file fo
    rmat of version 47.0.
    conversion completed with 1 errors and 0 warnings.Please help me regarding this..
    Thanks in advance..

  • Strange problem with linking to external vob-file

    I have a strange problem with linking to external vob-file. I
    have created a link using BudApi:
    on mouseup
    set OK = baOpenFile ( the pathname &
    "Files\General\Video\VTS_01_1.VOB", "normal")
    end
    This code opens mpg-videos correctly, but nothing happens
    when I try to open vob-files with the same code. The strangest
    thing is that when I change the default program for vob-files to
    WinDVD this code works and the file opens, but when I change the
    default program to Nero Showtime this code doesn't do anything
    (when I open the file 'manually' from the folder, it opens
    correctly on Nero Showtime). My client uses Nero Showtime, so I
    really would appreciate any help on this one.

    temes wrote:
    >
    quote:
    Originally posted by:
    Newsgroup User
    >> When using Nero Showtime as a default program, the
    error code is 31,
    >> "There is no application associated with the given
    filename".
    >
    > Which suggests that something has gone wrong with file
    associations.
    > If
    > you double-click one of these files in an Explorer
    window does it fire
    > up Showtime and open the file?
    >
    >
    > Yes, the file opens correctly in Nero Showtime when
    double-clicking
    > it in an Explorer. I tried the file associations and
    created a
    > html-page with a link to the vob-file, and the html-link
    opens the
    > vob-file correcly with Nero Showtime. My client reported
    this
    > problem, so it's not just my computer which is having
    this problem.
    If you open a command prompt, do you get an association
    listed like this
    example for .txt files:
    C:\>assoc .txt
    .txt=txtfile
    C:\>ftype txtfile
    txtfile="D:\Program Files\JGsoft\EditPadLite\EditPadLite.exe"
    "%1"
    Andrew

  • Strange problem when opening word doc situated in WLS virtual dir

    Hi all,
    we have a strange problem when opening word doc
    situated in C:\Oracle\Middleware\as_1\forms\webutil
    we put some word docs there and tried to open from forms using for example web.show_document('http://wp0606:9001/forms/webutil/mug00103.doc', '_blank');
    no problem using FF, however in IE8 the word doc is shown in its binary format, this also happens when we try to open the doc in IE8
    however when we google and search for instance for a test.doc and then click on this url a file save dialog is shown
    that's why we believe that this might be due to a configuration issue of WLS
    any help would be greatly appreciated
    Kr
    Martin

    I think you have 2 ways to go here. Figure out what html is from wherever weblogic gets it, meaning you have to delve into the docs, snoop
    around in directories and find what it must be sending (This is going to be unavoidable if you are going to change what weblogic is doing.
    Sooner or later you have to try to figure out where it gets this stuff from)
    or
    you can experimentally snoop on your url with a tool like wget or curl. These are fundamental web tools.
    The latter is always a useful thing to be able to do. (you need to formulate a query to get the content-type).
    Whoever managed to get weblogic to serve any files in the first place probably can figure this out.

  • Why does Acrobat Pdf converter file slow down my 2003, Windows  Word Program.  I only experience this problem when i convert a pdf file to a doc file.

    Why does Acrobat Pdf converter file slow down my 2003, Windows  Word Program.  I only experience this problem when i convert a pdf file to a doc file.

    Hi Bill -- thanks for your reply!
    When I check the Document Properties on Acrobat I can see that the fonts used in the document (Cambria, Times and Windings) are listed as "Embedded Subset" in the Fonts panel. The machine it was created on did use an earlier version of OS X and an old version of Word, but it seems to have the proper fonts...
    -nick

  • Strange problem when transfering songs

    Hi Everyone,
    I have a very strange problem when i transfer songs to my iphone.
    When i transfering songs maually (dragging them from ITunes music library to my iphone) i can see that they are in my iphone (at "On This iPhone"),
    but when im looking in my iphone (in the music library) im seeing only 70-80% of the songs.
    And the strange thing is that i can see them if im searching them!
    Please help.
    Thank you!

    I'll have to rephrase my question. Close this one.

  • XML Validation using custom DTD file

    Well, I thought that my problem is about to be a trivial one, but now, I don't think so. I have to develop XML-based protocol over HTTP. XML Document doesn't contain any reference to DTD, but I have some DTDs. I want to validate my XML messages in real time and I want to find some library that allows to do something like that:
    SomeXmlValidatingParser s = new SomeXmlValidatingParser(InputStream dtdFileStream);
    for(;;)
        InputStream is = message.recive();
        DocumentObject = s.parseAndValidate(is);
    }So, the issue is to pass my custom DTD file (it is already loaded to memory) into validating parser.
    So, which library have such functionality? And if there are some, could you be so kind to advice some of them?

    Well, I've just realized that JDK 1.5 has standard way to validate XMLs using XSD schemas. Ok. But look at the sample
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
      <xs:import namespace="http://www.w3.org/XML/1998/namespace"
            schemaLocation="http://www.w3.org/2001/xml.xsd" />
      <xs:element name="birthdate">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="month" type="xs:string" />
            <xs:element name="day" type="xs:int" />
            <xs:element name="year" type="xs:int" />
          </xs:sequence> 
        </xs:complexType>
      </xs:element>
    </xs:schema>Every time I process this schema, it goes to w3c.org... And I wonder if it cause some problems if I delete
      <xs:import namespace="http://www.w3.org/XML/1998/namespace"
            schemaLocation="http://www.w3.org/2001/xml.xsd" />

  • There are some strange problems when i used swc files in my as3 project

    Hello everyone,
            My development environment:  fdk4.0,  flash cs5.5,  I publish fla file by using flash cs5.5,   publish setting is  fp version :10.0&10.1 ->swc. I imported swc files to my as3 project and  complied them by using flex sdk4.0. When i run my project,fp was crash.   when i republished on fp 10.2, the project works. Is there any reason?
            another strange problem, for example   a MovieClip's aslink named "A" in swc, it has a textfield named "subText".  I write code like below:
                            var mc:A = new A();
                            mc.subText.text = "test";  
             when mc called "subText" , fp throws null property error, it can't find  subText..  very small number of movieclips have this problem,  I sloved this by duplicating a new one and rename it.
             but i don't  know why ? 
              thank you for your reply.

    I should have figured that out from your original post. I think there is a possibility that your bookmarks/history database (places.sqlite) has a corrupted record. Rather than take drastic action on that immediately, could you do a test? The test is to exit Firefox, rename your existing database, and restart Firefox. Firefox should import your last bookmarks backup. You then could check whether the problem remains or whether you got a clean restore of bookmarks. After the test, assuming you prefer to retain your history, you could undo the procedure and try restoring your bookmark backup into the database to see whether that overwrites the problem record. If not, then we would go back to possible drastic action.
    '''Test procedure''':
    Open your current Firefox settings (AKA Firefox profile) folder using
    Help > Troubleshooting Information > "Show Folder" button
    Switch back to Firefox and Exit
    Pause while Firefox finishes its cleanup, then rename '''places.sqlite''' to something like places_20130614.sqlite. Keep this window open.
    Restart Firefox. By design, Firefox should import your last automatic bookmark backup.
    If you return to the Library dialog, how does it look?
    '''To reverse the test''' (but preserve a backup of your history/bookmark database):
    Exit Firefox
    Delete the newly created places.sqlite file
    Right-click copy and paste the places_20130614.sqlite and rename the copy to places.sqlite
    Restart Firefox and open the Library dialog. Should look like it did a few minutes ago before any changes.
    ''If the test showed no corruption,'' try to restore your last bookmarks backup. The procedure is described in this article: [[Restore bookmarks from backup or move them to another computer]].
    Does any of that get us closer to a solution?

  • Problem when loading xml file using sql loader

    I am trying to load data into table test_xml (xmldata XMLType)
    i have an xml file and i want whole file to be loaded into a single column
    when i use the following control file and executed from command prompt as follows
    sqlldr $1@$TWO_TASK control=$XXTOP/bin/LOAD_XML.ctl direct=true;:
    LOAD DATA
    INFILE *
    TRUNCATE INTO TABLE test_xml
    xmltype(xmldata)
    FIELDS
    ext_fname filler char(100),
    xmldata LOBFILE (ext_fname) TERMINATED BY EOF
    BEGIN DATA
    /u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml
    the file is being loaded into table perfectly.
    unfortunatley i cant hardcode file name as file name will be changed dynamically.
    so i removed the block
    BEGIN DATA
    /u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml
    from control file and tried to execute by giving file path from command line as follows
    sqlldr $1@$TWO_TASK control=$XXTOP/bin/LOAD_XML.ctl data=/u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml direct=true;
    but strangely it's trying to load each line of xml file into table instead of whole file
    Please find the log of the program with error
    Loading of XML through SQL*Loader Starts
    SQL*Loader-502: unable to open data file '<?xml version="1.0"?>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '<Root>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '<ScriptFileType>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '<Type>Forms</Type>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '</ScriptFileType>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '<ScriptFileType>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '<Type>PLL</Type>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '</ScriptFileType>' for field XMLDATA table TEST_XML
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    SQL*Loader-502: unable to open data file '<ScriptFileType>' for field XMLDATA table TEST_XML
    please help me how can i load full xml into single column using command line without hardcoding in control file
    Edited by: 907010 on Jan 10, 2012 2:24 AM

    but strangely it's trying to load each line of xml file into table instead of whole fileNothing strange, the data parameter specifies the file containing the data to load.
    If you use the XML filename here, the control file will try to interpret each line of the XML as being separate file paths.
    The traditional approach to this is to have the filename stored in another file, say filelist.txt and use, for example :
    echo "/u01/APPL/apps/apps_st/appl/xxtop/12.0.0/bin/file.xml" > filelist.txt
    sqlldr $1@$TWO_TASK control=$XXTOP/bin/LOAD_XML.ctl data=filelist.txt direct=true;

  • Strange problem when importing Ai file to PS

    Hello everyone,
    I'm having a strange problem with a banner picture of mines when inporting an Illustrator file to Photoshop.
    I made some clouds in Ai using this wonderful tutorial I found on these forums, and it has a really great haze effect.
    The problem is that that haze effect gets ruined when I import this Ai file to photoshop, and it turns out super jagged and loses its visual effect.
    I was doing this project for an online competition for making a banner, so its too late to fix now because of deadlines (this caused me to finish the whole thing in Illustrator), but I need to know for the future what the problem was.
    I had a Roughen Illustrator filter on as a part of the cloud, which is the only thing that makes sense to me, but is there a way to rasterize my Ai file without the white boxes and import it to Photoshop or anything I can do that won't ruin it?
    Is it because it is an effect from Ai that it won't work in PS?
    Any help is greatly appreciated and I am currently using Ai and PS CS6, and my experience with the program is currently learning steadily as a student in school.
    (I will update this question with pictures of my problem specifically when I figure out how and when I get the time to do so if necessary.)
    Edit: Here are the pictures of my problem. On the top is in Ai, how it is supposed to look, and to the bottom is how it turns out in Ps for some reason.

    I noticed that when you scrub the timeline in the .fla you
    get a different result then if you run the movie..... how can that
    be?

  • Xslt ecc6  ISO-8859-1 problem when download xml file

    Hello,
    i create an ABAP test program:
    *& Report Z_ABAP_TO_XML                                             *
    *& Write the data from an internal ABAP table into an XML document, *
    *& and write it onto your frontend computer                         *
    REPORT z_abap_to_xml.
    TYPE-POOLS: abap.
    CONSTANTS gs_file TYPE string VALUE 'C:\Users\Marco Consultant\Desktop\test.xml'.
    * This is the structure for the data to go into the XML file
    TYPES: BEGIN OF ts_person,
      cust_id(4)    TYPE n,
      firstname(20) TYPE c,
      lastname(20)  TYPE c,
    END OF ts_person.
    * Table for the XML content
    DATA: gt_itab        TYPE STANDARD TABLE OF char2048.
    * Table and work area for the data to fill the XML file with
    DATA: gt_person      TYPE STANDARD TABLE OF ts_person,
          gs_person      TYPE ts_person.
    * Source table that contains references
    * of the internal tables that go into the XML file
    DATA: gt_source_itab TYPE abap_trans_srcbind_tab,
          gs_source_wa   TYPE abap_trans_resbind.
    * For error handling
    DATA: gs_rif_ex      TYPE REF TO cx_root,
          gs_var_text    TYPE string.
    * Fill the internal table
    gs_person-cust_id   = '3'.
    gs_person-firstname = 'Bill'.
    gs_person-lastname  = 'Gates'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '4'.
    gs_person-firstname = 'Frodo'.
    gs_person-lastname  = 'Baggins'.
    APPEND gs_person TO gt_person.
    * Fill the source table with a reference to the data table.
    * Within the XSLT stylesheet, the data table can be accessed with
    * "IPERSON".
    GET REFERENCE OF gt_person INTO gs_source_wa-value.
    gs_source_wa-name = 'IPERSON'.
    APPEND gs_source_wa TO gt_source_itab.
    * Perform the XSLT stylesheet
    TRY.
        CALL TRANSFORMATION z_abap_to_xml
        SOURCE (gt_source_itab)
        RESULT XML gt_itab.
      CATCH cx_root INTO gs_rif_ex.
        gs_var_text = gs_rif_ex->get_text( ).
        gs_var_text = gs_rif_ex->get_text( ).
        MESSAGE gs_var_text TYPE 'E'.
    ENDTRY.
    * Download the XML file to your client
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
        filename                = gs_file
      CHANGING
        data_tab                = gt_itab
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        not_supported_by_gui    = 22
        error_no_gui            = 23
        OTHERS                  = 24.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    and i created XSLT test conversion:
    <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      <xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/>
      <xsl:strip-space elements="*"/>
      <xsl:template match="/">
        <CUSTOMERS>
          <xsl:apply-templates select="//IPERSON/item"/>
        </CUSTOMERS>
      </xsl:template>
      <xsl:template match="IPERSON/item">
        <item>
          <customer_id>
            <xsl:value-of select="CUST_ID"/>
          </customer_id>
          <first_name>
            <xsl:value-of select="FIRSTNAME"/>
          </first_name>
          <last_name>
            <xsl:value-of select="LASTNAME"/>
          </last_name>
        </item>
      </xsl:template>
    </xsl:transform>
    Seem all correct infact the program download  a file XML but the file have the encoding="UTF-16" also if i have specified "iso-8859-1" and if i tried to opend the xml file the file appears not correct because is generated with as first character "#", why?
    Below the xml generated..
    What i have to do to generate a correct XML without errors?
    #<?xml version="1.0" encoding="utf-16"?>
    <CUSTOMERS>
      <item>
        <customer_id>0003</customer_id>
        <first_name>Bill</first_name>
        <last_name>Gates</last_name>
      </item>
      <item>
        <customer_id>0004</customer_id>
        <first_name>Frodo</first_name>
        <last_name>Baggins</last_name>
      </item>
    </CUSTOMERS>

    hello all!
    i resolve the problem using:
    * Perform the XSLT stylesheet
      g_ixml = cl_ixml=>create( ).
      g_stream_factory = g_ixml->CREATE_STREAM_FACTORY( ).
      g_encoding = g_ixml->create_encoding( character_set = 'utf-16' "unicode
        byte_order = 0 ).
      resstream = g_stream_factory->CREATE_OSTREAM_ITABLE( table = gt_xml_itab ).
      call method resstream->set_encoding
        exporting encoding = g_encoding.
    I think it's the right way, i put all my ABAP program updated:
    *& Report Z_ABAP_TO_XML                                             *
    *& Write the data from an internal ABAP table into an XML document, *
    *& and write it onto your frontend computer                         *
    REPORT z_abap_to_xml.
    TYPE-POOLS: abap.
    CONSTANTS gs_file TYPE string VALUE 'C:UsersMarco ConsultantDesktop     est.xml'.
    data:  g_ixml type ref to if_ixml.
    data:  g_stream_factory type ref to IF_IXML_STREAM_FACTORY.
    data:  resstream type ref to if_ixml_ostream.
    data:  g_encoding type ref to if_ixml_encoding.
    * This is the structure for the data to go into the XML file
    TYPES: BEGIN OF ts_person,
      cust_id(4)    TYPE n,
      firstname(20) TYPE c,
      lastname(20)  TYPE c,
    END OF ts_person.
    * Table for the XML content
    DATA: gt_xml_itab        TYPE STANDARD TABLE OF char2048.
    * Table and work area for the data to fill the XML file with
    DATA: gt_person      TYPE STANDARD TABLE OF ts_person,
          gs_person      TYPE ts_person.
    * Source table that contains references
    * of the internal tables that go into the XML file
    DATA: gt_source_itab TYPE abap_trans_srcbind_tab,
          gs_source_wa   TYPE abap_trans_resbind.
    * For error handling
    DATA: gs_rif_ex      TYPE REF TO cx_root,
          gs_var_text    TYPE string.
    * Fill the internal table
    gs_person-cust_id   = '3'.
    gs_person-firstname = 'Bill'.
    gs_person-lastname  = 'Gates'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '4'.
    gs_person-firstname = 'Frodo'.
    gs_person-lastname  = 'Baggins'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '5'.
    gs_person-firstname = 'Frodo'.
    gs_person-lastname  = 'Baggins'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '6'.
    gs_person-firstname = 'Frodo'.
    gs_person-lastname  = 'Baggins'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '7'.
    gs_person-firstname = 'Frodo'.
    gs_person-lastname  = 'Baggins'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '8'.
    gs_person-firstname = 'Frodo'.
    gs_person-lastname  = 'Baggins'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '9'.
    gs_person-firstname = 'Frodo'.
    gs_person-lastname  = 'Baggins'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '10'.
    gs_person-firstname = 'Frodo'.
    gs_person-lastname  = 'Baggins'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '11'.
    gs_person-firstname = 'Frodoèé'.
    gs_person-lastname  = 'Baggins~¦Üu0192'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '11'.
    gs_person-firstname = 'Frodoèé'.
    gs_person-lastname  = 'Baggins~¦Üu0192'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '11'.
    gs_person-firstname = 'Frodoèé'.
    gs_person-lastname  = 'Baggins~¦Üu0192'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '11'.
    gs_person-firstname = 'Frodoèé'.
    gs_person-lastname  = 'Baggins~¦Üu0192'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '11'.
    gs_person-firstname = 'Frodoèé'.
    gs_person-lastname  = 'Baggins~¦Üu0192'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '11'.
    gs_person-firstname = 'Frodoèé'.
    gs_person-lastname  = 'Baggins~¦Üu0192'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '11'.
    gs_person-firstname = 'Frodoèé'.
    gs_person-lastname  = 'Baggins~¦Üu0192'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '11'.
    gs_person-firstname = 'Frodoèé'.
    gs_person-lastname  = 'Baggins~¦Üu0192'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '11'.
    gs_person-firstname = 'Frodoèé'.
    gs_person-lastname  = 'Baggins~¦Üu0192'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '11'.
    gs_person-firstname = 'Frodoèé'.
    gs_person-lastname  = 'Baggins~¦Üu0192'.
    APPEND gs_person TO gt_person.
    gs_person-cust_id   = '88'.
    gs_person-firstname = 'Frodoèé'.
    gs_person-lastname  = 'Baggins~¦Üu0192'.
    APPEND gs_person TO gt_person.
    * Fill the source table with a reference to the data table.
    * Within the XSLT stylesheet, the data table can be accessed with
    * "IPERSON".
    GET REFERENCE OF gt_person INTO gs_source_wa-value.
    gs_source_wa-name = 'IPERSON'.
    APPEND gs_source_wa TO gt_source_itab.
    * Perform the XSLT stylesheet
      g_ixml = cl_ixml=>create( ).
      g_stream_factory = g_ixml->CREATE_STREAM_FACTORY( ).
      g_encoding = g_ixml->create_encoding( character_set = 'utf-16' "unicode
        byte_order = 0 ).
      resstream = g_stream_factory->CREATE_OSTREAM_ITABLE( table = gt_xml_itab ).
      call method resstream->set_encoding
        exporting encoding = g_encoding.
    TRY.
        CALL TRANSFORMATION z_abap_to_xml
        SOURCE (gt_source_itab)
        RESULT XML gt_xml_itab.
      CATCH cx_root INTO gs_rif_ex.
        gs_var_text = gs_rif_ex->get_text( ).
        gs_var_text = gs_rif_ex->get_text( ).
        MESSAGE gs_var_text TYPE 'E'.
    ENDTRY.
    * Download the XML file to your client
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
        filename                = gs_file
        FILETYPE                  = 'BIN'
      CHANGING
        data_tab                = gt_xml_itab
      EXCEPTIONS
        file_write_error        = 1
        no_batch                = 2
        gui_refuse_filetransfer = 3
        invalid_type            = 4
        no_authority            = 5
        unknown_error           = 6
        header_not_allowed      = 7
        separator_not_allowed   = 8
        filesize_not_allowed    = 9
        header_too_long         = 10
        dp_error_create         = 11
        dp_error_send           = 12
        dp_error_write          = 13
        unknown_dp_error        = 14
        access_denied           = 15
        dp_out_of_memory        = 16
        disk_full               = 17
        dp_timeout              = 18
        file_not_found          = 19
        dataprovider_exception  = 20
        control_flush_error     = 21
        not_supported_by_gui    = 22
        error_no_gui            = 23
        OTHERS                  = 24.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    *-- we don't need the stream any more, so let's close it...
    CALL METHOD resstream->CLOSE( ).
    CLEAR resstream.

  • A strange problem when uploading a file in Struts

    When i upload a file, the other elements in the form of the jsp cannot be got by the ActionForm, instead, the getters show that they are "null"s. But when i upload no file, everthing is ok.
    Moreover, the problem happens when i update an article which can have an picture with it, but when i add a new article, the problem does not appear, instead, the file can be uploaded and other element can also be got.
    i think i might be a problem of the volume of the request , because i put more information to update than to add.
    Hope someboby can help me with the problem.

    When i upload a file, the other elements in the form of the jsp cannot be got by the ActionForm, instead, the getters show that they are "null"s. But when i upload no file, everthing is ok.
    Moreover, the problem happens when i update an article which can have an picture with it, but when i add a new article, the problem does not appear, instead, the file can be uploaded and other element can also be got.
    i think i might be a problem of the volume of the request , because i put more information to update than to add.
    Hope someboby can help me with the problem.

  • Short code causes a strange problem - About the list again -- please read!

    Hi again people. Maybe you remember my project - has a list, that you can search thru using a text field. During the work I got stuck on a strange problem ( Again :-( ) My app has one text field, one combo box, one list and a text field once more. The code should do the following ->
    *1. Load the list, no problem with that.*
    *2. Show the elements of the list, that match the selected group in the combo box,no problem.*
    *3. Search thru the list using the text field,no problem.*
    4. When the user selects an element from the list, it should display its info in the second text field. This also works fine, but when after looking at info of one of the elements the things on numbers 2 and 3 ( look up! ) stop working. I must say that everything works fine until user selects an element from the list. I couldnt understand this kind of behavior so I am asking you to help me please.
    The code is very simple:
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    class the_window extends JFrame implements DocumentListener, ItemListener, ListSelectionListener {
        FileReader reader;
        String data_base[][];
        String first_pass[];
        int number_of_elements;
        DefaultListModel dflm = new DefaultListModel();
        JList list;
        JTextField text_field = new JTextField();
        JTextField info_field = new JTextField();
        String groups[] = {"1. group" , "2. group"};
        JComboBox groups_cmbx = new JComboBox(groups);
        the_window(){
            super("the Window!");
            JPanel panel = new JPanel(null);
            Container c = this.getContentPane();
            c.add(panel);
            text_field.setBounds(10,10,170,25);
            text_field.getDocument().addDocumentListener(this);
            panel.add(text_field);
            groups_cmbx.setBounds(10,45,170,25);
            groups_cmbx.addItemListener(this);
            panel.add(groups_cmbx);
            list = new JList(dflm);
            list.setBounds(10,90,170,190);
            list.setFixedCellHeight(20);
            list.addListSelectionListener(this);
            panel.add(list);
            info_field.setBounds(10,280,170,25);
            panel.add(info_field);
            load_the_base();
            refresh();
            this.setSize(190,350);
            this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            this.setResizable(false);
            this.setVisible(true);
        public void itemStateChanged(ItemEvent e){
            refresh();
        public void valueChanged(ListSelectionEvent e){
            String str = (String) dflm.getElementAt(list.getSelectedIndex());
            int index = 0;
            for(int i = 0; i < number_of_elements; i++){
                if(str.equals(data_base[0])){
    index = i;
    break;
    info_field.setText(data_base[index][1]);
    private void load_the_base(){
    String data = "";
    try{
    reader = new FileReader("data.txt";);
    int r = 0;
    while((r = reader.read()) != -1){
    char c = (char) r;
    data += c;
    reader.close();
    }catch(IOException e){}
    first_pass = data.split(";");
    number_of_elements = first_pass.length;
    data_base = new String[number_of_elements][];
    for(int i = 0; i<number_of_elements; i++){
    data_base[i] = first_pass[i].split("#");
    private void refresh(){
    String search_str = text_field.getText();
    int selektovano = groups_cmbx.getSelectedIndex();
    dflm.clear();
    for(int i = 0; i < number_of_elements; i++){
    int grupa = Integer.parseInt(data_base[i][2]);
    if(grupa == selektovano){
    String at_the_moment = data_base[i][0]; // if you change this to String at_the_moment = data_base[i][1]; it works perfectly
    if(at_the_moment.startsWith(search_str)){
    dflm.addElement(at_the_moment);
    public void changedUpdate(DocumentEvent e){
    refresh();
    public void removeUpdate(DocumentEvent e){
    refresh();
    public void insertUpdate(DocumentEvent e){
    refresh();
    public class Main {
    public static void main(String[] args) {
    JFrame f = new the_window();
    Now, can you please tell me whats wrong with this?
    For the "data.txt" make a new text file using *notepad* and copy the following line into the document:
    _1. element#1. info#0;2. element#2. info#0;3. element#3. info#1;4. element#4. info#1;5. element#5. info#1;_                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Darryl.Burke wrote:
    Keith, thanks for making that readable. So here's the diagnosis -
    In the refresh() method, calling defaultListModel.clear() results in a valueChanged(...) event in which this method calldefaultListModel.getElementAt(list.getSelectedIndex())results in the exception noted, as getSelectedIndex returns -1, the list being empty... you can't getElementAt(-1).
    I haven't analyzed all the code nor checked whether is now works as desired, but this small change to valueChanged counters the exception being thrown.   public void valueChanged(ListSelectionEvent e) {
    infoField.setText(""); // do this unconditionally
    if (list.getSelectedIndex() != -1) {
    String value = (String)defaultListModel.getElementAt(list.getSelectedIndex());
    for(int i = 0; i < numFields; i++){
    if(value.equals(matrix[0])){
    infoField.setText(matrix[i][1]);
    break;
    db
    Yea! You were right! I didnt think that calling *list_model.clear();* will result in calling *valueChanged()* ........
    That was some *clear()* thinking :-) Thank you!
    corlettk wrote:
    I cleaned up some variable & method names (tut tut), imports (very naighty), and some thread stuff... but it remains fundamentally the same codeIs it so important to "clean" the imports? How much does it slow down the loading time? Should I do this on all my projects, because they are all "very naighty"?
    ps. Thanks to all that gave some help to answering this strange question :-)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for