Interfacing StyledDocument and XML

Hello,
I'm trying to make an xml editor, but am stumped on the javax.swing.text.StyledDocument interface. The problem is that DefaultStyledDocument isn't suited to store xml, and HTMLStyledDocument is well, html. What I want is a document class that can easily interface with the myriad of xml technologies out there (e.g. the org.w3c.dom classes)... so I think I need to create my own, as well as an editor kit. [shudder  :-o ]
Has anyone attempted this / seen tutorials / have tips ?
Thanks in advance

The Document model only stores one character ("\n") for each new line entered.
When you do a statement like:
String str = textPane.getText();
The newline characters in the document are replaced with the newline string for the target operating system:
a) for Unix - "\n"
b) for Windows - "\r\n").
Therefore, the length of the String in Windows will always be greater by the number of lines in your Document.
The way I have gotten around this problem is to change the End-Of-Line string that is added when using the getText() by using the following code:
textPane.getDocument().putProperty( DefaultEditorKit.EndOfLineStringProperty, "\n" );
Note: if you ever intend to write the contents of the text pane to a file then your code should be something like:
a) String eol = textPane.getDocument().getProperty( DefaultEditorKit.EndOfLineStringProperty );
b) textPane.getDocument().putProperty( DefaultEditorKit.EndOfLineStringProperty, "\n" );
then before writing to the file you would do:
c) textPane.getDocument().putProperty( DefaultEditorKit.EndOfLineStringProperty, eol );

