Getting the entire DTD  in the output file

Hi All,
I have a program that takes an XML file(has DTD and XML in the same file) as input. After parsing it, the output is written into a specified file. The output has first few lines of the DTD and the entire XML part, but is not having the ELEMENT and ATTLIST lines of the DTD.
My code runs like this:
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setValidating(true);
DocumentBuilder db = dbf.newDocumentBuilder();
Document doc = db.newDocument();
db.setErrorHandler(new CustomErrorHandler());
doc = db.parse(inFile);
XmlDocumentxDoc = (XmlDocument) doc;
xDoc.write(new PrintWriter(fos));
TIA,
sri

The standard parsers don't seem to do a very good job with DTDs. I've used a package at
http://www.wutka.com/dtdparser.html
to build DTDs. I haven't found a better way to get an internal DTD into an XML document than to separately convert both to String and manually insert the DTD (with appropriate DOCTYPE, etc.) into the XML.

Similar Messages

  • How to get the Output File Name as One of the Field Value From Payload

    Hi All,
    I want to get the Output file name as one of the Field value from payload.
    Example:
    Source XML
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_TEST xmlns:ns0="http://sample.com">
    - <Header>
      <NAME>Bopanna</NAME>
      </Header>
      </ns0:MT_TEST>
    I want to get the Output file name as " Bopanna.xml"
    Please suggest me on this.
    Regards
    Bopanna

    Hi,
    There are couple of links already available for this. Just for info see the below details,
    The Output file name could be used from the field value of payload. For this you need to use the UDF DynamicFile name with below code,
    //       Description: Function to create dynamic Filename
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    conf.put(key,a);
    return "";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
    conf.put(key,a);
    return "";
    With this udf map it with the MessageType as
    (File Name field from Payload) > DynamicFileConfiguration>MTReceiver
    Thanks
    Swarup

  • How to get required tags and name spaces in the output File?

    Hello,
    I am doing IDOC to File sceanrio and I am able to get the file but the problem is that I am unable to get the required tag names. Out put file is having  ns0 ns1 and so on..
    Eg:
    ns2:MaterialDefinitionProperty><ns2:MaterialDefinitionProperty><ns2:ID>CU_NET_WEIGHT</ns2:ID></ns2:MaterialDefinitionProperty><ns2:MaterialDefinitionProperty><ns2:ID>EAN_SKU</ns2:ID></ns2:MaterialDefinitionProperty><ns2:MaterialDefinitionProperty><ns2:ID>CUPerCase</ns2:ID>
    and so on..
    Source structure is IDOC
    Target structure is External Defination imported with references.
    How can I get the output file with the exact namespaces and tags as imported through External Definations.
    Thanks in Advace.

    HI! Rajeev,
    I have gone through this forum and we having 100% same to same requirement here in my project.
    We want this at the top of the Output Payload..
    <?xml version="1.0" encoding="UTF-8" ?>
    - <SyncMaterialDefinition xmlns="http://www.siemens.com/ad/mes/b2mt-1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:bml="http://www.wbf.org/xml/b2mml-v02" xmlns:sit="http://www.siemens.com/ad/mes/b2mml-v02-SITExt-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oag="http://www.openapplications.org/oagis">
    - <oag:ApplicationArea>
    and also isome part of payload nstead of    ns0:  and ns1:
    we want it as below for some part of same output payload
    <oag:ApplicationArea>
    - <oag:Sender>
      <oag:LogicalId>SAP</oag:LogicalId>
      <oag:Component>PMConnector</oag:Component>
      <oag:ReferenceId />
      <oag:Confirmation>Always</oag:Confirmation>
      </oag:Sender>
      <oag:CreationDateTime>2009-06-14T22:23:29.42Z</oag:CreationDateTime>
    </bml:MaterialDefinitionProperty>
    - <bml:MaterialDefinitionProperty>
      <bml:ID>XXXXXXX</bml:ID>
    - <bml:Value>
      <bml:ValueString>0.0</bml:ValueString>
      <bml:DataType>string</bml:DataType>
      <bml:UnitOfMeasure>n/a</bml:UnitOfMeasure>
      <bml:Any />
      *</bml:*Value>
    Check the above code how we want but we are getting in normal way .
    Could you please review this and guide me in detailed way how to do in a step by step manner if possible by taking my above payload condition.
    Regards:
    Amar Srinivas Eli

  • How to get the output of a procedure in to a log file ?

    Hi, Everyone,
    Could you please tell me
    How do i write the output of a procedure to a log file ?
    Thanks in advance...

    Hi,
    could you please explain me more on how to use the UTL_file to get the output to a log file as in am new to PL/SQL
    my script file is
    EXEC pac_sav_cat_rfv.pro_cardbase (200910,'aaa',100,'test_tbl');
    i need the output of this statement in a log file.
    Could you please explain to me how it can be done.
    thanks in advance

  • NOOB Question - Cannot seem to get the output in a text or CSV file - Please help!!

    I was able to put together a script which finds members of a certain AD group, filters down the users, and then calculates the number of days till a password reset is needed.  I am able to get on screen exactly what i am looking for, but cannot seem
    to figure out how to get the same data to a file.  What i am doing wrong?  two goals here:
    1.  Create a spreadsheet with a list of users whose password is about to expire.
    2.  Down the line automate an email to users whose password is about to expire. 
    Here is my code:
    ## Get List Of Users in Password Change Lockout that do not have an expired password or a password that never expires
    $Names = (Get-ADGroupMember -Identity "Password Change Lockout" -Recursive |`
    Get-ADUser -Properties * |`
    Where-Object {$_.PasswordNeverExpires -eq $False -and $_.PasswordExpired -eq $False} |`
    Sort-Object name |Select-Object -ExpandProperty SamAccountName)
    ## Get Password last Set values for all
    Foreach ($Name in $Names)
    $VAR1 = (Get-ADUserResultantPasswordPolicy -Identity $Name).MaxPasswordAge
    $VAR2 = (Get-ADUser $Name -Properties *).passwordlastset
    $VAR3 = (Get-ADUser $Name -Properties *).name
    $DTPC = (New-TimeSpan -Start (Get-Date) -End ($VAR2 + $VAR1) | Select-Object -ExpandProperty Days)
    Filter users to those who need to change thier password in 15 days.
    If ($DTPC -lt 15)
    No matter what i try between the {} after the If statement, I cannot get the output to a file.  However, if I use a Write-Output I get exactly what i looking for.  I feel like i am forgetting some basic concept and could really use some help.  Thanks.
    Matt 
    Matt Dillon

    Hi Matt,
    I generally create an empty array (something like $out = @()) at the top of the script and then use $out += $desiredOutput inside of the foreach loop.
    Outside of the loop, you can then pipe $out to Out-File or Export-Csv, depending on your needs.
    Don't retire TechNet! -
    (Don't give up yet - 12,830+ strong and growing)

  • How to get the output .pdf file of a quiz to report to the quiz results analyzer on my internal server (mamp)

    I created a quiz.
    Created an internal server on my compute rising a MAMP.
    When I publish my quiz using the multi-file publishing options...
    I am able to use both the "HTML" and the "swf" output files to complete a quiz and reporting the results to the quiz results analyzer.
    However, I am unable to get the output .pdf field to reporting to the quiz results analyzer.
    Any help? Would this issue have to do with the Acrobat Professional setting? Captivate setting? My internal server setting? or output fuel placement?
    I tired to put the .pdf file in the same MAMP root folder location as my "internalserverreporting.php and internalserverread.php files.
    Thanks for the help.

    Hello Varun,
    You cqan submit the report as a JOB and export the out put to memory, once the job is complete you can read the list to display the output.
    Cheers,
    Mano
    Cut & Paste form SAP help.
    Submit report ....
    EXPORTING LIST TO MEMORY
    Does not display the output list of the called report, but saves it in ABAP memory and leaves the called report immediately. Since the calling program can read the list from memory and process it further, you need to use the addition ... AND RETURN . Also, since the called report cannot be requested for printing, the addition ... TO SAP-SPOOL is not allowed here. In addition, you must not assign a function code to the ENTER key in the current GUI status. The saved list is read from the SAP memory using the function module 'LIST_FROM_MEMORY' and can then be saved to the database using EXPORT, for example. You can process this list further with the function modules 'WRITE_LIST', 'DISPLAY_LIST' ... of the function group "SLST".

  • Getting junk data in the output file in UNIX server due to UNICODE error.

    Hi All,
    I am working on an Upgradation project from 4.7 to mySAP ERP 2005.
    IN 4.7 we are using
    OPEN DATASET lv_filename FOR OUTPUT IN   BINARY MODE. and getting the file as required.
    In ECC 6.0 for the same OPEN DATASET statement ,the output file in unix server has the junk data having the characters like #<##d9{y#+G9###T>j(##^# #K## #q### #####.
    Pls help me in this issue to proceed further .
    Thanks,
    Chakradhar.

    Hi Markus,
    Below are the files data in both environments.
    In ECC 6.0
    001B2274001802007051                                 0  20070519CTLMEA      RPTIME00043900 #
    ###9##;c_5####Tj#y#.##'###u###<#<##d9{y#+##G9###T>j(###^###K####q##########C##dA4####&#1393;###x##
    R[#!#J##&#1698;w###u#-C#'Qho#&#31632;}j##w%##/#'ZhW##s###n&#1080;#&#1723;>-J#####&#1046;#tP}##Hu#}Q7###Sh_###C4<3nqk##i l#
    ####{############Qns###;####p##{si##y##@##&#1008;0####C###,###2&#973;#j&#830;########Q#f####;)k>lO#5#n###&#1852;#
    ####M##S##IM#z0#o##&#1325;####!#V#9###&#1722;#?s##[#####V&#&#756;s#&#56196;&#56590;[#l#s##&#48610;:#&#1334;{&#548;&#55960;&#57086;M-##v@#########v#&#2034;###s##
    9Q##!#d#####`#############Lc####J#######%?######E#HV3#(#N####Wl####}S#O######zA[##m####u/7#T
    ##2#s##Q#umF]##Z###}##&#1858;###a######z1#`#####&#46110;-###Q#o#####Q###x#######7Z[##?#V#e##nI####O1=u[#
    ##p##Kj#####]#####/5#20{####&#1244;##x##A#?###xa##/<^#Rj&#16741;#######xI#+j#%###$##$######p=##V#&#1290;
    #######k#K##yI#yI#!/)#y#z##-y######"/#e&#1717;##/############*###"/_##-##+##/#y9#####5#9/#yI#A#
    ###################J/yih=####u4i#K##t####&#1822;######=##AX###J##z#####KC&#48084;## /###G{#K#####
    In 4.7
    001B2274001802007051                                 0  20070519CTLMEA      RPTIME00043900
    ãÔ?®zåÖ#Iï-_Î-ør7##*Ódöã ²äÐÁSjòä`ëÏ©"yÿï¾E#[µºEW#g#2éu##a±¸u~#ZäTéR¯F&o#C·¼åÈÝÁ%½ß´y6+##¿
    íE#z!#â#ùG#>{#éJæ##jÅSM<±òxwÆüI¾jâ#µ#ù
    íQ ÕÈ###dÝ#/«#ycãA¼#ø#7#¿#¼#íxãý#y«#o#â¡ùéËÖ_C¼½À4ðÀó#Ð8?qÊ#O½Î¿_##b#xjÛÓ#OÜ#×gÌ#×ós##
    í¡ùh¿~ëÊÓü#ò#'¡#Á#â©#<áoú#'Ô®ü#»L»þ#y)hà#ç#Z[¡#'®Uy1?YC<Ýú#iÇÇ###Íç'Ô#§#Ù#O§#f<###B{#§##ñ
    #0H}¬#^##6¨7V¨7VÚX#M9&#A#øG º'õxOù§ø #W¨Å+Ðb#ÉÇ7#SôRXß\u00A7à#wE"#mê#óÀd# ¼##gn###:ô#E<#######ú
    ûJ¦H}#·¦Y½â>ºbò#xSSÿÿÕ«óG#ï#6²f´Ú¾fyqèhJÖçCOr´#Ý#S?##KËÄ×mâë¶x)º×ªh2Åw8&í####7 `Ùo#ö»#òöw$
    ½##Gê#ì#»#La)ì##Ý÷#{7í´éã»##ãî]¾[##{O#¾C##£¶G#û¼Eû#dL#ª:#PÉEÉ>Ó##ª:G#éaR^·BEµÏ+¹###y#N##ȱ
    DÕ##5#"9Ní>#íFo##kp#ÂðÆè5¿ð½F®¯M##þð1#îi##Z #Z #Z#ô-¾#§èH»û¹ö9é#Ôä#001B2274001802007051
    èÁ##<(#ÿ#¢²ÿ#è#éc#z¾vçÌá#¹#ý#x%ìÜ#çÌ##ùÍÙ#¹{ǯepmâí#¸Ö##¸=ÝÙ½¹uë·,ù#þ¼øl###£åg#,##-`q#ÿøæï
    viÁ#]3#.O#þÊöèR##=##L#LÊk###¤à##ó#'V052 øé]+####ã!ÁC#s#q###åLj##Á¯Æ4#.àíT#¸Þ¹µ·¶É)ç#Ïå#<#/ð
    Thanks,
    Chakradhar.

  • Are You All Able to get the Output In EXCEL Format

    Hi All,
    I have one question. Are You All Able to get the Output In EXCEL Format?? I am working on Oracle Apllication 11.5.10.2 and my XML builder is 5.0.1. Problem which i m facing is this...... Whenever i am submitting a concurrent program with format type different from PDF i could not able to view the ouput in desired format. When i am pressing view output it gives me a file in XML and when i save that file with extention 'xls' or 'rtf' then i could able to see the saved file in desired format.
    Can anyone tell me where is the problem??? Is it a bug?
    I am using microsoft world 2000 sp-3.
    Please give your valuable comments. May be your comments can solve my problem..
    Thanks
    Ravi

    Hi I got Same issue
    When I change Format to EXCEL from
    Submit request>> Option>> Format = EXCEL
    In window I am getting something HTML code and
    when I try to copy it to Browser from Tools>> Copy File in to Browser I am getting following message
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    End tag 'p' does not match the start tag 'a'. Error processing resource 'http://our url.com:8000/OA_CGI...
    <p class="c0"><a name="Text4" id="Text4"><a name="Text1_1" id="Text1_1"><span class="c1">Dept No <...
    But I can see the output when Format is PDF
    Pls suggest solution ,I am using EBS 11.5.10.2.
    Thanks
    Rahul
    Message was edited by: Rahul
    user576181

  • How to get the output path in Java?

    Hi all,
    is there a way (method) to get the output path (where compiled classes are put) in Java?
    thx a lot!
    Michele

    If you have already successfully loaded the classes into memory, and you want to find out where the classes are physically stored, then you can use Class.getResource() to retrieve the location of the file.
    import java.net.URL;
    public class Find
      private void run(String obj) {
        try {             
          Class cls = Class.forName(obj);
          //Here is the change to input correct resource path
          //instead of class name 
          String resourcePath = "/"+obj.replace('.','/')+".class";
          URL url = cls.getResource(resourcePath);
          System.out.println(url);
        catch (Exception e) {
          e.printStackTrace();
      public static void main(String[] args) {
        Find find = new Find();
        find.run(args[0]);   
    }java Find java.lang.String
    jar:file:/usr/local/j2sdk1.4.2_13/jre/lib/rt.jar!/java/lang/String.class
    Edited by: Jin on Oct 23, 2007 10:38 AM

  • Why is the output file jerky ?

    Hi there,
    I have AE CS5 on my Mac. My system is 27" iMac core i5 with 12 GB RAM DDR3 1333 MHz with quad core.
    I rendered a 40 seconds clip with an earth spinning.
    I output it to mov format in 1920 x 1080.
    When I did a RAM preview, it was fine & the earth was spinning smoothly.
    But the output file (in mov) - (I did thru Composition > Make movie) when I play using QuickTime player is jerky at 20th Sec to 29th sec.
    I then import this mov file into Final Cut, it look stuck in the Viewer but was perfect on the Canvas.
    When I render in Final Cut, the output file as mov and use the same Quick Time player to play it & it is perfect.
    Can I know what is the reason that it is not working in Quick Time the first time when it was fresh out from AE ?
    Thank you.
    Cheers

    The default render settings use Quicktime Animation codec at best quality. These files will not playback smoothly because the data rate is too high for the hard drives to keep up with. The animation codec is a lossless codec designed not designed for playback.
    Final Cut uses compressed codecs designed for playback as the default. I'd suggest that you open up the help files (F1) and read the entire section on Rendering and Exporting (link).

  • I have this following problem in Adobe Premiere Elements 11: Error of export: You don't have permissions to create or delete the output file.

    Hey guys,
    I have this following problem:
    When i export my movie to my desktop from premiere elements 11 it fails and says "Error of export: You are not permitted to create or delete the output file."
    This is the first time i had this problem.
    I have no ideas to solve this problem ... I don't found it on this page neither in the whole web -.-
    I look forward to get requests

    S
    QuickTime is a requirement for Premiere Elements (any version). Please download and install it so that we can continue this troubleshooting. Among other things, without QuickTime installed, you will not have QuickTime presets in Publish+Share and will not have available to you codecs supplied by that player.
    Please right click the Premiere Elements 11 desktop icon and apply Run As Administrator. Please review computer permissions..
    In the meanwhile, please reply to all the questions, including
    What is the description for your export choice and does it make a difference if your Export Save In location is the desktop or to Video Folder in Documents?
    What is a description of your computer resources?
    Please consider and supply details need to help us help you.
    We want you to succeed.
    Thank you.
    ATR

  • Input file should be deleted only after the output file is successful.

    Hi Experts,
    Could you pleas solve the below issue.
                           In  a file to file scenario, the input file will be picked from a directory location and after processing output file will be placed in the output directory location specified in the receiver communication channel.
    In the sender communication channel for the scenario mentioned above, if the processing mode is given as delete, the input file will be delete as soon as the file was successfully read by the adapter, but this will not ensure that the file processing is complete and the output file is being created.
    If we have a scenario in such as way that the input file should be deleted from the input folder only if the complete process is successful and the output is generated. how can we achieve this functionality?.
    And one more thing if we got the successful output the output file should be placed in one folder. and the if the output file is having errors it should be placed in other folder.

    Hi,
    In Receiver communication channel I have used the below command in Run Operating System
    .And I have kept the processing mode of sender communication channel as test.
    cmd.exe: /C "del /Leela/test.xml"
    You are running the comman line program configured in the receiver File Adapter,but in command line you mentioned the Sender File Folder , So i guess it's not getting processed.
    Try this:
    Try to run the command line in the Sender File Adapter Side
    "Place this in " --> Run OS Command After Message Processing.
    Hope this would work and get in parrallel with u r requirement.
    regards
    Srini

  • IDOC to XML : error in opening the output file in iexplorer

    Hi Frnds,
    I have a scenario IDoc to xml where in Im getting some non ascii values in the idoc for which I used ISO-8859-1 encoding technique but still the conversion is not done. Iam unable to opend the output file in internet explorer giving the follwoing error as :
    An invalid character was found in text content. Error processing resource
    Please help me how to overcome this issue.
    Thanks in advance,

    Hi,
    As i posted previously in xi UTF-8 is the default encoding if message protocal is FILE.
    And UTF-8 encoding support unicodes..
    Can reconfigure your receiver file adapter with file type as Binary and check once again.
    go through http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm  
    refer  File Type
    now i check with a japanese double byte character and i can open in iexplorer.
    regards,
    pradeep A.

  • Header Name in the output file using content conversion

    Dear All,
    I want to have a text file with a header in the output. I have given the following values for content conversion:
    RecordSet structure = Record,Row
    Record.fieldSeparator='nl'
    Row.endSeparator='nl'
    Row.fieldSeparator=','
    Row.addHeaderLine=1
    but still I am not getting header in the output file. Please tell me where I am making a mistake in getting the header.
    Reg,
    NJ

    hi chirag,
    thnx for replying.
    i m getting the required output file without any error but i m not getting header. i hve added "addHeaderLine" parameter in content conversion but still i m not getting header in the output file.
    reg,
    nj

  • Append a file with date and name in the output file

    I am running a script which produce an output in excel file, I would like the server name and the date in the output file,  Both the servername and date has declared at the beginning of the script as 
    $server = test1
    $date = Get-Date -uformat %Y-%m-%d
    I am able to append either server or date but not both. Could you please help me out on this.
    I would like the output file as '
    server_report_date.xls

    I got this working by 
    "C:\Aravind\Scripts\$server-"+"Report-" +"$Date"+".xls"
    Thanks!!

  • Context-sensitive help - where is the CS topic folder in the output files?

    I have created a FlashHelpPro help file in RoboHelp 7 HTML. In the project setup pane, I have Map ID'd my context-sensitive topics and linked them to their respective pages. I generated the project, but there is no folder containing the context-sensitive topics in the output files. As a result, the developer suggested that I need to create a separate folder in the Project Manager that contains all the context-sentitive topics. Is this actually the next step, or can the developer find what he needs elsewhere in the files?
    I haven't seen anything about creating a separate folder in the Project Manager, which seems redundant as there is the 'Context-sensitive Help' folder already present in the Project Set-up. Do I need to create a separate folder, as suggested by the developer? If not, where can he find the context-sensitive files in the output? Thank you.

    Hi,
    What do you mean that the context sensitive topics are not in the output? RoboHelp generates your output and (in WebHelp, so the same should count for FlashHelp) puts the context sensitivity in cshdat_webhelp.htm. Your developer doesn't need to worry about this, he just has to get his call right.
    For information on calling the help, see http://www.grainge.org/pages/authoring/calling_webhelp/calling_webhelp.htm. It's for WebHelp but it should be the same for FlashHelp.
    If your developer only wants to know which mapid's he has to call, you best give them your map files (the .h files).
    Greet,
    Willam
    This e-mail is personal. For our full disclaimer, please visit www.centric.eu/disclaimer.

Maybe you are looking for

  • Need Select  Query

    hi,    Need Select  Query for this... 12.     Check if the document category TVLK-VBTYP = ‘7’ where TVLK-LFART = LIKP-LFART (Delivery Type) then this is and Inbound Delivery for a purchase order. 13.     Check the value of field Shipment External ID#

  • VG224 Ports - No Dial Tone

    Every now and then a customer has a vg224 that the ports will just quit working. No dialtone. The workaround has been to reconfigure a new port and move the device but they will fail again eventually. Whomever set this vg224 up is using a combination

  • Safari won't open my website

    www.whitefieldchurch.com Sent a link to someone with a mac today and they say they can't access my site. It works on my mac and my iphone so anyone got any ideas what's wrong?

  • Need help for ABAP CODE

    hi, i need to reload the master data without FM, i put the comments on fm and relaod the data, now i having a problem, loading process is slow now as compair to before, when i was using with FM.i checked the manage of infoObject, it is show 1123455 r

  • Is it possible to run iTunes playlist from external program?

    I'd like to set up reminders in a planner program so that they open various playlists in iTunes. Is this possible, even though the playlists are buried in the library? I know I can do it with Windows Media Player, but I'd so rather not. Thanks, Sharo