Similar Messages

  • IDOC to Flat File and XML ( Need both the Output)

    Hi ,
    My Scenario is IDOC to File .
    I need o/p in 2 format . ie,    1) Flat File 2 ) XML file
    I have a plan to go with Interface determination , 2 IM and what shd be the condition ?
    or Else  2 Receiver detmination  but condition ?
    How to slove this ?
    Need the Output from Idoc in 2 format ( Flat file and XML file )
    Any Blog , Thread ...Tips...etc
    Regards,
    Jude

    Hi Jude,
    Do like this:
    1. Create two inbound Service Interface (with the same target Message Type)
    2. Create separate Operation mapping with the above service interfaces as target (with the same source service interface)
    3. Create Interface Determination and include these two operation mapping (without any condition)
    4. Create 2 receiver agreement (with two separate communication channel) for each of the target service Inetrface. In one channel use content conversion and the other one will give you normal XML output
    Regards
    Suraj

  • Call from Java to combine PDF and XML

    What adobe software do I need to combine PDF form template and XML data to produce PDF with XML data embedded.
    Also is there any samples/references available to make a call to the above from a Java program ?
    Any help is deeply appreciated.
    Thanks!
    Priya

    Hi Priya,
    Just curious if you figured out how to generate a PDF out of a template? I've a similar requirement where I transform XML schemas into templates, convert the template into a PDF document, and at run time bind the PDF with the form data.
    To sort of answer your question of how to bind an XML instance file to a form, if that form is an XML-FORM, then all you'd need to do is open that document as a PDF document using the PDFFactory, and invoke the importFormData() method on it, passing the XML instance as the input stream.
    The harder part though is getting the PDF out of the template in the first place, without using any adobe user interface period.
    Karthick

  • Send pdf and xml  to URL on one click

    My scenario is:
    -online Adobe form in ZCI layout with XML based interface created in webdynpro.
    -In webdynpro (form is embedded) Vendor fills out the form with the requested Payment, clicks the button and the form is saved at URL.
    -Then Approver will open PDF from that link, make his change and save it at that URL.
    -Then another Approver will open PDF from that link, make his change and save it at that URL.
    -Finaly Webdynpro program will upload the XML data from that URL into the embedded form and User will initiate sending the form data to SAP.
    I understand that every time the form is saved - it is needs to be saved in both PDF and XML.
    PDF is for the user to make changes on the form.
    XML  is for webdynpro to upload the form data and then send it to SAP.
    In Livecycle Designer there is Submit buttom in Standard library.
    The button has dropdown of Submit As : xdp, pdf, xml.
    So I can select only pdf OR xml - not both.
    How could I send to URL both PDF and XML on one click?
    Thank you ,
    Tatyana.

    From this conversation's thread it appears that Acrobat is not the application / service at issue.
    As this user forum has as its focus "Acrobat" it seems that the OP is in the wrong place.
    Acrobat's one click send feature provides the user a "draft" email. The user still has to process ("click") through steps with the email client/service to actually get the email out and on its way.
    I'm sure that "one click" does everything is available somewhere. Considering all it'd have to do and do right it'd be rather expensive.
    Be well...

  • SOAP and XML infterface to database

    How can I easy get a SOAP interface up and runing for my Sybase database.
    The messages should be in XML format.
    Is the easiest to use Jakata Struts http://jakarta.apache.org/struts/index.html
    Regards
    Lars Schouw

    For SOAP based services you might be intested in looking some of the ASF's other projects.
    Particularly, the Web Services project at http://ws.apache.org/
    I find that Axis is the fastest and easiest way to quickly build a SOAP interface to an application, assuming you have the WSDL ready. It can generate server stubs, interfaces, holders etc in about 30 seconds, and also build client classes just as fast (which are great for the testing process).

  • Generate Prime Interface Availability and Utilization Report for unified APs

    Hi,
    I´m trying to generate interface availability and interface utilization report for unified APs on Prime Infrastructure 2.0, but it doesn´t display any information. I have created device health and interface health templates under desing/Monitor configuration/My templates and deployed under Deploy/Monitoring deployment, but it still don´t show any information,
    thaks for your help.

    Hi Alejandro,
    Did you solve this problem? Or is it a bug?
    I face the some issue with you, I just run "Report/Report Launch Pad/Deivce/Interface Utilization"
    and then I create a report for interface utilization.
    But it display nothing when the report run finished.
    I ask some guys in this forum, they said maybe it's a PI2.1 bug.
    BR
    Frank

  • How to open and XML file?

    Does anyone have a way on Mac to open an XML file for viewing. This can be done with WIN Excel and XML toolkit but doesn't exist for Mac Excel in Office 2008. I can open with TextEdit but would like to see the info with headers and cells without all the XML coding. Numbers 09 can't open it at all.

    Numbers uses XML to build the description of the documents but it's not an XML editor.
    A simple search in Google with the intricate key string xml editor AND mac return numerous interesting links.
    Yvan KOENIG (VALLAURIS, France) vendredi 9 octobre 2009 11:33:27

  • Names of interface tables and interface programs of oracle modules

    Hi all,
    i need urgent and accurate information about the names of interface tables and interface programs of the following oracle modules,R12, or either ther are custom made. Any accurate link refering to the desire information would be much appreciated.
    Plus i need a clear and simple definition and purpose of interface tables and interface program and by what other names are they known in industry.
    Data Object,Oracle Module
    Chart of Accounts,Oracle General Ledger
    Trial Balance,Oracle General Ledger
    Supplier Master,Oracle Payables
    Open Supplier Invoices,Oracle Payables
    Open Supplier Credit/ Debit Memos,Oracle Payables
    Open Supplier Advances,Oracle Payables
    Bank Master,Oracle Cash Management
    Customer Master,Oracle Receivable
    Asset Categories,Oracle Assets
    Asset Master,Oracle Assets
    Item Master,Oracle Inventory
    Item Categories,Oracle Inventory
    Sub Inventory and Locators,Oracle Inventory
    Item On Hand Balances,Oracle Inventory
    Item wise Per unit Cost,Oracle Inventory
    Bill of Material,Oracle Discrete Manufacturing
    Departments,Oracle Discrete Manufacturing
    Operations,Oracle Discrete Manufacturing
    Routings,Oracle Discrete Manufacturing
    Resources,Oracle Discrete Manufacturing
    Overheads,Oracle Discrete Manufacturing
    Employee Master,Approval Hierarchy
    Approval Hierarchy,Approval Hierarchy
    Open Customer Invoices,Oracle Receivables
    Open Customer Credit/ Debit Memos,Oracle Receivables
    Open Customer Advances,Oracle Receivables
    Pending Requisitions,Oracle Purchasing
    Pending Purchase Orders,Oracle Purchasing
    Open Sales Orders,Oracle Order Management
    Price List,Oracle Order Management

    Hi;
    Its metalink note you need to login metalink wiht valid CSI(customer Support Identifier) number to can se note via using note number.
    Please see:
    Oracle EBS Based and Interface tables
    Oracle EBS Based and Interface tables
    Regard
    Helios

  • HTML and XML files open in same window(KM Navigation iView)

    Hi All,
    I have created a KM navigation which is pointing the folder inside the documents repository. This folder contains HTML and XML files. It is rendering fine. But, when I click on the file links in KM Navigation iView, it is opening in new window.Here I need to open in same window. How can I acheive this?. Please help me.
    Thanks & Regards,
    Venkatesh R

    Hi ,
    check the below thread and try options mentioned in it
    https://www.sdn.sap.com/irj/sdn/thread?threadID=72594
    Koti Reddy

  • ASO: How to set up Quoting and XML to Print Quote in R12?

    Which are the steps to set up Oracle Quoting and XML in order to Print a Quote in R12?

    Hi,
    Please refer the Note : How to Create a Custom Print Quote Template in Oracle Quoting ? (Doc ID 780722.1)
    Thanks & Regards,
    Sridhar

  • Problems with reports and XML-publisher - No XML

    Hi!
    I'm having a problem with Apps and XML-publisher. I made a report file, which queries some views. When executing in reports, I get all the data I expect.
    Now, when I upload the reportfile to Apps and let it generate XML, my xml-file is empty (well, almost empty)
    <?xml version="1.0" ?>
    <!-- Generated by Oracle Reports version 6.0.8.27.0 -->
    <T03501684>
    <LIST_G_PERSOON>
    <LIST_G_PERSOON />
    </T03501684>
    Anyone who can shed any light upon this problem?

    OK, finally solved the problem... A good night's sleep always helps ;).
    After just trying each queried table one after an other, I found the problem:
    The difference between Oracle Apps (Dutch locale) and the reports builder (English) is the language... And our functional people have changed some names, but the Dutch ones, leaving the english names in place and one of the tables I query has language specific data, which is also appears in a where clause.

  • CS4 or CS5.5 are interface iphone and andriod apps  ?

    CS4 or CS5.5 are interface iphone and andriod apps  ? How can i do when i make a new web site in DW with support and interface iphone and andriod apps . or we should learn HTML 5 or Wordpress for that ? Thanks !!

    Thanks Jeff - ya,sorry, I should've specified. I'm running Win 7 64-bit and I have Production Premium CS4 on the system now. Ideally I would deactivate and uninstall it before I load CS5.5 Production Premium.
    My only reasoning is to save on SSD space. Is there any reason to keep CS4 on the machine, other than possible problems with CS5.5?
    Thanks again for your reply Jeff.

  • Have itl and xml files on external hd am running home premium. can  no longer access files, am told this is because they were created with a newer version of itunes. also when i try to download 10.3 it wont, just says invalid drive j and for me to try aga

    i am running vista home premium on desktop and vista basic on laptop. have placed my itunes music with .itl and .xml files onto external drive connected to another desktop running vista and can no longer access music on first two mentioned comps only on the one connected to external drive. always am told that the library cant be read because it was created using a newer version of itunes. have tried to download 10.3 but it always tells me that i have and invalid hard drive j and to try again. any ideas?

    Older versions of iTunes cannot read libraries created with newer versions of iTunes. You need to have the same version of iTunes on all your PCs. Is that the case?
    As far as the problem installing iTunes goes, see this article from b noir on dealing with the problem:
    https://discussions.apple.com/thread/2450004
    If you get to the point where you need the Microsoft Installer cleanup utility, you will need more help as it has been withdrawn by Microsoft. but I am hoping the virtual drive trick will work,

  • Difference between Interface node and normal node?

    What is the main difference between  Interface node and normal node?
    Cheers
    Aisurya.

    Hi surya,
    Interface node or methods comes into picture whenever you want to use one component as used component. I mean to say
    Component usages. If you select node as interface node, it will available in another component so you can use that node or methods.
    Normal node means in that component only. Simply we can say for component usages we go for interface nodes.
    Cehck This...
    http://help.sap.com/saphelp_nw70ehp1/helpdata/EN/79/555e3f71e41e26e10000000a114084/content.htm
    Cheers,
    Kris.

  • How to disable 'Save' button when OAF and XML Publisher integrated...URGENT

    Hi,
    I am new to the OA Framework and XML publisher. I have been working on a requirement where I am designing a new page in Manager Self Service with few fields and a submit button. Also designed a RTF template in XML publisher to display the output in PDF format.
    When the details are entered on the page and click on 'Submit' button, the PDF will Open with the data populated. This is working perfectly... thanks to the forum.
    But my issue is: When the submit button is clicked, it displayes a dialog box with Open/Save/Cancel options and if I click the 'Open', the PDF will be opened. But my client is a retail client and they don't want store managers to save this PDF so either I have to skip this dialog box and directly open the PDF or I have to disable the 'Save' on the dialog box.
    Gurus -- Please help me how to achieve this. This is very urgent
    Below is the piece of code I am using in the controller to generate the PDF.
    TemplateHelper.processTemplate(
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(),
    APP_NAME,
    TEMPLATE_CODE,
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(),
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(),
    inputStream,
    TemplateHelper.OUTPUT_TYPE_PDF,
    null,
    pdfFile);
    Thanks in Advance,
    Naren

    Frank, thanks for the update.
    But do you want me to try ControllerContext.getInstance().getCurrentViewPort().isDataDirty(); in button disable property?
    I have written one method in my am like
    public boolean isTransactionDirty(){
    return getDBTransaction.isDity();
    and exposed that method to client side and i try to use this method in my button disable property as
    disable#{bindings.isTransactionDirty.execute} but this is not working.
    Thanks

Maybe you are looking for